Академический Документы
Профессиональный Документы
Культура Документы
By
Jayanta Majumder
MASTER OF SCIENCE
AT
DECEMBER 2004
Supervisors:
Prof. Partha Pratim Chakrabarti
Reader:
Dr. Amit Patra
ii
INDIAN INSTITUTE OF TECHNOLOGY, KHARAGPUR
Signature of Author
THE AUTHOR ATTESTS THAT PERMISSION HAS BEEN OBTAINED FOR THE
iii
To Human Con
iousness.
iv
Table of Contents
Table of Contents vi
List of Tables vii
List of Figures viii
1 Introdu
tion 1
1.1 A PR-style Introdu
tion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 Motivation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.1 Debugging and Verifying Netlists . . . . . . . . . . . . . . . . . . . . 7
1.2.2 Debugging and Verifying Sequential Systems . . . . . . . . . . . . . 8
1.2.3 Analyzing Engineering Drawings . . . . . . . . . . . . . . . . . . . . 9
1.2.4 Feature Re
ognition in Solid Models . . . . . . . . . . . . . . . . . . 9
1.2.5 Opti
al Shape/Chara
ter Re
ognition . . . . . . . . . . . . . . . . . 10
1.3 Data Model for SQUARE . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
1.4 Qui
k Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5 Layout of the Thesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2 Mathemati
al Tools and Notations 17
2.1 Stru
tures : Sets, Tuples, Strings, Relations and Fun
tions . . . . . . . . . . 17
2.2 Propositional Predi
ate Logi
. . . . . . . . . . . . . . . . . . . . . . . . . . 22
2.3 Graphs : Basi
Denitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
2.4 Languages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
2.5 Des
ribing Semanti
s of Languages . . . . . . . . . . . . . . . . . . . . . . . 26
2.6 Relational Cal
ulus using Binary De
ision Diagrams . . . . . . . . . . . . . 26
3 The SQUARE Language 27
4 Integrating Appli
ations with SQUARE 32
5 Stru
tural Query on Cir
uits 33
5.1 Ba
kground . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.2 Reasoning about Netlists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
v
5.2.1 Netlists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
5.2.2 Types of Netlists . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.2.3 Reasoning Problems in Netlist . . . . . . . . . . . . . . . . . . . . . 41
5.2.4 Representation of Netlists . . . . . . . . . . . . . . . . . . . . . . . . 44
5.3 Overview of the Netlist Management System . . . . . . . . . . . . . . . . . 46
5.3.1 The Netlist Information Model and its Representation . . . . . . . . 46
5.3.2 Integration of SQUARE with the NMS . . . . . . . . . . . . . . . . 49
6 The Implementation of SQUARE 52
6.0.3 Algorithmi
s and Ar
hite
ture . . . . . . . . . . . . . . . . . . . . . 53
6.1 Evaluation of the all-paths Query . . . . . . . . . . . . . . . . . . . . . . . . 55
6.2 Evaluation of the Exists-Path Query . . . . . . . . . . . . . . . . . . . . . . 58
7 Results 60
8 Con
lusion and S
ope for Future Work 61
Bibliography 62
vi
List of Tables
vii
List of Figures
1.1 Two graphs (A) representing lo
ations and transport links, labelled with
transport modes (B) representing a part of the aquati
food
hain . . . . . 2
1.2 A NAND gate implementation in CMOS. . . . . . . . . . . . . . . . . . . . 4
1.3 Some Graph Models in Real World Appli
ations . . . . . . . . . . . . . . . 15
1.4 Some Typi
al Regular Expression Patterns . . . . . . . . . . . . . . . . . . 16
2.1 Truth table for NOT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
2.2 Common Propositional Binary Operators . . . . . . . . . . . . . . . . . . . 23
2.3 Truth Table for Common Propositional Binary Operators . . . . . . . . . . 24
3.1 A Labelled Graph. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.2 A simple exists-path query . . . . . . . . . . . . . . . . . . . . . . . . . . 28
3.3 Results of the query in gure 3.2 . . . . . . . . . . . . . . . . . . . . . . . . 29
3.4 A query involving two exists-path sub-expressions under logi
al
onjun
-
tion, and its exe
ution result . . . . . . . . . . . . . . . . . . . . . . . . . . 30
3.5 A query involving the all-paths expression and its exe
ution result . . . . 31
5.1 A Typi
al CAD Flow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.2 Two Netlists. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
5.3 Dierent Kinds of Netlists . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
5.4 Overview of the NMS System . . . . . . . . . . . . . . . . . . . . . . . . . . 47
5.5 Query to print all nets belonging to a
y
li
path not passing through a
ip-
op. 50
5.6 Query to print all the internal nets in a netlist. . . . . . . . . . . . . . . . . 51
5.7 Query to print all su
h nets that are not rea
hable from a given net through
FET
hannels in a transistor netlist. . . . . . . . . . . . . . . . . . . . . . . 51
6.1 A graph
ontext
onstru
ted for CNF-sat. . . . . . . . . . . . . . . . . . . . 55
6.2 An NFA interpreted from a CNF expression. . . . . . . . . . . . . . . . . . 56
viii
Chapter 1
Introdu
tion
Here we present a study on and a tool for querying and lo
ating patterns in labelled graphs.
It may be useful in appli
ations where (1) labelled graph stru
tures
an be asso
iated with
or inferred from the domain of appli
ation and (2) it makes sense to be able to lo
ate and
manipulate interesting portions of those graphs. For the unfamiliar readers, a graph is
an network-like stru
ture that represents some kind of
onne
tivity between some entities
of interest. Many real life situations
an be
onveniently expressed by network diagrams.
For example, in trying to work out a travel plan we
an represent lo
ations (eg.
ities)
by points and join
ertain pairs of those points by lines representing dire
t transport links
(Fig. 1.1(A)). We may annotate the lines with the transport modes available, and possibly
with a lot of other details like distan
e,
ost et
. As another example, in modelling a food
hain, we may represent ea
h
onsidered spe
ies as a point and join pairs of points with
arrow-headed lines su
h that the spe
ies represented by the point at the arrow-head is a
food to the spe
ies represented by the point at the arrow-tail (Fig. 1.1(B)). Mathemati
al
abstra
tion of su
h diagrammati
representations are
alled graphs. In su
h point and line
diagrams, a
on
eptional point is
alled
alled a vertex and a line is
alled an edge. We will
ome to their formal denitions in an abstra
t setting later. Graphs
an represent a very
wide range of situations and are
ommonly used in the design and analysis of engineering
systems. When a graph represents a large entity, nding and fo
ussing on a small and inter-
esting part of the graph is often useful. For example when the graph represents a designed
artefa
t like an ele
troni
ir
uit or a program, lo
ating or even testing the presen
e of a
spe
ied pattern in it
an help in navigating, verifying or possibly debugging the design.
This tool borrows ideas from some household unix tools like awk,sed and lex, and we intend
to provide a similar level of usability as these great forerunners, but unfortunately it
an
not be introdu
ed very readily. In the book dening awk, The Awk Programming Language,
by Alfred Aho, Brian Kernighan and Peter Weinberger [41℄ , the authors start the rst
1
2
Figure 1.1: Two graphs (A) representing lo
ations and transport links, labelled with trans-
port modes (B) representing a part of the aquati
food
hain
se
tion with examples. It was possible be
ause the information model that awk a
ts upon
is a stream of
hara
ters or a
ommon text le, whi
h is so familiar to the target audien
e
that it requires little introdu
tion. In our
ase, even if we expe
t the target audien
e to be
familiar with graphs, there exists no su
h
ommon representation of graphs (unlike text)
that we
an readily use in an introdu
tory example. Indeed graphs
an be asso
iated with
many
ommon databases and information models, but to introdu
e a fully running example,
some detailed explanation is required about
onguring the tool for the appli
ation, whi
h
we will
ome to at a later stage. So a fully working example is not possible at this stage.
Instead we shall provide a few high level examples, without bothering about the details of
how the example will be integrated with the appli
ation data. As a rst example, let us
assume that we have somehow plugged our graph query mat
hing tool into the transport
links graph (Fig. 1.1(A)) and want to pose the following query : whi
h pairs of lo
ations
are
onne
ted by one or more aeroplane
ights and also by a
ombination of heli
opter and
ferry rides. This translates to the following pattern spe
i
ation (the leftmost
olumn is a
line number and not a part of the query).
1: (and
2: (exists-path (x y) (aeroplane +))
3: (exists-path (x y) ([heli
opter ferry℄ + ) )
In the query, the symbols x and y in lines 2 and 3 represent two variables about whi
h
the query spe
ies some
onstraints. There are two
onstraints about x and y in lines 2
and 3; the rst one says that there exists a path from x to y whose label sequen
e satises
the regular expression (aeroplane + ), i.e. is
omposed of one or more edges with an
3
aeroplane label. The + is the positive
losure symbol of usual regular expressions. In the
se
ond
onstraint we state that there exists a path from x to y whose label sequen
e satises
the regular expression ([heli
opter ferry℄ + ), i.e. the path is
omposed of one or more
edges labelled with either heli
opter or ferry. The square bra
ket [heli
opter ferry℄
has similar sense as
hara
ter
lasses of usual regular expressions. The "and" in line 1 is a
logi
al
onne
tive that further enfor
es that the
onstraints in lines 2 and 3 must both hold
for x and y.
As another example, for a food
hain (like in Fig. 1.1(B)) let us pose a query to identify
ompeting spe
ies - i.e. the ones who share a prey.
1: (exists (z)
2: (and
3: (exists-path (x z) (true))
4: (exists-path (y z) (true))
5: (not-equal (x y)) ))
In this
ase, the regular expression (true) is used, in whi
h the label true is a spe
ial
one and holds on any edge, by denition. Here the regular expressions are trivial - any
single edge satises the expression (true). This query, when applied on the food
hain
graph,
onstrains the variables x and y in su
h a way that for some spe
ies z, both x and y
must be a dire
t predator to z, and also x and y are dierent. With a slight modi
ation
(by inserting line 6 in the following) we
ould ask as to whi
h pairs of spe
ies
ompete (i.e.
share a prey) yet one preys on the other.
1: (exists (z)
2: (and
3: (exists-path (x z) (true))
4: (exists-path (y z) (true))
5: (not-equal (x y))
6: (exists-path (x y) (true)) ))
Please note that we use the logi
al
onne
tives like "and", "or" et
. in prex syntax
(unlike their inx usage in the literature and algol family languages), we do this to prevent
unne
essary ambiguity (as is usually resolved by pre
eden
e spe
i
ations) and for e
onomy
of expression.
Another
onvenient aspe
t of the design is that it allows user dened predi
ates involving
any number of variables. These may be seen as hyper-edges in the graph. We will illustrate
this feature with an example. Consider an appli
ation s
enario where the user denes two
4
predi
ates pmos and nmos over the nets in a transistor
ir
uit database, where the predi
ate
pmos, in the notation (upred pmos (x y z)), is true for the three nets x,y and z, that
ontain the gate, drain, and sour
e terminals respe
tively of a pmos eld ee
t transistor.
Similarly dened is the nmos predi
ate for nmos transistors. Following is a query that
mat
hes instan
es of the sub
ir
uit in gure 1.2. Here the keyword upred signies that it
is a user-dened predi
ate.
1: (and
2: (upred nmos (x1 mid gnd))
3: (upred nmos (x2 mid out))
4: (upred pmos (x1 out vdd))
5: (upred pmos (x2 out vdd))
6: (all-distin
t (x1 x2 out mid gnd vdd) ))
The above query's resemblan
e of a textual netlist des
ription formats is noteworthy. This
entails that a textual netlist des
ription
an be easily transformed into a query using minor
text transformations. As yet another example, the following query mat
hes all instan
es of
omplete graphs of size 4 in a graph.
1: (and
2: (exists-undire
ted-edge (x1 x2))
3: (exists-undire
ted-edge (x1 x3))
4: (exists-undire
ted-edge (x1 x4))
4: (exists-undire
ted-edge (x2 x3))
5
It should also be noted that for lo
ating a subgraph of interest, it is not always ne
es-
sary to pose an fully unambiguous query. This is similar to the
ase with nding mat
hes in
a text where, for example, sear
hing for the pattern "namb" is enough for lo
ating the word
"unambiguous". Su
h pragmati
tri
ks may often help redu
e the
osts of query exe
ution.
We imagine that this kind of a system will be quite useful in lo
ating interesting or ex
ep-
tional patterns in
ir
uits and system des
riptions.
The syntax and semanti
s of the input language for the tool will be elaborated later on in
this thesis. In a mi
ro-gist, the language in
ludes the following.
1. Constru
ts for interfa
ing a database with this query framework
2. Constru
ts for spe
ifying the semanti
s of the basi
propositions or labels (eg. aeroplane
or heli
opter in an aforementioned example)
3. The query proper with (a) logi
al
onne
tives (eg. and, or, not, exists, forall
et
.) and (b) base predi
ates (eg. exists-path, not-equal, exists-edge et
.).
It is quite
onvenient to name anything that we must refer to several times, so we name
this tool and the language as SQUARE (whether standing for Stru
tural QUery And
REasoning or not). In the following se
tion we
ontinue with a PR or mass-media style
general introdu
tion to the work, it is not te
hni
ally informative but may have a slight
amusement value.
in most animals. Learning and intelligent behavior manifests as nding, remembering and
appli
ation of patterns. Human beings are good at it. For example we have found a single
ompa
t des
ription (or pattern) for apparently widely disparate phenomena like falling of
a fruit and the motion of the planets. In summary, nding patterns is extremely important.
We do it for our survival.
There is yet another a
tivity that has set us ahead of other fellow life forms - that of building
and using tools. Starting with
rude hunting bludgeons we have
ome to the point of hoping
to build tools that will relieve us from all work ex
ept the ones done for sheer pleasure.
The sophisti
ation of the tools we use, be it thought tools or physi
al tools, has been ever
in
reasing and this aspe
t is what sets us widely apart from our primates and an
estors.
Having understood the fundamental importan
e of pattern nding and tool making, it be-
omes obvious that developing a tool that aids in nding patterns, is a noble undertaking.
We have tried to do exa
tly that for some time, and this thesis is an attempt at dissemi-
nating the design and ndings.
Pattern dis
overy is a
reative pro
ess, and we have not had mu
h su
ess in me
hanizing
it, but it is easy to me
hanize the a
t of
he
king whether a hypothesized pattern o
urs
in a set of observations or obje
ts. We present a tool that enables us to nd or lo
ate the
o
urren
e of a spe
ial kind of patterns in a spe
ial kind of obje
ts. Neither the kind of
pattern, nor the kind of obje
ts we deal with, is novel, but there is some novelty in the
pra
ti
al details of usability and extensibility of the tool.
1.2 Motivation
A very naturalisti
approa
h to design or des
ribe obje
ts is to view them in terms of their
parts and the relationships between parts. Su
h a des
ription is referred to as stru
tural. A
lass of problems asso
iated with stru
tural des
riptions is to lo
ate or possibly just dete
t
presen
e of
ertain patterns within stru
tures. For the purposes of this thesis we
all this
lass of problems stru
tural reasoning or stru
tural querying.
The stru
tural des
riptions
an very often be represented by attributed relational graphs, in
whi
h the elementary entities are represented by verti
es, and the relationships between su
h
entities, by the edges of the graph. Unary features asso
iated with ea
h entity are modelled
by vertex attributes and binary features asso
iated with relationships are modelled by the
edge attributes. Su
h attributed graph stru
tures are en
ountered in several engineering
domains and appli
ations, and in many
ases it helps to be able to query them or reason
about them very well. The following subse
tions show how helpful su
h reasoning
an be.
7
Cir
uits, when des
ribed in terms of
onne
tions between stru
tural
omponents, are
alled
netlists. In the
ontemporary te
hnology of very large s
ale integration (VLSI) of
ir
uits,
netlists are most often
ompiled (i.e. generated) me
hani
ally from higher level abstra
tions
by software tools popularly known as sili
on
ompilers. Corre
tness of thus generated
netlists (with respe
t to spe
i
ation) may be assumed if the
ompilation pro
ess is assumed
orre
t, whi
h is arguably not yet the
ase with the
urrent level of maturity of sili
on
ompilers. Moreover as we are moving
lose to the physi
al limits of the devi
e te
hnologies
the engineers are using more and more
ustom optimization (manual pla
ement et
.) to
get the most out of the available devi
e te
hnologies. What transpires of this is that the
utting edge designs are usually
omplex assemblies of hand
rafted designs, standard
ells,
ma
ro
ells and
ells generated by sili
on
ompilers. Moreover, the
o-existen
e of analog
and digital
ells on single
hips (typi
al in systems on
hip), requires
ustom hand
rafting
thereby invalidating the assumption of
orre
tness by me
hanized
ompilation.
Thus veri
ation and debugging of
ir
uits remains to be an important a
tivity in ele
troni
ir
uit design pro
esses. A signi
ant
omponent of stru
tural debugging and veri
ation
a
tivity involves spe
ifying and mat
hing interesting patterns in netlists. We illustrate some
ontexts where stru
tural queries on nelists
an be quite useful.
A dynami
CMOS te
hnique named NORA [48℄ requires that there should be no path
through stati
CMOS gates from the outputs of a -C2MOS gate to the inputs of a
-n-dynami
or a -p-dynami
blo
k.
Some design styles disallow PMOS transistor
hannels
onne
ted to VSS or NMOS
hannels
onne
ted to VDD. In a netlist extra
ted from layout a violating
ongura-
tion may
onne
t an NMOS
hannel to VDD through a resistive path, whi
h needs
to be dete
ted.
Be
ause of the layout pra
ti
e of transistor folding, a single transistor in a s
hemati
an be implemented as several parallel transistors in a layout, and the extra
tor may
infer additional passive devi
es between parallel transistors. For a layout vs s
hemati
(LVS) veri
ation to su
eed, su
h variations need to be lo
ated and reasoned about.
It is a violation of CMOS design rules to use a net that does not have a path to VDD
through PMOSFET
hannels, as input to any gate. Possibility of its violation may be
ruled out in a design involving library
ells but in hand
rafted layouts it is possible
to o
ur as a result of erroneous design.
8
Behavior of sequential systems is very often des
ribed in terms of a nite state ma
hine
(FSM), whi
h is an abstra
t model
onsisting of a nite set of states and a transition
relation between states[9℄. Contemporary VLSI systems are
ommonly designed at this
level of abstra
tion. Design of large sequential systems, as typi
al of VLSI systems, is a
omplex task and is liable to human errors, but the e
onomi
s and the safety
riti
ality
of the appli
ations di
tate that the
ost of su
h errors
an be extremely high. In order
to redu
e the
han
es of su
h errors' appearing in the nal produ
ts, it is ne
essary, as is
observed in
ommer
ial design pro
esses, that a major eort is made towards verifying the
designs before they are mass produ
ed or deployed. The predominant veri
ation method
is that of simulation, in whi
h the system is simulated and the simulation tra
e is
he
ked
for
orre
tness against some spe
i
ations. For non-trivial systems, the
omplete spa
e of
behaviors is so large that any reasonable amount of simulation
an
over only a small part
9
of the spa
e, hen
e this method
an not make any hard guarantees of
orre
tness. Alongside
simulation, there is another approa
h to veri
ation whi
h is
lassied as formal veri
ation
and is aimed at providing hard guarantees or proofs of
orre
tness. Among the many formal
veri
ation methods, Model Che
king, is gaining popularity due to its s
alability to fairly
large designs. In this approa
h the
omplete system tra
e is formally veried against some
stru
tural spe
i
ations. There are some tiny languages for spe
ifying patterns of trees,
paths and subgraphs that
an be mat
hed in some way on labelled graphs inferred from
FSM des
riptions. CTL, QCTL, WQCTL, CTL*, LTL and regular expression are to name
a few su
h languages [6, 7, 11, 10, 12, 26, 28℄. The FSM is abstra
ted as a labelled graph
and the desired properties are modelled as patterns in those little pattern languages so that
mat
hing the patterns with the graph is equivalent to
he
king the properties. This is yet
another example s
enario where good ways of querying attributed graphs
an be helpful to
mankind.
1.2.3 Analyzing Engineering Drawings
An important problem is that of extra
tion of fun
tional information from engineering
drawings automati
ally. There is a huge lega
y of engineering drawings that are stored
as ve
tor graphi
s data (typi
ally as a set of line segments and text) but devoid of any
fun
tional or semanti
annotation. Su
h drawings have traditionally been meant for human
interpretation. Many re
ent appli
ations need more stru
tured and annotated des
riptions
of obje
ts represented by su
h drawings. Su
h stru
tured des
ription
an be inferred or
extra
ted from the the geometri
data in the drawings through stru
tural reasoning.
The interse
tion points and end points of the line segments in the drawings
an be viewed as
verti
es, and the segments themselves
an be viewed as edges of an indu
ed stru
tural graph.
Their geometri
properties
an lead to a ri
h set of attributes. Alternatively a
onstrained
DeLaunay triangulation of the drawing (with the original segments as
onstraints) may
be
onstru
ted, for whi
h ea
h triangular
ell may indu
e a vertex and the
ell adja
en
y
relation may indu
e the edges of a graph. This stru
ture too is ri
h in geometri
attributes
that
an be used in pattern spe
i
ation and re
ognition.
1.2.4 Feature Re
ognition in Solid Models
The boundary representation of solid models have an inherent graph stru
ture
onsisting
of its fa
e elements whi
h
an be viewed as verti
es, and the adja
en
y relation among fa
e
elements whi
h
an be viewed as edges. Many interesting attributes
an be asso
iated with
10
this graph. Several elementary geometri
properties like edge length, fa
e area, edge
onvex-
ity, edge angle, number of
onvex-
on
ave transitions along a fa
e boundary et
. are some
interesting primitive attributes and
onstitute a ri
h alphabet for des
ribing features. Fea-
ture re
ognition is important be
ause a mere boundary represented solid des
ription does
not dire
tly provide the information required in many appli
ations. For example, manu-
fa
turing pro
ess design would require identi
ation of lo
al protrusions and depressions
whi
h
an in prin
iple be inferred from the boundary representation but through feature
re
ognition.
1.2.5 Opti
al Shape/Chara
ter Re
ognition
Low level features
an be extra
ted from an image through edge dete
tion and ve
torization.
These low level features
onstitute the elementary obje
ts (or verti
es) and a neighborhood
relationship gives rise to the edges of a graph stru
ture. The properties of the feature ob-
je
ts and their neighborhood relationship dene the set of primitive attributes of the graph
elements. The problem of re
ognition of
hara
ters or shapes in the original image may thus
be redu
ed to identi
ation of subgraphs of the extra
ted attributed graph that
onforms
with some designed stru
tural spe
i
ation (possibly expressed as a grammar).
The number of appli
ations of stru
tural querying has been growing steadily over the
past few de
ades through identi
ation of new areas, through in
reases in viability and
s
alability with the in
rease in
omputing power and through algorithmi
improvements.
The following are to name a few more (1) ngerprint re
ognition (2) spee
h re
ognition (3)
remotely sensed data analysis (4) biomedi
al data analysis in
hromosome images,
artoid
pulse waves, EEG signals et
. (5) texture analysis (5) spark
hamber pi
ture analysis and
(6) geophysi
al seismi
signal analysis.
Graph based modelling is one of the main modes in whi
h dis
rete mathemati
s has been
applied to real world problems. A multitude problem domains have been mapped to labelled
graph models and and several of them
an benet from this ni
e query tool. Figure 1.3 is
a table of many su
h instan
es of graph based modelling (ex
eprted from [62℄).
Indeed all relations in any obje
t database
an be seen as homogeneous if all the
obje
ts are treated as instan
es of a fundamental super-type, and type spe
ializations
appear as spe
ial predi
ates. Thus the homogeneous qualier of SQUARE's data model
is not restri
tive and SQUARE
an a
tually be used to query any obje
t database.
However its
apability is best utilized when the database has graph like semanti
s.
We use an approa
h in whi
h the query language is fairly independent of the underlying
data, i.e. the spe
i
s of the underlying data is handled by
ode generated from the query
and by the appli
ation spe
i
interfa
e
ode provided by the user.
expressions, ea
h of whi
h may
ontain some variables. Ea
h query expression is a predi
ate
over its variables and denotes the bindings of its variables for whi
h the predi
ate evaluates
to true. For example, the following primitive subexpression indi
ates bindings of all su
h
pairs of nets (in a netlist) to the variables x and y, for whi
h there exists a path in the
ir
uit graph satisfying the regular expression (drain to sour
e * sink is vdd). Here
drain to sour
e and sink is vdd are atomi
propositions, and '*' is the usual Kleene
losure operator of regular expressions [9℄.
(exists-path (x y) (drain_to_sour
e * sink_is_vdd))
As another example, the following expression involving just one variable x denotes all su
h
bindings to x that has a self rea
hable path through edges from input pins to output pins,
(relevant in a gate level netlist). The '+' in the expression is the positive
losure operator of
regular expressions [9℄. A non-empty resulting set of bindings obtained on a netlist for the
following expression will indi
ate the presen
e of a
ombinational loop.
(exists-path (x x) (in_to_out +))
The proposition in to out is so dened that only the edges from input to output pins
are labelled with it. The regular expression part
an be very expressive in spe
ifying path
patterns. Some typi
al patterns that may be very useful are listed in Figure 1.4.
The query subexpressions, as has been illustrated,
ontains variables. A
omplete query is
a
omposition of several basi
subexpressions
onne
ted by relational
al
ulus
onne
tives
like logi
al operators AND,OR,NOT et
. and quantiers over variables in subexpressions.
For example,
(and <subexpression 1 involving variables x y z>
<subexpression 2 involving variables w v x>
<subexpression 3 involving variables u y z> )
indu
es all bindings of variables u,v,w,x,y and z for whi
h all predi
ates in the subex-
pressions 1,2 and 3 evaluate to true.
If the
onne
ting operator in the above expression was or instead of and, then the indu
ed
bindings would be su
h that at least one subexpression is true.
The semanti
s of quanti
ation is identi
al to that in the domain relational
al
ulus and
rst order logi
. The variables that are quantied are said to be bound and do not generate
bindings in the overall expression. A variable that is not bound, i.e. whose o
urren
e is
not within the s
ope of a quantier that quanties it, is
alled
alled a free variable.
For example the expression
(exists (x) <subexpression involving x,y and z>)
14
has only y and z as its free variables, and the semanti
s of quanti
ation eliminates the
s
ope of the bound variable x in any outer expression, of whi
h the above expression is
a subexpression. The same variable symbol may appear in any outer expression but it
is treated as a dierent variable from that inside the quantifying subexpression. In the
above, we mentioned a query primitive whi
h
omputes whether there exists a path between
two given verti
es, with the string of edge labels satisfying a given regular expression.
Complementary to this, there is another query operator that
omputes whether all possible
paths between two given verti
es satisfy a given regular expression. SQUARE in
ludes
primitive expressions of
omputational tree logi
(CTL), for whi
h the queried graph is
interpreted as a Kripke Stru
ture, whi
h is a nite folded model of an innite tree (to be
elaborated in a subsequent
hapter). Finally, for ea
h query, one
an spe
ify some a
tion to
be performed for ea
h satisfying assignment of the free variables. This aspe
t is similar to
that of awk. There are three a
tion
ode blo
ks, one is
alled at the beginning of the mat
h
pro
ess, another is
alled on ea
h satisfying assignment of the query, and the nal one is
alled after all the satisfying assignments have been traversed.
17
18
positions. The set operations mentioned above are not normally appli
able on tuples. Simi-
lar to
ardinality of sets is the arity of a tuple, whi
h is the number of its elements. A tuple
with n elements is said to be of arity n or n-ary (as spe
ial
ases, 1-ary is
alled unary, 2-
ary is
alled binary, 3-ary is
alled ternary). A binary tuple is also
alled an ordered pair.
An n-ary tuple is often
onveniently
alled n-tuple. The parentheses (), is used for en
losing
the elements of a tuple (unlike the bra
es fg for sets). Ea
h member in a tuple has a xed
position. To refer to an element of a tuple, we may use an ordinal name of its position
(1st ; 2nd ; 3rd ; : : : ; nth et
.). For example, in a tuple (; ;
; Æ), its 4th element is Æ. Some-
times we asso
iate a s
hema with a tuple. A s
hema of a tuple is a meta-des
ription of the
tuple. A s
hema of an n-tuple T is another n-tuple whose kth element is a referring name
for the kth element of T . We illustrate this with an example. If H = (name, age, gender) is
the s
hema for two tuples T1 = (Peter Parker; 26; M) and T2 = (Mary Jane Watson; 25; F),
one
an refer to the elements of T1 and T2 by the element in the same position in H , eg.
age of T1 is 25, name of T2 is Mary Jane Watson et
. (a
ording to s
hema H, whi
h is
assumed by
ontext). A tuple that has an asso
iated s
hema is often
alled a re
ord, as
ommonly en
ountered in the parlan
e of databases.
Another
losely related
olle
tion obje
t is a sequen
e. A sequen
e is a tuple (i.e. an
ordered
olle
tion) , ex
ept that (1) we never view a sequen
e as a re
ord (i.e. there
is no s
hema), (2) their elements are in some sense similar and (3) we dene an addi-
tional operator on strings
alled
on
atenation. We use the angle bra
kets hi in the
notation to en
lose the elements of a sequen
e. If 1 = ha1 ; a2 ; a3 ; : : : ; am i and 2 =
hb1 ; b2 ; b3 ; : : : ; bn i are two sequen
es, their
on
atenation, denoted by 1 + 2 is the sequen
e
ha1 ; a2 ; a3 ; : : : ; am ; b1 ; b2 ; b3 ; : : : ; bn i. Analogous to
ardinality of sets and arity of tuples, is
the length of a sequen
e whi
h is the number of its elements. A sequen
e is often spe
ied
by a generating fun
tion, and is represented by a notation of the form hf (i) : i = 1 : : : ni.
Here the rst element of the sequen
e is f (1), the se
ond element is f (2) and so on till the
nth element. In this notation one
an spe
ify innite sequen
es too (eg. hi2 : i = 1 : : : 1i).
Next we dene another very important operation on sets whi
h
ould be dened only after
we have introdu
ed tuples. It's the
artesian produ
t of two sets. The
artesian produ
t
S1 S2 of two sets S1 and S2 is dened as:
S1 S2 = f(x1 ; x2 )jx1 2 S1 and x2 2 S2 g
i.e. it is the set of all su
h binary tuples (ordered pairs) whose 1st element belongs to the
left operand S1 and whose se
ond element belongs to S2 . When we
ompute multi-produ
ts
by su
essive appli
ation of
artesian produ
t we get tuples of tuples in the produ
t set.
20
A binary relation R is
alled a total order if it is a partial order and for every tuple
(x; y) in S S , one of the three must hold (1) (x; y) 2 R, (2) (y; x) 2 R or (3) x = y.
Next we
ome to the nal major
on
ept of this se
tion - the fun
tion. A fun
tion may be
thought of as a spe
ial kind of binary relation. A fun
tion f is a binary relation between
two sets S and T su
h that for a member x of S there is exa
tly one entry (x; y) in f .
The two asso
iated sets S and T of the fun
tion f are
alled its domain and
o-domain
respe
tively, and the notation for writing that is f : S ! T . If (x; y) 2 f , y is
alled the
image of x under the fun
tion f . A fun
tion assigns exa
tly one image to every element of
its domain. If we slightly loosen this restri
tion by saying that some elements of the domain
may not have an image (i.e. for ea
h element x in S , if there is at most one entry (x; y) in
S ) then su
h a relation is
alled a partial fun
tion. When (x; y) 2 f , we use the notation
y = f (x). The set fyjy = f (x) and x 2 S g is
alled the range of the fun
tion f , whi
h
is a subset of its
o-domain (T ) and is denoted by the f (S ). Fun
tions have the following
ommon qualiers.
A fun
tion f is surje
tive or onto if f (S ) = T . That is to say, for every y 2 T there
is at least one (x; y) 2 f .
A fun
tion is inje
tive or one-one if no two elements of S have the same image, i.e.
if f (x1 ) = f (x2 ), then x1 = x2 .
A fun
tion f that is both inje
tive and surje
tive is
alled bije
tive.
For a set S1 whi
h is a subset of the domain S of a fun
tion f : S ! T , f (S1 ) denotes the
set fyjy = f (x) and x 2 S1 g and is
alled the image of S1 under f . Conversely, for a set T1
whi
h is a subset of the
o-domain T of f , f 1 (T1 ) denotes the set fxjf (x) 2 T1 and x 2 S g
and is
alled the inverse image of T1 under f .
One may dene arity of a fun
tion depending on the
omposition of its domain. If the
domain set is a
tually an n-ary relation, then we
all the fun
tion to be n-ary. For a tuple
(x; y) belonging to a fun
tion f , we
all x the argument to f and
all y the returned
value of f . One parti
ular
lass of fun
tions is spe
ially important - it
onsists of the
ones for whi
h the domain is S n and the
o-domain is S for some set S . Su
h a fun
tion
f : S n ! S is
alled an operator of arity n (or n-ary operator) over the set S . We did
mention operator earlier in this se
tion, eg. while introdu
ing [, \, 0, ./ et
. of sets, well
before we
ame to dene it. In doing so, we bumped into the following
ir
ular denition.
Cartesian produ
t () is like an operator over the set of all sets (speaking stri
tly, the
set of all sets has some inherent
ontradi
tions and is assumed not to exist, but it doesn't
22
hurt to have the intuition of it). Then we
ame to dene relations as subsets of
artesian
produ
ts. Then fun
tion was dened as a spe
ial kind of relations, and nally operator is
a spe
ial
lass of fun
tions. In the former appearan
e of the
on
ept operator I pretended
the presen
e of the intuition that an operator is some gizmo that produ
es something out
of something (in those
ases it produ
es new sets out of sets.). The same intuition prevails
even after the formal denition. I hope a more
areful and rigorous des
ription
an avoid
this
ir
ular denition but I am ignoring it here as the
on
epts appear intuitively
lear.
Moreover indu
tive (re
ursive) denitions are perfe
tly alright in mathemati
s, but I don't
know whether this
ir
ular denition falls in that
ategory. It is quite intuitive to view a
fun
tion as a devi
e that a
ts upon the elements of its domain set and produ
es elements
of its
o-domain set, and for a given domain element, its appli
ation always produ
es the
same
o-domain element. The same intuition does well for operators ex
ept that operators
are more restri
ted in the
hoi
e of domain and
o-domain sets, in that the two have to be
the same set.
A fun
tion, by denition is a spe
ial
ase of a relation but is as expressive a stru
ture
as a relation. Any relation may represented by a fun
tion. For example, if R 2 A B C
is a relation and if a fun
tion f : A B C ! fT; F g is dened as f (z ) = T if z 2
R and otherwise f (z ) = F , then the fun
tion f expresses the same information as the
relation R. This shows that fun
tions and relations are expressively equivalent. This idea
will be used subsequently in en
oding relations as fun
tions (propositional fun
tions, to
be pre
ise)and symboli
ally manipulating a spe
ial representation (
alled binary de
ision
diagram) of the fun
tions to perform impli
it operations over relations. This
an be
elaborated further only after introdu
ing propositional fun
tions and binary de
ision
diagrams. The following se
tions will introdu
e these requisite
on
epts.
onne
tives for
omposing elementary statements into
ompound statements. Coming to
pin down the denitions, any statement that has an asso
iated truth value from the set B
is
alled a proposition. Propositions are either atomi
or
omposite. The truth or false-
hood of an atomi
proposition is its intrinsi
property and is not subje
t to reasoning -
i.e. atomi
propositions are those statements that we do not analyze or de
ompose further
in propositional logi
. A
omposite proposition is made out of atomi
propositions and
logi
al
onne
tives, whi
h in turn are a few operators dened on the set B . We denote
atomi
propositions by arbitrary symbols (eg. P,Q,"Mars is red", "sky is green"). There
are a few operators dened on B whi
h are applied on propositions as if propositions are
variables representing their truth values. The most
ommon operators are AND (denoted
by ^), OR (denoted by _) and NOT (denoted by :). AND and OR are binary and NOT
is unary (1-ary). The domain set for the operators are so small that the operators
an be
spe
ied enumeratively yet
on
isely. Please note that by
onvention most authors use the
inx notation in whi
h the binary operator symbol is written between the two operands.
However in the syntax of SQUARE we shall use the prex notation in whi
h the operator
symbol pre
edes the operands. The unary NOT or negate (whi
h is an operator over B )
of a proposition p, is usually represented by one of the notations: :p, p, p0 , p or (NOT p).
The denition goes that :p is (or has a truth value) T if p is F , and is F when p is T . This
is usually written in the truth table from as in gure 2.1. The
ommon binary
onne
tives
p :p
T F
F T
Figure 2.1: Truth table for NOT
are named in gure 2.2 and their fun tional mappings given in gure 2.3.
2.4 Languages
The basi
obje
t in the study of languages is a string. A string is a sequen
e of sym-
bols. For example, all the english words are sequen
es of letter symbols and therefore are
strings. The entire language is a set of su
h strings. In formulating a formal stru
ture
of languages, we need to x the set of symbols that
an appear in the strings. Su
h a
nite set of symbols is
alled the alphabet, let's
all it V . If s1 = hu1 ; u2 ; u3 ; : : : ; um i
and s2 = hv1 ; v2 ; v3 ; : : : ; vn i are two strings, their
on
atenation, denoted as s1 :s2 , is the
sequen
e hu1 ; u2 ; u3 ; : : : ; um ; v1 ; v2 ; v3 ; : : : ; vn i. An empty string hi is denoted by " and is the
identity element under
on
atenation. It may be noted that the operator of
on
atenation
is asso
iative and would form a semigroup over a set of strings that is dened to be
losed
under
on
atenation. The free monoid V generated by an alphabet V is the stru
ture
whose domain is the set of all strings
omposable from the symbols in V, with the semigroup
operation of string
on
atenation.
A language over an alphabet V is a subset L of its free monoid V .
The
on
atenation of two languages L1 and L2 is the set fxy : x 2 L1 ; y 2 L2 g, and is
denoted by L1 L2 .
The ith power of a language L is denoted as Li and dened re
ursively by the rule L0 = fg
and Li = Li 1 L; i 0.
The union of two languages L1 and L2 is the usual set theoreti
union of the two sets of
strings that
onstitute ea
h language, and is denoted as L1 [ L2 . Similarly the interse
tion
of two languages L1 and L2 is denoted as L1 \ L2 and is the usual set theoreti
interse
tion.
The
omplement of a language L over an alphabet V is the set theoreti
omplement
language L, where where the free monoid V is taken as the universe of dis
ourse for the
omplementation. The Kleene
losure (or Kleene star) of a language L is denoted as
L and is dened as the union i0 Li .
S
The positive
losure (or Kleene plus) of a language L is denoted as L+ and is dened
S
as the union i1 Li .
A language L is regular if it is one of the following and nothing else.
The empty set ;.
26
vertex of the last edge en of the path he1 ; e2 ; : : : ; ek ; : : : ; en i is
alled its last vertex. We
informally
all a path to be from its rst vertex and to its last vertex. The path queries
in SQUARE involves de
iding whether for a path there is a label string that is a
epted
by a given regular expression. We illustrate this using an example. Consider the graph
given in gure 3.1 (Please note that the labels on the edges are written in positive form, i.e.
absen
e of a label symbol implies presen
e of its negate). When the following query is posed
b,c
b,c
n1 a a,b n2 b
a
a a n5 n4
n3 a n6 b
b
n8 n7 a
n10 n9
on the graph of gure 3.1 , we intend to mat
h all su
h pairs of verti
es (x,y) for whi
h
there is a path from x to y (i.e. a path with x as its rst and y as its last vertex) whose
label sequen
e satises the regular expression (a (a b) +), whi
h means that it has a label
string belonging to the set fha,b,ai,ha,b,a,b,ai,hb,a,b,a,b,ai,...g i.e. the set of all
strings starting with an a and followed by one or more repetitions of the sequen
e ha,bi.
The exe
ution of this query would print the result as in gure 3.3. To ask for pairs of nodes
(square
:vars (x y)
:query (exists-path (x y) (a (b a) +))
:begin "int
nt=0;
out<<\"beginning to mat
h\"<<endl;"
:a
tion "
out<<x->getName()<<\"->\"<<y->getName()<<endl;++
nt;"
:end "
out<<endl<<\"found \"<<
nt<<\" mat
h(es) \";"
)
beginning to mat
h
n1->n8
n1->n6
n1->n9
n1->n4
n1->n5
n2->n6
n2->n9
n2->n4
n2->n5
n7->n9
n7->n4
n7->n5
ones of grep, awk et
. The dieren
e mainly stems from the fa
t that here the alphabet
symbols are names of propositions and
an be several
hara
ters long. Thus su
essive
symbols in the expressions are separated by spa
e. Parenthesis is used for grouping, for
example in the expression (a (b
d) *), it is the subexpression (b
d) that goes under
the Kleene
losure. The symbol or is spe
ial in a regular expression and spe
ies alternative
subsequen
es. For example, the expression (a (b
) or d e) would mat
h paths with
label strings ha,b,
,ei or ha,d,ei. As should be
lear from this example, the or applies
to the symbol or group immediately to the left and right of the or symbol and spe
ies
the alternative subsequen
es hb,
i and hdi. One
an also spe
ify the boolean negate of
a proposition symbol in a regular expression, whi
h is denoted by an immediate prex
(tilde) with the proposition symbol. For example, if a is a proposition symbol, a is its
negate.
Another interesting query operator related to paths in graphs is that of all-paths. Using
an all-paths query expression, one spe
ies a
onstraint on two verti
es - that all the paths
between the two verti
es have a label string a
epted by a spe
ied regular expression. We
illustrate this with an example. Consider the query in gure 3.5 as being posed on the
graph of gure 3.1.
30
Query:
(square
:vars (x y)
:query (and
(exists-path (x y) (
*))
(exists-path (x y) (a (b a) +))
)
:begin "int
nt=0;
out<<\"beginning to mat
h\"<<endl;"
:a
tion "
out<<x->getName()<<\"->\"<<y->getName()<<endl;++
nt;"
:end "
out<<endl<<\"found \"<<
nt<<\" mat
hes \";"
)
Result:
beginning to mat
h
n1->n6
Figure 3.4: A query involving two exists-path sub-expressions under logi
al
onjun
tion,
and its exe
ution result
The query expression (all-paths (x y) ((a b) +) ) spe
ies the
onstraint that all
the paths with x as rst vertex and y as last vertex has a label string mat
hing the regular
expression ((a b) +). But what if there is no path from x to y ? In order to understand,
we have to take a
loser look at the semanti
s of the subexpression. This subexpression
holds for all su
h assignments of the variables x and y ranging over the verti
es, for whi
h
there is no path from x to y that does not satisfy the regular expression ((a b) +), and
in parti
ular when there is no path at all from x to y then it naturally holds for that pair.
Not that it
ould not be dened otherwise for this spe
ial
ase but this denition is more
aestheti
ally pleasing. This is somewhat similar to the denition of logi
al impli
ation of
propositional logi
where A ) B is true irrespe
tive of B when A is false.
Thus, posing merely the expression (all-paths (x y) ((a b) +) ) as a query would yield
several su
h assignments of x and y for whi
h there is no path from x to y (e.g (x=n2,y=n1),
(x=n3,y=n1) et
. in gure 3.1). The
omplete query (gure 3.5) ex
ludes su
h pairs by
additionally
onstraining the variables x and y by the subexpression (exists-path (x y)
(true *)), whi
h states that there must exist a path from x to y, hen
e the result
onsists
of the few assignments for whi
h there indeed exists a path (or more) from x to y and all
31
Query:
(square
:vars (x y)
:query (and
(all-paths (x y) ((a b) +) )
(exists-path (x y) (true *)))
:begin "int
nt=0;
out<<\"beginning to mat
h\"<<endl;"
:a
tion "
out<<x->getName()<<\"->\"<<y->getName()<<endl;++
nt;"
:end "
out<<endl<<\"found \"<<
nt<<\" mat
h(es) \";")
Result:
beginning to mat
h
n2->n7
n2->n10
Figure 3.5: A query involving the all-paths expression and its exe ution result
32
Chapter 5
33
34
is the s
ale of integration of ele
troni
ir
uits, whi
h is a measure of the size and
omplexity
of the systems realized through them. The ele
troni
s industry has termed the
urrent (as
of 2004) stage of integration VLSI, an a
ronym for Very Large S
ale Integration, sporting
hips with hundreds of millions of swit
hing elements, with personal
omputers possessing
billions of bytes of memory and performing billions of operations per se
ond.
The s
ale of
ir
uit integration has
ome a very long way within a few de
ades sin
e the
in
eption of this te
hnology. The rate of improvement of this s
ale has been ee
tively ex-
ponential, roughly obeying Moore's law - a prophe
y by Gordon Moore, one of the founders
of Intel Corporation, who envisioned that the number of transistors per
hip will
ontinue
to double every eighteen months. A major enabling fa
tor for this enormous growth has
been the breakthroughs in semi
ondu
tor devi
e te
hnology that make it possible to
reate
swit
hing elements of very small (deep submi
ron) dimensions. Another signi
ant enabling
fa
tor has been the appli
ation of
omputers in improving the ele
troni
design methodol-
ogy, popularly known as
omputer aided design (CAD). Although the advan
es in pro
ess
and devi
e te
hnologies have arguably made more drasti
dieren
e in VLSI performan
e
and s
ale, it is through the extensive use of CAD te
hnology that designers tame the enor-
mous
omplexity of the design task and translate devi
e te
hnologies into appli
ations that
make the big dieren
e in everyday life.
Contemporary VLSI CAD te
hnologies, espe
ially in the domain of digital design, have
progressed to a level where a typi
al design initiates as a high level spe
i
ation of the sys-
tem's behavior and then CAD tools pretty mu
h take over the rest of the task. Simulators
render the high level spe
i
ations into exe
utable models, design
ompilers
ompile these
spe
i
ations into stru
tural forms that are
onse
utively
loser and
loser to the sili
on im-
plementation and various types of analyzers extra
t relevant properties of a design thereby
helping in evaluating various aspe
ts of it.
The holy grail of the emerging dis
ipline of ele
troni
design automation (EDA) is
omplete
automation in the design work
ow, that requires minimal designers' intervention in the de-
sign pro
ess. Some
ommer
ial EDA eorts are a
tually
lose to it but not quite there yet.
Mu
h of its
ause
an be attributed to the fa
t that
utting edge of design is always trying
to venture into hitherto unexplored territories thereby raising multitudes of new issues that
are not taken
are of by existing do-it-all EDA solutions. Thus the industrial strength VLSI
CAD
ows remain to be multi stage pro
esses as shown in Figure 5.1 and requires designers'
attention at ea
h stage.
Several kinds of spe
ialized software tools are deployed in a CAD
ow. The fun
tionalities
of the CAD tools may be
ategorized as follows.
35
1 2
Behavioral Description
7
Register Transfer Level
3
Properties
Equivalence Checking
(Temporal,
Causal)
FSM Verification
Logic Synthesis
8
4
Timing & Gate and Standard Cell Level
Structural (Netlist)
Constraints Structural & Timing
Equivalence Checking
Verification
Physical Synthesis
Physical Synthesis
6
5 Extraction
Placement
Device Level
Layout Level
Layout Vs Schematic(LVS)
Modelling: Constru
tion of
omputational models that
apture the behavior or stru
ture of the
design. Modelling a
tivities range from physi
ally based
hara
terization of semi-
ondu
tor devi
es to high level des
ription of large VLSI systems. Computational
modelling aids in
lude textual and graphi
al languages and notations for des
ription
of models. There are numerous modelling formalisms for
apturing the des
ription
of dierent abstra
tions of VLSI systems. The hardware des
ription languages like
Verilog [57, 58, 59℄ and VHDL [60, 61℄ are large and multiparadigm languages and
support several system modelling methods. The abstra
tions of modelling formalisms
in
lude behavioral, data
ow, register transfer level (RTL), gate level, boolean expres-
sions, state ma
hine, transistor level and physi
al layout level. Figure 5.1 shows some
of these abstra
tions in the
ontext of a typi
al CAD
ow.
Simulation: Dynami
exe
ution of a
omputational model that is equivalent to the exe
ution of the
design. Simulations are equivalent to the real systems in the aspe
ts of interest and not
in totality. Simulation, in the
ontext of VLSI, is done at dierent levels of abstra
tion
and with dierent requirements of a
ura
y. Usually a trade o is made between
a
ura
y and performan
e. At one extreme there are pro
ess based simulators that
simulate the physi
s of semi
ondu
tor ele
troni
s of devi
es and at the other extreme
are behavioral simulators that exe
ute the high level spe
i
ations of a system as a
whole. Between the extremes there are devi
e level analog simulators like SPICE [42℄
and Spe
tre (by Caden
e In
.), symboli
simulators like SIRSIM[43℄, event driven (eg.
IRSIM [39℄, I
arus Verilog et
.) and
y
le a
urate simulators (like Cy
lone VHDL and
Verilog Compiled Simulator (VCS) by Synopsys In
.,
f. http://www.synopsys.
om)
for gate level and register transfer level models, all
atering to dierent aspe
ts and
abstra
tions of a design.
Synthesis: Derivation of an implementation from a spe
i
ation. The goal of ele
troni
de-
sign automation (EDA) is to tape out
omplete and
orre
t
hips from high level
spe
i
ations. This end is a
hieved by several stages of synthesis, ea
h of whi
h
pushes the designs
loser to their nal realization. Synthesis is done at many lev-
els of abstra
tion. High up in the synthesis gamut is what is known as behavioral
synthesis involving issues like operation s
heduling, formation of fun
tional units, de-
signing storage
onguration and inter
onne
ting the storage and fun
tional units
[45, 46℄. Lower down the rungs is physi
al synthesis involving translation of netlists
into foundry-ready layout. Two
ommonly used holisti
digital synthesis tools are Syn-
opsys Design CompilerTM (
.f.r. http://www.synopsys.
om) and Caden
e AmbitTM
37
guarantee
orre
tness as any error
an be immensely expensive. To that end it is
ustom-
ary to write redundant spe
i
ations that are dedu
ible from the design intent or the initial
spe
i
ation and verify the designs against them. The analysis tools
over a wide spe
trum
of design evaluation requirements and
omprise timing analzers, noise analyzers, symboli
theorem provers, equivalen
e
he
kers, model
he
kers, ele
tri
al rule
he
kers, geometri
rule
he
kers, physi
al layout to netlist extra
tors, transistor logi
extra
tors and so on.
The design abstra
tion between the RTL and the nal physi
al level lies in the regime of
netlists. The netlists represent undire
ted ele
tri
al
onne
tivity between
ells and devi
es
in a
ir
uit. Quite a lot of analysis and attention is required in the netlist level and a num-
ber of analysis tools are deployed on this abstra
tion to validate several properties of the
system. The
ow ar
hite
ture is generally so designed that the tools
ommuni
ate among
themselves by annotating and pro
essing annotations of the netlist representation. The
annotation of netlists by tools makes this abstra
tion a knowledge ri
h representation. A
lot of useful validation
an be done by reasoning about a ri
hly annotated netlist stru
ture.
This thesis presents a ni
e formalism and tool to this end. The stru
tural reasoning engine
proposed through this thesis intends to serve the EDA world as an analysis tool to enable
he
king a wide range of stru
tural properties of netlists. The engine is designed to sport
an expressive de
larative language that
an be used to query and manipulate netlists.
Netlist is an abstra
tion of VLSI systems whi
h represents the stru
ture of inter
onne
tions
between the
onstituent
omponents of the system. The netlist is essentially a topologi
al
model albeit potentially annotated with geometri
, ele
tri
al, fun
tional or other semanti
properties of the
onstituents. Stru
tural inter
onne
tions represent the way the
ompo-
nents move signals ba
k and forth a
ross
ondu
ting paths or wires. A netlist, as the name
suggests, is represented by a
olle
tion of what are
alled nets, and nets are
on
eptional
olle
tions of pins or ports of
omponents that are ele
tri
ally
onne
ted.
The most important idea in a
ir
uit
onne
tivity representation is that of nets. A net is a
single ele
tri
al path in a
ir
uit that has the same signal value at all its points. The pins
on
omponents that are ele
tri
ally
onne
ted to
arry the same signal are said to belong
to the same net.
Figure 5.2 shows two netlists with nets shown as thi
k lines and named as n1 ; n2 ; : : : et
.
The red
ir
les in Fig. 5.2 denote the pins of the devi
es and gates. The
on
ept of a net
is important in many steps of design and analysis. Designers often want to see an entire
39
n1
VDD n1
n2
n2
n3
n6 n4
n3
n5
(A) (B)
net so that they
an see the path of a given signal. This path will then identify the origin
of the signal and those
omponents that use the signal as an input. Some design styles
enfor
e that only one
omponent may output to a net, while there are many in whi
h mul-
tiple
omponents may output to a single net. In some
ases, the multiple outputs
ombine
logi
ally to produ
e a
omposite net signal (
alled a wired-or or a wired-and, depending
on how the sour
es
ombine). In other
ases, the
ir
uit timing is planned so that only
one
omponent will output to the net at any given time, and the other
omponents will
have ina
tive outputs. The ability to visualize a
ir
uit by nets is therefore important in
understanding the paths between
omponents.
Nets are used in simulation be
ause, viewed abstra
tly, a
ir
uit is merely a
olle
tion of
gating
omponents and their
onne
tions. For an event based simulator a net is identied
with a signal node. Ea
h gating
omponent when a
tivated by a
hange in their input sig-
nals (on input nets), in turn generate an event that
hanges the signal value on its output
nets after the proper gating delay. For a low level simulator like SPICE, ea
h net in a
ir
uit
orresponds to a nodal variable and a nodal equation.
Thus the nets, being the most important element in the netlist model, will play a
entral
role in the netlist reasoning engine to be presented through this thesis.
5.2.2 Types of Netlists
Designers typi
ally identify several dierent kinds of netlists that arise in dierent phases
in the design
ow. The highest level among them are the ones that are either the result
of logi
synthesis or manual logi
design or a
ombination of the two. This type of netlists
40
Schematic
HDL
Capture
Library Cells
Synthesis
Source Netlist
Custom
manual entries Linking to
and modifications charactarized
library cells
Characterized Netlist
Extracted Netlist
Passive RLC Networks
Layout, floorplanning
Parasitic Extraction
Interconnect Extraction Layout
isolation or together. One big
hallenge is that of the sheer size of these netlists that run into
several gigabytes of data. Among other
hallenges is to make their representation amenable
to dierent kinds of pro
essing as required for dierent analysis methods.
41
Among the possible aspe
ts of interest in the analysis of VLSI netlists, it's the fun
tional
behavior that has been re
eiving the maximum attention. Fun
tional reasoning is usually
about fun
tional veri
ation but it is also used in other analyses like
he
king sensitizability
of of paths in the netlists.
Re
ently the s
alability of fun
tional analysis has re
eived a major boost with the de-
ployment of ordered binary de
ision diagrams (or OBDDs) [5℄, a
anoni
al representation
of boolean expressions. Some fun
tional reasoning solutions use the
anoni
al nature of
OBDDs to
he
k fun
tional
orre
tness of
ir
uits (for example whether a given net in a
transistor netlist outputs a given boolean expression).
Currently fun
tional reasoning is at a stage of development where several new ideas are
oming up from the a
ademia of whi
h quite a few are nding pla
e in
ommer
ial veri-
ation/debugging steps of design
ows. On the other hand, stru
tural reasoning about
netlists, despite being an old idea[38℄, has not re
eived as mu
h attention from the VLSI
CAD
ommunity.
The main dieren
e between stru
tural and fun
tional aspe
ts is that the stru
tural view
of netlists strongly depends on the te
hnology library used in the synthesis and
an not
be derived merely (te
hnology independently) from the abstra
t spe
i
ation of the system
while the fun
tional view is meant to be equivalent to its spe
i
ation irrespe
tive of the
devi
e te
hnology involved.
Consequently stru
tural reasoning is not done with mu
h regard to spe
i
ations of indi-
vidual systems or designs and is done spe
i
ally for te
hnologies and design styles. Thus
it is
ommon to nd stru
tural reasoning appear as hard
oded in CAD tools.
The obje
tives of stru
tural reasoning on netlists reported so far may be
ategorized as
follows.
Stru
tural
omparison to establish that two netlists are stru
turally identi
al [21, 23℄.
Sub
ir
uit mat
hing to lo
ate the o
urren
es of given sub
ir
uits in a stru
tural netlist
[20℄.
Stru
tural debugging and veri
ation to sear
h or isolate patterns in a
ir
uit [38, 47℄.
Graph grammar mat
hing to establish
onforman
e with design styles spe
ied by the
grammar [24℄.
42
ould not be applied to
ommon reasoning problems. [38℄ and [47℄ are expressive but are
reportedly slow for larger transistor netlists. [49℄ is simple and powerful but exa
ts high
reativity on the part of the user. [22℄ is re
ent and
omprehensive but is appli
able only
to transistor level netlists.
None of the above reasoning approa
hes deploy any of the re
ent symboli
methods (OB-
DDs [5℄ in parti
ular) that have boosted the s
alability in reasoning about fun
tional tra
es
of VLSI systems. In this s
enario it appears extremely important to to formulate a new
approa
h that is more expressive, appli
able to all
lasses of netlists, eÆ
ient, and leverages
s
alability from symboli
omputing methods. This is the gap that is attempted to be
bridged by the work present through this thesis.
Most of the VLSI design tools need to deal with some or other forms of netlist representa-
tion. Some representations
losely follow the syntax of the stru
tural hardware des
ription
languages. In the others they are some kind of abstra
t models like graphs and hypergraphs
(a.k.a. relations) as suited for the appli
ations.
Representation is a very important problem in the design of any CAD system. A good
representation allows the system to be
onveniently stored, a
essed and manipulated while
a bad representation is wasteful and non-s
alable.
The primary a
tivity in formulating an information model is
hara
terizing the entities of
the domain and relationships between them. The main entities of the domain of netlists are
nets,
ells, devi
es, pins, ports et
. The most important relation in a netlist representation
is that of
onne
tivity, whi
h is a binary relation on the union of the sets of pins and ports.
47
SQUARE NDDL
Query Schema
Meta−Objects
Query Intermediate Representation
FSA AST
NMS Shell
1111111111111
0000000000000 1111111111111111111111111111
0000000000000000000000000000 111111111111111
000000000000000
000000000000000
111111111111111
0000000000000
1111111111111 0000000000000000000000000000
1111111111111111111111111111
NMS Database API
0000000000
1111111111 000000000000000
111111111111111
Scripting
0000000000000
1111111111111
Compiled square
0000000000000
1111111111111 0000000000000000000000000000
1111111111111111111111111111
00000000000000000
11111111111111111 0000000000
1111111111 000000000000000
111111111111111
Interface
Queries
0000000000000
1111111111111 0000000000000000000000000000
1111111111111111111111111111
00000000000000000
11111111111111111 0000000000
1111111111
NMS
000000000000000
111111111111111
0000000000000000000000000000
1111111111111111111111111111
The NMS Core
00000000000000000
11111111111111111 0000000000
1111111111
Schema
0000000000000000000000000000
1111111111111111111111111111
00000000000000000
11111111111111111 0000000000
1111111111
0000000000000000000000000000
1111111111111111111111111111
A Netlist Representation
00000000000000000
11111111111111111 0000000000
1111111111
Extensions
11111111111111
00000000000000
0000000000000000000000000000
1111111111111111111111111111
00000000000000000
11111111111111111 0000000000
1111111111
0000000000000000000000000000
1111111111111111111111111111
Netlist Readers/Writers
00000000000000
11111111111111
0000000000
1111111111
0000000000000000000000000000
1111111111111111111111111111 00000000000000
11111111111111
Verilog,CDL,SPEF etc.
0000000000000000000000000000
1111111111111111111111111111 00000000000000
11111111111111
00000000000000
11111111111111
1111111111111
0000000000000
0000000000000
1111111111111
0000000000000
1111111111111 1111111111111
0000000000000
User Applications
0000000000000
1111111111111 0000000000000
1111111111111
User Applications
0000000000000
1111111111111
0000000000000
1111111111111 0000000000000
1111111111111
The semanti
s of ele
tri
al
onne
tivity implies symmetry, transitivity and re
exivity of
this relation, thereby indu
ing equivalen
e partitions in the set of pins, ea
h partition
or-
responding to a net. There is yet another partition of the set of pins as indu
ed by the
binary relation of two pins' belonging to the same
ell or devi
e. The netlist representation
of NMS re
e
ts this formalized stru
ture in the information model.
The pragmati
advantage of this formalization is that it lends itself to mapping onto labelled
abstra
t graph stru
tures that are suited for formal reasoning. The graph mapping follows
very naturally. Ea
h equivalen
e partition may either indu
e a vertex in the graph mapping
or ea
h ordered pair of pins in the partition may indu
e a dire
ted edge in the graph. The
labels of the edges arise from propositions based on
ir
uit semanti
s. This stru
ture
an
be queried by SQUARE to fa
ilitate lo
ation and testing the presen
e of a wide range of
ir
uit patterns.
On a dierent note, an extremely desirable feature of a netlist representation is its power
and
exibility. In VLSI design, the need for new analysis methods leads to development
of more and more tools. All these tools manipulate dierent information, whi
h must be
represented. Therefore the representation must be
exible enough to in
orporate new in-
formation wherever and whenever needed. Generi
ally speaking, every obje
t in the netlist
database is a re
ord that
ontains data items. These items are attributes that have names,
values, and often spe
i
types asso
iated with them. For example a transistor may have
as attributes its length, width, type, orientation, position et
. A parasiti
resistor may
have as its attributes its
onne
tions and its resistan
e. In pra
ti
e, there is a never-ending
set of attributes that must be represented,
aused by the never-ending set of synthesis and
analysis tools. Ea
h tool is used to manipulate a dierent aspe
t of the obje
t, so ea
h
introdu
es new attributes. Given that a representation should pla
e no limits on the de-
sign a
tivity, it is ne
essary that the
reation of obje
t attributes be
exible. Sin
e it is
impossible to determine in advan
e exa
tly whi
h data entries are going to be needed when
planning a re
ord organization, the program must be able to
reate new attribute entries
during design. A good s
heme to ensure this is to have a run-time evolving meta-stru
ture
underlying the database that allows the obje
t s
hemas to evolve dynami
ally (for exam-
ple by using
ommon lisp obje
t system (CLOS) [52, 53℄, with its meta-obje
t proto
ol
(MOP) [51℄ or even XML as the basis of the database). Another possible s
heme is to use
linked list of attributes and their values asso
iated with ea
h obje
t. In su
h a s
heme,
ea
h netlist obje
t
onsists of a list head that links its attribute/value pair re
ords. It has
the disadvantage of making the system very slow be
ause traversal of a list is required to
nd an obje
t's attribute values. To speed up attribute a
ess, a hashing table or even a
balan
ed sear
h tree of attribute/value pairs
an be stored in the obje
ts. These dynami
49
solutions ensure
exibility but
auses heavy spa
e and time overheads. No matter how we
store the attribute/value pairs a worst
ase logarithmi
time sear
h is unavoidable, let alone
the spa
e overheads.
To solve this problem NMS provides
ompile time extensibility in whi
h the users or appli-
ation developers
an spe
ify the required attributes in a tiny s
hema spe
i
ation language
(
alled the netlist database des
ription language (NDDL) ) and the database s
hema
hanges are a
ordingly generated from it.
The SQUARE language is a small language for expressing queries on labelled dire
ted
graphs, and serves as the basis for netlist stru
tural reasoning in NMS. The SQUARE
ompiler generates a C++
ode from the query, whi
h in turn evaluates the query. A
labelled graph is inferred from the netlist, in whi
h the nets are mapped to verti
es and
ea
h of the
omponents (
ells) indu
e several edges
orresponding to ea
h possible pair of its
pins. The mapping
an be the other way round too, i.e.
ells indu
e verti
es and nets indu
e
edges, but in pra
ti
e the former mapping was found more useful to reasoning problems.
There are quite a few basi
query expressions in SQUARE that are
omposed using a
relational
al
ulus, whi
h applies orthogonally to the basi
expressions as will be explained
subsequently.
A basi
set of query expressions are based on mat
hing paths in a
ir
uit graph, satisfying a
given regular expression. The regular expressions are quite expressive and are parti
ularly
amenable to mat
hing paths in a labelled graph. The alphabet of the regular expressions are
propositions on the edges of the graph. In SQUARE, the propositions are dened separately
from the queries and there is a small built-in utility library of propositions related to the
NMS semanti
s. The propositions are referen
ed by name in the query expressions.
For example, the following query subexpression indi
ates bindings of all su
h pairs of nets
(in the netlist being queried) to the variables x and y, for whi
h there exists a path in the
ir
uit graph satisfying the regular expression (drain to sour
e * sink is vdd). Here
drain to sour
e and sink is vdd are atomi
propositions, and '*' is the usual Kleene
losure operator of regular expressions [9℄.
(exists-path (x y) (drain_to_sour
e * sink_is_vdd))
As another example, the following expression involving just one variable x indi
ates all su
h
bindings to x that has a self rea
hable path through edges from input pins to output pins,
(relevant in a gate level netlist). The '+' in the expression is the positive
losure operator of
50
regular expressions [9℄. A non-empty resulting set of bindings obtained on a netlist for the
following expression will indi
ate the presen
e of a
ombinational loop.
(exists-path (x x) (in_to_out +))
The fa
t that we mat
h paths through edges from input pins to output pins of
omponents
is en
oded in the implementation of the edge predi
ate in to out.
The
ompiled query evaluator, whi
h is a pie
e of C++
ode, is generated by the query
ompiler for ea
h query. The invo
ation of the runtime evaluator is done through a
all to
an interpreter
ommand.
A query is essentially des
ribed as a pattern-a
tion pair. The a
tion is a blo
k of C++
ode that is exe
uted in an environment that lexi
ally has a
ess to ea
h of the bindings of
the free variables in the query. After
omputation of all the bindings of the variables, the
a
tion
ode is repeatedly exe
uted over ea
h of the bindings (i.e ea
h satisfying assignment
of the variables). The order of traversal of the assignments is arbitrary.
For better performan
e, users
an spe
ify relationships like
ontainment or disjointness
among propositions to help the SQUARE
ompiler to generate a better
ompiled evaluator.
Three examples of queries are presented in Figures 5.5, 5.6 and 5.7, with semanti
s stated
in the respe
tive
aptions. In parti
ular, the query in Fig. 5.7, when invoked with the name
of the VDD net as its argument will print all the input nets of the transistor level netlist.
Figure 5.5: Query to print all nets belonging to a
y
li
path not passing through a
ip-
op.
51
Figure 5.7: Query to print all su
h nets that are not rea
hable from a given net through
FET
hannels in a transistor netlist.
Chapter 6
52
53
Most of the nontrivial graph queries are NP-
omplete or harder problems. The sizes of the
ir
uits are large enough not to let us dream of running an algorithm super-polynomial in
their size. There however are
ases when NP
omplete queries may still be answered. These
are the
ases in whi
h the query evaluation is NP
omplete but if we keep the query xed
(i.e. the query is
onsidered a part of the problem des
ription and not an input) then the
ost of the evaluation algorithms would be polynomial in the size of the
ir
uit. We
all
su
h queries
ir
uit-size-tra
table as they are easy in terms of the
ir
uit size. SQUARE,
by its syntax and semanti
s, avoids su
h queries that are not
ir
uit-size-tra
table.
SQUARE evaluation engine uses symboli
omputation with ordered binary de
ision dia-
grams (OBDDs) in evaluating an aspe
t of the queries that is PSpa
e hard in terms of the
query size. OBDDs are also deployed in evaluating the
ir
uit-size-tra
table rea
hability
queries.
The
omplexity of mat
hing regular expressions in
ir
uit graphs depends on what we in-
tend to mat
h with the regular expressions. If we intend
he
k for the existen
e of a simple
path (a path with no
y
le) satisfying a regular expression in edge labels, the problem turns
out to be NP-
omplete in terms of the size of the graph [3℄ ex
ept in a few trivial
ases
[1, 2℄. Therefore this semanti
s
an not be evaluated eÆ
iently.
On the other hand, the presen
e of a path (a sequen
e in whi
h
onse
utive pairs are adja-
ent verti
es in the graph) satisfying a regular expression
an be established in polynomial
time [3℄. Despite its low
ost, the semanti
s of mat
hing regular expressions with paths in
a graph was found quite useful in querying netlists.
There are some subproblems of SQUARE evaluation that are hard in terms of the size of
the query. De
iding whether all paths between two verti
es of the graph satisfy a given
regular expression turns out to be NP
omplete. For the queries that require the above de-
ision, SQUARE evaluator
omputes the automaton that re
ognizes the
omplement of the
language spe
ied by the original regular expression. The absen
e of any path re
ognized
by the
omplement automaton implies that all paths are mat
hed by the original regular
expression. Computing the
omplement automaton may require exponential spa
e (and
time) in the size of the nondeterministi
nite automaton that is obtained dire
tly from
the query expression. However this
ombinatorial explosion happens only over the query
expression, whi
h when assumed to have a
onstant bound, redu
es the problem of query
evaluation to one of polynomial spa
e and time
omplexity.
A sket
h of the algorithm for existen
e of regular paths goes as follows.
Compute the automaton A that re
ognizes the regular path.
54
Treat the
ir
uit graph like an automaton and
ompute its automata theoreti
inter-
se
tion P with A.
Compute transitive
losure on P , whi
h is the regular-path
losure on the
ir
uit
graph.
The SQUARE subexpressions generate OBDDs involving variables that are free in the
subexpressions. The relational
al
ulus
onstru
ts are evaluated by
omposing the OBDDs
of the subexpressions.
On a dierent front, the NDDL based generation of the netlist database involves some
very minor (almost impertinent) algorithm intensive pro
essing (the most pertinent one
being the traversal of a type inheritan
e DAG). Essentially the NDDL
ompiler
reates the
s
hema data stru
tures from a textual NDDL des
ription and performs depth-rst traversal
and topologi
al ordering of the inheritan
e graph in the s
hema in the pro
ess of generating
the C++
ode for the netlist database of NMS.
The algorithms and analysis involved in the design and development of NMS are presented
in detail in
hapter ??.
As regards the ar
hite
ture of the software implementation of NMS, most of its fun
tional
omponents (ex
ept the C++
ode generators, viz. the SQUARE and NDDL
ompilers)
ommuni
ate among themselves through native pro
edure
alls in the same pro
ess spa
e,
as shown by the bidire
tional thi
k arrows in Fig. 5.4. Thus the C++ linker is the basi
integration glue for NMS. The NDDL and SQUARE
ompilers are separate programs that
generate
ode for integration with the NMS, as indi
ated in Fig. 5.4.
The s
ripting interfa
e of the NMS is
reated by embedding a T
l interpreter into the
NMS. An additional tool named Swig (http://www.swig.org) has been used to generate T
l
wrappers of some C++
lasses and fun
tions. The SQUARE
ompiler is written in
ommon
lisp using the freely available implementation
lisp (http://
lisp.
ons.org). The NMS uses
two spe
ialized software
omponents available freely in the publi
domain, besides the usual
C/C++ runtime library implementations. They are as follows.
BUDDY : A BDD Pa
kage from the IT-University of Copenhagen, Danmark, written
by Jorn Lind-Nielsen (buddyitu.dk).
T
l : An extension language and embeddable interpreter (http://www.s
ripti
s.
om)
[50℄.
There is plenty of room for optimizations and performan
e enhan
ements of NMS and
SQUARE, nevertheless the
urrent performan
e and eÆ
a
y of the system seems good
enough to be pra
ti
ally useful.
55
X1 X2 X3 X4
V0 V1
X1 X2 X3 X4
Next, we
onstru
t a regular expression from :F . Re
all that we had used a parti
ular
arbitrarily
hosen order of variables (viz. x1 ! x2 ! x3 : : : ! xn ) while
onstru
ting the
graph G. We need to
onsistently use this order in
onstru
ting the regular expression as
follows. We rewrite ea
h disjun
tive
lause in :F (with
onjun
tive terms within) in su
h
a way that all the variables x1 ; x2 ; x3 ; : : : ; xn appear in the
lause and in that order. If a
56
variable xj was originally absent in the
lause ll its position with a spe
ial term (xj _:xj ).
Having done that, we do the following substitutions on the boolean expression to interpret
it as a regular expression.
Substitute the ^s within the disjun
tive
lauses by the
on
atenation operator of regular
expressions.
Substitute the _ between the
lauses by the disjun
tion operator of regular expressions.
Terms within the disjun
tive
lauses, of the form (xj _ :xj ) (that arose due to the
absen
e of the literal xj in the original
lause) are interpreted as a single proposition.
Let us
all the regular expression so interpreted . The NFA that
an be easiy
onstru
ted
from is one in whi
h there are as many linear bran
hes from the start state as there were
disjun
tive
lauses in :F and ea
h bran
h has a length n ex
luding the start state. One
su
h automaton for :F given in equation 6.1.2 presented in Fig. 6.2.
X4 ,
X2 X3 X4
X1
X1 X2 , X2 X3 X4
X1 , X
1 X2 X3 X4
With the above
onstru
tion in pla
e, our
laim is that the Regular-All-Paths for the
expression on the graph G evaluates to true if and only if :F is valid. It is
lear that a path
from v0 to vn represents a parti
ular assignment (a.k.a. interpretetion) of all the variables of
:F , and all the v0 ! vn paths in G, by the
onstru
tion,
ompletely enumerates all possible
assignments of the variables in :F . Further, a v0 ! vn path's satisfying is equivalent
to the
orresponding assignment's satisfying :F . Thus Regular-All-Paths(v0 ; vn ; ) is a
ne
essary and suÆ
ient
ondition for the validity of :F . This proves that the
onstru
ted
instan
e of Regular-All-Paths solves an arbitrary instan
e of CNF-satisability.
Another related result is as follows.
57
Proof: If the regular expression is assumed xed, it is
onsidered a part of the problem
58
and not its input. Thus we
an ignore the
ost of
omputing its deterministi
equivalent and
thereby its
omplement. This redu
es the problem of Regular-All-Paths to Exists-Regular-
Path , whi
h in turn
an be solved in polynomial time as shown in se
tion 6.2.
We will use the fa
t in Theorem 6.1.4 to divide the evaluation of the regular all paths
query into two sub-stages as follows.
Generation of an evaluator
ode from a query.
Exe
ution of the evaluator
ode on an a
tual graph
ontext.
We guarantee that the se
ond stage of evaluation i.e. exe
ution of the generated evaluator
will take time polynomial in the size of the graph
ontext.
The exploding aspe
ts en
ountered in generating the evaluator are as follows.
The number of DFA states
orresponding to the query NFA may be exponential in the
number of NFA states (and hen
e in the size of the regula expression in the query).
The number of outgoing transitions at any state is exponential in the number of
outgoing non-ex
lusive predi
ates.
While
onstru
ting the DFA from the NFA, the rst explosion
ould not be prevented from
propagating to the running time of the exe
ution of the generated evaluator. The se
ond
explosion however
ould be prevented from ae
ting the evaluator's exe
ution time. If the
number of propositions that
an
ause a valid transition from a state
Algorithm 6.1.
AllPairExistsRegularPath
F R
while(true) begin
Fold F
H F [n3 =n2 ; s3 =s2 ; n2 =n1 ; s2 =s1 ℄
G 9s2; n2 (H ^ F )
F G[n2 =n3 ; s2 =s3 ℄
if(F == Fold ) break
end
return 9s1 ; s2 F ^ (s1 2 SSTART ) ^ (s2 2 SACCEPTING)
end
Chapter 7
Results
60
Chapter 8
61
Bibliography
[1℄ Lapaugh, A., and Papadimitrou, C., The even-path problem for graphs and digraphs.
Networks, 14 (1984) pp. 507-513.
[2℄ Nedev, Zhivko Prodanov, Finding even simple path in dire
ted planar graph. SIAM
Journal on
omputing Vol 29, No. 2 pp. 685-695
[3℄ Mendelzon, A.O., and Wood,P.T., Finding regular simple paths in graph databases,
SIAM Journal on Computing, 24(6) De
ember 1995 pp. 1325-1358.
[4℄ S
hrijver,A., Finding k disjoint paths in a dire
ted planar graph, SIAM Journal on
Computing, 23(4), August 1994 pp. 780-788
[5℄ Bryant, R., Graph-based algorithms for boolean fun
tion manipulation. IEEE Trans-
a
tions on Computers, C-35, 1986 pp. 677-691.
[6℄ Clarke, E., Grumberg, O., Model Che
king, MIT Press , 1998
[7℄ Clarke, E., Emerson, E.A., Sistla A.P., Automati
Veri
ation of Finite State Con
ur-
rent Systems Using Temporal Logi
Spe
i
ations ACM Transa
tions on Programming
Languages and Systems, Vol. 8, No. 2 , April 1986, pp 244-263
[8℄ Bahar ,Iris, et al. Algebrai
De
ision Diagrams and their Appli
ations International
Conferen
e on Computer Aided Design, 1993
[9℄ Hop
roft, J.E., Motwani, R., Ullman, J.D., Introdu
tion to Automata Theory, Lan-
guages and Computation. Pearson Edu
ation, 2001
[10℄ Bur
h J. R. , Clarke E., et. al. Symboli
Model Che
king for Sequential Cir
uit Veri-
ation. IEEE Transa
tions on CAD , 1994 , pp. 401-424.
[11℄ Bur
h J. R. , Clarke E., et. al. Symboli
Model Che
king : 1020 States and Beyond.
Information and Computation , 1992 , pp. 142-170.
62
63
[12℄ M
Millan, K, Symboli
Model Che
king:An Approa
h to the State Explosion Problem,
Kulwer A
ademi
Publishers, 1993
[13℄ Coudert, O., Madre, J.C., Berthet, C., Verifying temporal properties of sequential
ma
hines without building their state graphs. Computer Aided Veri
ation, vol. 3, of
DIMACS Series in Dis
rete Mathemati
s and Theoreti
al Computer S
ien
e, 1991.
[14℄ Tarjan R.E., A Unied Approa
h to Path Problems Journal of the ACM , Vol 28, No
3, July 1981, pp. 577-593
[15℄ Fast algorithms for solving path problems, Journal of the ACM, Vol 28, No 3, July
1981, pp. 594-614
[16℄ Sheng, L., Ozsoyoglu, Z.M., Ozsoyoglu, G., A Graph Query Language and its Query
Pro
essing, IEEE ICDE Conf., Australia, Mar
h 1999.
[17℄ Consens M., Mendelzon A., Graphlog: A visual formalism for real life re
ursion. ACM
Symposium on Prin
iples of Database Systems 1990.
[18℄ Ullman, J., Implementation of Logi
al Languages for Databases., ACM Transa
tions
on Database Systems, vol. 10, 1985
[19℄ Cruz I., Wood P., Mendelzon A., G+: re
ursive queries without re
ursion, Pro
eedings
of the 2nd International Conferen
e on Expert Database Systems, 1988, pp. 355-368.
[20℄ Miles Ohlri
h, Carl Ebeling, Eka Ginting and Lisa Sather, Subgemini: Identifying Sub-
Cir
uits using a Fast Subgraph Isomorphism Algorithm, Pro
. 30th Design Automation
Conferen
e, 31-37, 1993.
[21℄ C. Ebeling and O. Zaji
ek, Validating VLSI Cir
uit Layout by Wirelist Comparison,
[22℄ Thomas Stephan Chanak, Netlist Pro
essing for Custom VLSI via pattern mat
hing.
PhD Thesis, Dept. of Ele
tri
al Engineering , Stanford University. Pro
. IEEE Inter-
national Conferen
e on Computer Aided Design, 172-173, 1983.
[23℄ C. Ebeling, GeminiII: A Se
ond Generation Layout Validation Tool, Pro
. IEEE In-
ternational Conferen
e on Computer Aided Design, 322-325, 1988.
[24℄ C. Bamji and J. Allen, GRASP: A Grammar-Based S
hemati
Parser, Pro
. 26th De-
sign Automation Conferen
e, 448-453, 1989.
64
[25℄ Garey, M.R., Johnson, D.S., Computers and Intra
tability : A Guide to the Theory
and Pra
ti
e or NP-Completeness, W.H. Freeman and Co., New York, 1978
[26℄ Patthak, A.C., Bhatta
harya, I., Dasgupta, A., Dasgupta, P., Chakrabarti, P.P., Quan-
tied Computation Tree Logi
, Information Pro
essing Letters, Feb 2002.
[27℄ Mandal, C.R., Cadouri, E., Chakrabarti,P.P., Chatterjee,Bijoy, Majumder,
Jayanta, et al Netlist Database Referen
e Manual 3.0 jointly released by
National Semi
ondu
tor Corp, and IIT Kharagpur, O
tober 17,2001. ( mail
to:bijoyns
.
om,pp
hak
se.iitkgp.ernet.in)
[28℄ Chatterjee, K., Chakrabarti, P.P., Dasgupta,P., A Bran
hing Time Temporal Frame-
work for Quantitative Reasoning. (mail to : pp
hak
se.iitkgp.ernet.in)
[29℄ Karplus, K., Ex
lusion
onstraints, a new appli
ation of Graph Algorithms to VLSI de-
sign, Pro
eedings of the 4th MIT
onferen
e on advaan
ed resear
h in VLSI (Leiserson
ed.) 1986
[30℄ Papadimitriou, C.H., Computational Complexity, Addison-Wesley, 1994.
[31℄ Thomas H. Cormen , Charles E. Leiserson, Ronald, L. Rivest , Introdu
tion to Algo-
rithms , Preiti
e Hall of India , 1998
[32℄ Douglas B. West, Introdu
tion to Graph Theory , Prenti
e Hall of India, 1999
[33℄ Codd, C.J. Relational Completeness of Database Sublanguages ,Database Systems ,
Courant Computer S
ien
e Symposium, Prenti
e Hall 1972
[34℄ Date, C.J., An Introdu
tion to Database Systems, Addison Wesley, 3rd Edition, 1981
[35℄ Vardi, M.Y., Wolper, P.,An automata theoreti
approa
h to automati
program veri-
ation Pro
eedings of the rst symposium on logi
in
omputer s
ien
e. Cambridge
MA, 1986, pp 322-331
[36℄ Craigen D, Gerhart S, Ralston T. Formal methods reality
he
k:industrial usage. IEEE
Trans Software Eng 1995 pp. 9098
[37℄ Ja
kson D., Wing, J., Lightweight formal methods. IEEE Computer 1996;April:2122
[38℄ H. De Man, I. Bolsens, E. Vanden Meers
h, J. Van Cleynenbreugel. "DIALOG, An
Expert Debugging System for MOS-VLSI Design", IEEE transa
tions on CAD Vol
CAD..4, N3, July 1985
65
[39℄ A. SAlz and Mark Horowitz "IRSIM:An in
remental MOS Swit
h-Level Simulator" ,
Pro
eedings of the 26th Design Automation Conferen
e, 1989
[40℄ H. De Man, I. Bolsens, E. Vanden Meers
h, J. Van Cleynenbreugel. "An Expert Sys-
tem for Logi
al and Ele
tri
al debugging of MOS VLSI networks", Pro
eedings of the
International Conferen
e on Computer Aided Design, 1984
[41℄ A.Aho, "The Awk Programming Language", Addison Wesley , 1988
[42℄ Nagel, L.W.: "SPICE2: A Computer Program to Simulate Semi
ondu
tor Cir
uits."
Berkeley, Univ. of California, Ele
troni
Resear
h Laboratory. ERL-M520, 1975
[43℄ Clayton B. M
Donald , "Symboli
Fun
tional and Timing Veri
ation of Transistor
Level Cir
uits" PhD Thesis , CMU Dept. of ECE, http://www.e
e.
mu.edu/
lay-
ton/dist/thesis.pdf
[44℄ M. Kaufmann and R. S. Boyer,"The Boyer-Moore Theorem Prover and Its Intera
tive
Enhan
ement" Computers and Mathemati
s with Appli
ations, 29(2), 1995, pp. 27-62.
[45℄ P. G. Paulin and J. P. Knight, "Algorithms for high-level synthesis" ,IEEE D. & T. of
Computers, pp. 18-31, De
. 1989.
[46℄ C. Mandal and R. M. Zimmer, "High-level synthesis of stru
tured data paths" IFIP
TC10 WG 10.5 International Conferen
e on Computer Hardware Des
ription Lan-
guages and Their Appli
ations, pp. 92-94
[47℄ Ja
ques Wenin, Johan Verhasselt, Mar
Van Camp, Jean Leonard, Pierre Guebels,
"Rule based VLSI veri
ation system
onstrained by layout parasiti
s",26th
ACM/IEEE Design Automation Conferen
e, 1989
[48℄ N. F.Gon
alves, H.De Man "NORA, a ra
efree dynami
CMOS te
hnique for pipelined
logi
stru
tures", IEEE Journal of Solid State Cir
uits, Vol SC-18 June 1983
[49℄ G. Pelz, "An Interpreter for General Netlist Design Rule Che
king", Pro
eedings of the
29th Design Automation Conferen
e, 1992
[50℄ J. Ousterhout "T
l and the Tk Toolkit", Addison Wesley, 1993
[51℄ Gregor Ki
zales, Jim Des Rivieres, Daniel G. Bobrow "The art of metaobje
t proto
ol",
MIT Press , Sep 1991
66