Rochester Institute of Technology
RIT Scholar Works
Theses
Thesis/Dissertation Collections
1988
A timing simulator
Kathryn D. Heintz
Follow this and additional works at:
http://scholarworks.rit.edu/theses
This Thesis is brought to you for free and open access by the Thesis/Dissertation Collections at RIT Scholar Works. It has been accepted for inclusion
in Theses by an authorized administrator of RIT Scholar Works. For more information, please contact
Recommended Citation
A TIMING SIMULATOR
by
Kathryn D.
Heintz
A thesis,
submitted to
The Faculty of the School of Computer Science and Technology,
in partial fulfillment of the requirements for the degree of
Master of Science in Computer Science
Ma
y
19,
1988
Approved
by:
Nan C.
Schaller
Nan Schaller, Chair
George A.
Brown
George Brown
Rayno Miemi
---~---
--
---
-Rayno Miemi
Peter G.
Anderson
Peter G.
Anderson
~4/-;'
J~
/'fJJ,Oj_L'lt-
LU Jr
dat'8
T
itle
of
T
h e si.
s:
A Timing S
i mulator
c
o
n
t a
c
t e
d
eac
h
ti
me
a
re
quest
for repro
duc tion
is made
.
I
ca
n
be rea
c
hed
at
t
he
fo
l lowi ng
address:
2
1
Del
V
e r de R
o ad
Ro
ch e ster ,
N
e w Y
o r
k
Phone
2
47
-2
4
3 6
J
ul
y
6,
1
9 8
8
ABSTRACT
A
timing
simulator,
calledTIMSIM,
has
been
developed
whichperforms gate
level
simulation of simpledigital
logic
circuits.
TIMSIM
has
alibrary
oftwelve
standardTTL
gateelements and
memory
elements.These
elementsincorporate
various
features
including
singleoutputs,
multiple outputs,non-symmetric
inputs,
andmemory
states.TIMSIM
uses arise-fall
delay
model andthree
valuesto
represent asignal's
logic
level.
CR
Categories:
B.6.3,
B.7.2
Key
Words
andPhrases:
timing
simulation,
gatelevel
simulation, event-driven
TABLE
OF
CONTENTS
Chapter
1
Introducti
on1
0
Overview
ofProblem
1
1
Objectives
ofProject
1
2
Relationship
to
Other
Software
2
3
Design
Overview
3
4
Outline
ofThesis
5
Chapter
2
Historical
Overview
6
2.0
Introduction
6
2.1
The
Simulation
Approach
-Issues
andDirections...
6
2.2
Logic
Simulation
Overview
B
2.2.1
History
ofTiming
Simulation
9
2.2.2
Evolution
ofAlgorithms
To
Do
Timing
Simul
ation
11
2.2.3
Projects
12
2.3
State
ofthe
Art
in
Timing
Simulation
14
1
Multi-level
Simulation
14
,2
Design
Verification
14
,
3
Languages
15
,4
Special
Purpose
Multiprocessors
16
5
Data
Flow
Approach
16
,6
Logic
Simulation
Machines
16
,7
Microprocessor
Logic
Simulators
17
2.4
Summary
18
Chapter
3
Project
Development
19
3. 1
Introduction
19
3.1.1
Algorithms,
Languages
andElements
19
3.1.2
Types
ofDelay
Models
20
3.1.3
Multi
-valuedLogic
22
3.2
Essential
Features
ofthe
Simulator
24
Chapter
4.0
4.
1
4.2
4.3
4.4
4.5
4
Implementation
Overview
Inputs
andOutputs
Fig.
4. 1
A
Circuit
andits
Description
Fig.
4.2
Data
Flow
Diagram
Files
Fig.
4.3
File
Structure
Modules
in
the
Parser
Fig.
4.4
Structure
Chart
ofthe
Parser
Modul
esi
nthe
Si
mul atorFig.
4.5
Structure
Chart
ofthe
Simulator..
Important
Data
Structures
.5.1
Library
Fig.
4.6
Library
Data
Structure
Fig.
4.7
Timing
Delays
.5.2
Circuit
andTable
Fig.
4.8
Circuit
andTable
Data
Structures.
4.5.3
Event
Scheduling
Mechanism
39
Fig.
4.9
Timewheel
Data
Structure
39
4.
6
Event
Schedul
ing
Process
39
Fig.
4.10
Event
Scheduling
Flow
Chart
40
Chapter
5
Testing
41
5.0
Testing
Strategy
41
5.
1
Testing
the
Parser
41
5.2
Testing
the
Simulator..
43
5.3
Test
Comparisons
withOther
Simulators
44
Chapter
6
Conclusions
45
6. 1
Summary
ofthe
Project
45
6.2
Problems
Encountered
andResolved
46
6.2.1
Multi-valued
Logic
46
Fig.
6.1
47
6.2.2
Initialization
orSimulation
Startup
49
6.2.3
Event
Scheduling
Analysis
50
6.3
Further
Work
51
Appendi
cesA.
Users'"Manual
B.
Sample
Runs
C.
Analysis
ofthe
Three-Valued
Truth
Table
for
the
7474
CHAPTER
ONE
INTRODUCTION
1.0
Overview
ofProblem
Hardware
simulationis
often a usefultool
in
anacademic environment
because
ofthe
expenseinvolved
in
hardware
implementation.
This
paperdiscusses
the
development
of a simulationtool,
atiming
simulator, whichcould
be
usedby
studentsin
introductory
digital
logic
courses,
for
design
verification of simple circuits.1.1
Objectives
ofthe
Project
As
students areintroduced
to
logic
circuits,
they
arerequired
to
design
simple combinational and sequentialcircuits
using
AND
gates,
OR
gates,
flip-flops,
inverters,
etc.
The
interaction
ofthe
various circuit components withrespect
to
timing
is
a criticaldesign
consideration.Students
needto
understandhow
a changein
aninput
willaffect
the
outputand,
in
addition,
how
the
propagationdelays
associated with each ofthe
gates affectthe
operation of
the
circuit.(Propagation
delay
is
the
time
it
takes
for
the
output of a gateto
change afterthe
input
has
changed states.)
Interactively
changing
the
values ofthe
inputs
andobserving
the
effects onthe
outputs enhancesthe
understanding
ofthe
circuit.In
somedesigns,
unexpectedand undesirable
hazards
or race conditionsmay
develop
whichrequire
analysis
and redesign.Hazards
and races are"temporary,
unwanted output signals whichmay
occurin
logic
circuits
due
to
different
delays
in
different
signal paths."(Schwarz
1987)
The
objective ofthis
projecthas
been
to
investigate
the
issues
involved
in
developing
alogic
level
timing
simulator and
to
design
andbuild
the
simulator.This
process
involved
choosing
andmodifying
a simulationalgorithm
to
do
eventlist
simulation,
understanding
the
requirements of
simulating
memory
chips anddeveloping
appropriate
input
and output strategies.Also
consideredwere various
levels
ofcomplexity
in
logic
simulation andthe
different
types
ofdelays
-propagation,
transition
andtransmission
delays
-which are
inherent
in
alogic
circuit.The
implications
ofthree-valued
logic
were studied.1.2
Relationship
to
Other
Software
Many
simulatorshave
been
developed
to
aidthe
circuitdesigner,
most of a more complex naturethan
the
onediscussed
here.
The
relativesimplicity
ofthis
simulatoris
in
keeping
with a student user'slevel
ofunderstanding
of circuit
design.
This
simulatorhas
been
designed
to
University
ofWashington
Consortium
andinstalled
onRIT
systems.
These
design
tools
include
a circuit simulationprogram called
RNL
and a networkdescription
program calledNETLIST.
This
simulator,
whichhas
been
namedTIMSIM,
usesthe
same
format
that
NETLIST
usesto
create a circuitdescription
file
which expressesthe
input
circuitto
be
simulated.
The
simulationis
done
in
a series of stepswith a report
issued
atthe
end of each simulation step.This
step
procedureis
similarto
RNL.
The
commands usedto
control
the
simulation andthe
outputformats
aredifferent
from
those
ofRNL.
(For
further
information,
seeNETLIST
and
RNL
documentation.)
1.3
Design
Overview
TIMSIM
consists oftwo
programs,
a parser and asimulator.
Each
canbe
run as a separate program.The
parser program readsthe
circuitdescription
input,
and
decodes
and expandsit.
The
input
to
the
parseris
acircuit
description
file
createdby
the
user which uses aLisp-like
syntaxto
list
each element withits
associatedinput
and output nodes.The
output ofthe
parseri
s anintermediate
file
whichis
an expanded version ofthe
input
circuit
description.
The
simulator program readsthe
intermediate
file
andThe
userthen
interactively
manipulatesthe
circuitsimulation
by
setting
the
values ofthe
inputs
andletting
these
signals propagatethrough
the
circuit.The
output ofthe
simulatoris
asummary
of which nodeschanged,
the
values and
the
time
ofthe
change.The
userhas
a choice ofthree
formats
for
the
output as well as a choice of screenor
file
output.The
simulation respondsto
changesin
input
valuesinitiated
by
the
user andincorporates
propagationdelays
specific
to
eachindividual
gate.These
delay
times
arerandomized within prescribed
limits
in
orderto
approximatea real world situation where
there
is
some variationin
del
ays.There
are severaldata
structures usedin
the
simulator.
A
library
data
structure contains allthe
information
requiredfor
each ofthe
TTL
elementsin
the
simulator.
The
library
data
structureincludes
the
timing
delays,
functionality
information,
the
number ofinputs
andoutputs,
etc.A
table
storesinformation
about eachnode,
its
presentvalue,
its
former
value,
andits
relationship
to
the
other elements.A
circuitdata
structureincludes
eachelement and
its
connectionsto
other elements.The
future
event
list,
ortime-wheel,
is
a circulararray
of pointersto
linked
lists
which containsthe
schedule offuture
events.
An
eventis
a changein
the
value of a node.-The
simulator willhandle
combinational circuitsusing
ANDs,
ORs,
inverters
and also sequentiallogic
including
flip-flops
andlatches.
1.4
Outline
ofThesis
Chapter
2
gives an overview ofthe
field
of circuitsimulation and
the
development
oflogic
level
simulatorsin
particular.
Chapter
3
is
adiscussion
of some ofthe
issues
investigated
and some ofthe
assumptions madein
the
development
ofthe
simulator.The
program organization andthe
details
ofthe
implementation
ofthe
simulator arediscussed
in
Chapter
4.
The
functional
description
ofthe
programs,
structurecharts,
anddata
structurediagrams
arealso
included.
Chapter
5
discusses
the
testing
strategiesused
for
each section ofthe
program andthe
test
results.Chapter
6
summarizesthe
paper anddiscusses
possibleextensions.
Three
appendices areincluded.
Appendix
A
is
acomplete
User's
Manual
developed
to
makethe
simulator asuser-friendly
as possible with examples and sample runs.Appendix
B
has
several runs ofthe
programusing
some ofthe
test
circuits.A
detailed
analysis ofthe
ternary
(3-valued)
truth
table
for
the
7474
d-type
flip-flop
is
shown
in
Appendix
C.
The
source codeis
notincluded
withCHAPTER
TWO
HISTORICAL
OVERVIEW
2.0
Introduction
The
beginning
ofthis
chapter(2.1)
willinclude
adiscussion
of generaltopics
in
simulation: currentissues
and
future
directions.
The
major portion ofthe
chapter(2.2-2.3)
willbe
ahistorical
overview ofthe
simulation ofdigital
logic
circuitsfor
the
purpose ofdesign
verification.
Much
ofthe
literature
concerns simulatorswith
features
otherthan
timing.
These
include
behavioral,
fault,
functional,
and mixedlevel
simulators.Therefore
this
chapter willdiscuss
simulators,
many
of which are morecomplicated
than
the
one proposedfor
this
thesis.
The
term
circuit simulation will
be
usedin
a generic sense.2.1
The
Simulation
Approach
Issues
andDirections
Simulation
is
the
process ofrepresenting
some portionof
the
real worldin
a systematicway,
for
the
purpose ofstudying
the
behavior
of asystem,
in
terms
ofevaluation,
prediction or optimization of performance.
It
is
oftendesirable
andusually
cheaperto
be
ableto
predict asystem's
behavior,
to
experiment with variousdesigns
andto
evaluate expected results
before
the
real world systemis
Event
list
management
is
one ofthe
important
softwareissues
in
simulation.
An
event,
in
circuitsimulation,
represents a change
in
the
state of asignal,
from
0
to
1
or1
to
0.
The
activity
in
a circuit canbe
modelledby
alinked
list
of such events(referred
to
as an eventlist),
and
inserting
an event onthis
list
is
called eventscheduling.
Event
lists
can alsobe
implemented
by
binary
trees
or arrays oflinear
lists.
Event
list
managementinvolves
an attemptto
optimize speed and "robustness"(speed
maintained over a wide class ofproblems),
as well asflexibility
and ease of use(Vaucher
andDuval
1975).
Another
area of concernin
simulationis
languages.
Some
simulation specialists preferwidely
known
generalpurpose
languages
with special simulationfeatures
whileothers support
the
development
of new special purposesimulation
languages
(Henri ksen
1984).
Both
approaches aremoving
toward
developing
concurrentfeatures
for
taking
advantage of parallel
processing
hardware.
Modeling
development
environments,
whichinclude
anintegrated
set of simulation softwaretools,
areevolving
assimulation problems
become
larger
and more complex.Modeling
development
environments provide asetting
wheremodels can
be
developed
from
early
problemdefinition
phases,
through
the
experimentaldesign
phase,
to
final
analysis of results
(Nance
1983).
-2.2
Logic
Simulation
Over
viewVerification
ofthe
accuracy
of alogic
design
before
the
device
is
actually
built
can saveboth
time
and money.In
the
early
days
ofintegrated
circuitdesign,
the
approachto
simulation wasto
build
simplehardware
prototypesfor
the
purpose oftesting
circuitdesigns.
Changing
these
prototypes
to
reflectdesign
changes wasvery
difficult,
however,
and a new approach was needed.Software
simulators,
which arelarge
and complexprograms,
weredeveloped
to
modelthe
circuits andto
verify
the
design.
These
simulatorshad
severaladvantages,
among
them
ease of modification ofthe
program andrelatively
low
cost.
Over
time
many
improvements
have
been
madeto
these
simulators
including
modeling
ofdifferent
levels
of circuitdesign,
faster
algorithms,
morefunctional
hardware
description
languages
andfaster
hardware.
They
representthe
primary
method of simulationin
usetoday.
Recently,
as a responseto
the
growing
complexity
ofVLSI
design,
some research projectshave
been
returning
to
ahardware
logic
simulationscheme,
whichis
substantially
different
from
the
previous approaches.These
newhardware
simulators,
sometimes calledlogic
simulationengines,
usespecial purpose
CAD
hardware
and often usedistributed
andparallel processing.
Processors
specially
designed
for
simulation reduce
the
time
ofthe
design
process,
and
hardware
simulation
takes
advantage ofthe
decreasing
costof computer
hardware
(Howard,
Malm,
Warren
1983).
Some
modern simulation schemesinvolve
a combination ofhardware
and software.Hardware
components,
such as microprocessor
chips,
areincorporated
into
the
simulatorsto
avoid
the
"time-consuming
process ofwriting
software modelsfor
complex components."(Mentor
Graphics
productliterature)
These
hardware
components alsoimprove
the
accuracy
ofthe
simulation.2.2.1
History
ofTiming
Simulation
There
are severaldifferent
waysto
model a circuitdepending
onthe
information
needed.This
section willdeal
with gate
level
simulation which generatesinformation
abouttiming
characteristicsin
a circuit.Early timing
models usedfixed
propagationdelays,
called zero or unit
delay
models.Seshu's
Sequential
Analyzer,
the
first
gatelevel
simulatorto
be
published,
was of
the
unitdelay
type.
It
wassatisfactory
for
regularlogic,
but
difficult
to
usefor
an asynchronous circuit.The
networkto
be
simulated was compiledinto
machinelanguage
and executed(Hemming
andHemphill
1975).
An
important
improvement
onthis
technique
wasthe
assignable
delay
simulator which allowed eachdevice
to
have
one or more propagation
times.
The
Tegas2
developed
by
operation and also
handled
race andhazard
analysis andedge-triggered
devices
(Hemming
andHemphill
1975).
Toward
the
goal of more accuratetiming,
athird
state,
called
undefined,
was usedto
indicate
that
the
logic
at anode was not
known.
This
undefined state wasparticularly
useful
for
simulating
the
initial
state ofthe
circuit.A
delay
ambiguity
problem arose with min and maxdifferences
in
propagationdelays
(Bening
1979).
Among
several attempts atbetter
timing
modeling
wasthe
use of a standarddeviation
(based
on min and maxpropagation
times)
for
delay
time
at eachtransition.
A
further
refinement wasto
usedifferent
transition
delay
times
for
low
to
high
andhigh
to
low
transitions.
There
also came a realization
that
the
loading
effects(number
ofloads
onthe
output) can changethe
propagationdelay
times
(Bening
1979).
More
recently
additional stateshave
been
addedto
improve
timing
simulation oflarger
systems.Other
factors,
including
physical environment and pathdelays,
areknown
to
affect
timing
accuracy.The
increase
in
circuit sizehas
necessitated
increased
capacity
of simulatorsincluding
larger
memories,
faster
hardware
andbetter
algorithms(Bening
1979)
.A
continuing
problemis
the
determination
ofthe
sizeof
the
input
test
set which willdetect
asmany
as possible
-of
the
design
problems
withoutmaking
the
simulation programunreasonably
long
at current computer speeds.2.2.2
Evolution
ofAlgorithms
to
Do
Timing
Simulation
During
the
mid1960?s
a method ofsimulating
logic
circuits
using
anevent-scheduling
technique
wasdeveloped.
In
the
intervening
years,
Ernst
Ulrich
and other researchershave
published a number of papers whichillustrate
the
evolution of
this
method.A
"time-mapping"event
scheduling
technique
in
whichthe
Ulrich
timing-wheel
is
used as afuture
events queue wasfirst
proposed(Ulrich
1969).
Simultaneously-occurring
events were attachedto
the
eventsqueue as side
branches.
Time-mapping
schemes ofUlrich
and others were combinedwith
linear
lists
to
accomplish non-integral eventtiming
(Vaucher
andDuval
1975).
Ulrich
then
further
developed
the
algorithm
using
aconverging
lists
data
structure whichbreaks
up
along
linear
list
into
shortlists
andthen
converges
these
lists
into
a singlelist
at a particularpoint which
is
always ahead of currenttime
(Ulrich
1976).
Ulrich
later
summarizedfour
table-lookup
techniques
which are used
to
speedup
logic
simulationby
ratios of15:1
(Ulrich
1980).
These
techniques
include
zoom-table,
linked
list
traversal
using
atraverse-table,
and codeconcatenation
for
simultaneoustraversal
oftwo
linked
lists.
Other
advantagesto
these
methods are reductionsin
-program
complexity
andprogramming
effort and reductionsin
volume of program coding.
Another
recentpublication
concerns othertechniques
which make a gate
level
logic
simulatorfaster
(Miyoshi
et.al.
1985).
A
number of singleinput
logic
gates aredeleted
from
the
simulation providedthey
meet certaincriteria.
Therefore,
the
number of eventsto
be
simulatedis
reduced and soi
s computer storage.This
methodinvolves
an analysis of
the
gatesto
determine
if
they
canbe
del
eted.2.2.3
Projects
A
few
projectsin
circuit simulation as well as someoutstanding
contributorsto
the
field
deserve
comment.A
long-standing
project atBell
Labs
involves
the
MOTIS
-aMos
Timing
Simulator
(Chawla,
Gummel
,Kozak
1975).
Many
authors
have
referencedthis
work.In
1980
a mixed modesimulator
(transistor
level,
logic
gatelevel
andfunctional
level)
wasdescribed
(Nham
andBose
1980)
andlater
the
2nd
generation
Motis
Mixed
Mode
Simulator
wasdeveloped
(Chen
et. al.
1984).
This
projectinvolves
acontinuing
effortin
improving
the
accuracy,
flexibility
andefficiency
in
MOS
circuit simulation.
One
ofthe
early
circuit simulationprojects,
OLLS:
On-Line
Logical
Simulation
System,
wasin
operation atMIT
in
1971.
It
was a complete software package with which a
-design
engineer couldinteractively
design
and simulatedigital
systemsusing
alight
pen and programmedfunction
keyboard.
I/O
wasmainly
through
punched cards.The
systemallowed
flexibility
in
choice oflogic
families.
It
waswritten
in
IBM
360
Assembly
language
and generated off-lineplotter output
(Howie
andTavan
1971).
F/Logic,
aninteractive
fault
andlogic
simulator wasdeveloped
atBel 1
-NorthernResearch
(Wilcox
andRombeek
1976).
The
simulatoris
table-driven
and uses atiming
stack which controls
the
simulation.Later
implementations
of
F/Logic
emphasizedfunctional
simulation as animprovement
overthe
basic
gatelevel
simulation(Wilcox
1979)
.Projects
atMIT
AI
Laboratory
use a somewhatdifferent
approach.
RSIM,
alogic
level
timing
simulator uses alinear
transistor
modelto
predictthe
logic
state of eachnode and estimate
transition
time
if
it
changes state(Terman
1983).
The
simulation algorithm uses aLisp-like
command
language
to
drive
the
simulation.Another
MIT
project called
SIMMER
also uses aLisp
programming
environment and
is
used as a researchtool
for
understanding
the
relation of structureto
function
(Lathrop
andKirk
1985)
.
-2.3
State
ofthe
Art
in
Circuit
Simulation
Recent
developments
in
the
area of circuit simulationresult
from
requirements
for
morespeed,
accuracy.flexibility
and ease of use.Integrated
circuitshave
become
solarge
and complexthat
new approaches are requiredto
simulatethem
at a reasonable cost.These
include
software
improvements
such aspartitioning
andvectorizing
and
hardware
developments
such as concurrent processors andhardware
simulators.2.3.1
Multi-level
Simulation
Multi-level
simulationincorporates
ahierarchical
design
methodology
in
which each phase ofthe
design
processis
modeledin
anintegrated
manner.The
simulationtools
are
developed
to
supportlow
level
early
design
phases,
then
fault
simulation,
andfinally
the
manufacturing
test
phases(Gonauser,
Egger,
Frantz
1984).
DECSIM,
developed
atDigital
Equipment
Corporation,
is
a multi-level simulationsystem
supporting
transistor,
gate,
vector andbehavioral
levels
(Kearney
1984).
It
also uses concurrent algorithms.2.3.2
Design
Verification
Formal
design
verificationis
becoming
animportant
issue
as circuitdesigns
grow more complex.Formal
verification
techniques
are stillbeyond
the
scope of-designers
but
informal
validation ofdesign
correctnessis
auseful
technique
(Whelan
1984).
2.3.3
Languages
New
hardware
description
languages
areconstantly
being
developed,
many
derived
from
existing
languages.
The
objective
in
developing
a newlanguage
is
to
approximate asclosely
as possiblethe
circuits which arebeing
described,
and
therefore
makeinteraction
withthe
simulator easierfor
the
user(Kearney
1984).
A
contrasting
viewpointis
that
there
arealready
alarge
number ofhardware
description
languages
in
existence which are notwidely
used andtherefore
there
is
no needto
develop
newlanguages.
The
proliferation of
different
languages
leads
to
alack
ofstandardization which
hinders
the
development
anddissemination
of commercial computer-aideddesign
tools
(Leiberherr
1984).
Another
very
important
language
issue
is
that
ofconcurrency.
Effective
parallelprocessing
requireslanguages
which willtake
full
advantage ofthe
parallelism.Consequently
new concurrentlanguages
arebeing
developed
and concurrent
features
arebeing
addedto
conventionallanguages.
2.3.4
Special
Purpose Multiprocessors
PRSIM
is
amultiprocessor
algorithmfor
logic
level
timing
simulationinvolving
ahigh
degree
of parallelism(Arnold
andTerman
1985).
It
uses apartitioning
technique
which
increases
the
capacity
andaccuracy
ofthe
simulation.It
wasdeveloped
atMIT
andis
implemented
there
onthe
CONCERT
multiprocessor.
It
is
in
the
development
stage onthe
BBN
Butterfly
supercomputer.2.3.5
Data
Flow
Approach
A
concurrenttiming
simulator calledCEMU
has
been
implemented
on a virtualdata
flow
machine atAT?<T
Bell
Labs
Ackland
et. al .1985).
A
data
flow
graphis
generatedfrom
the
input
circuitdescription
and atime-step
subdivision
is
used
for
evaluation.The
simulatoris
reportedto
run muchfaster
than
full
circuit simulators.The
project uses eightM6B000
microprocessors and aVAX
11/780.
2.3.6
Logic
Simulation
Machines
At
the
Los
Gatos
Laboratory,
the
IBM
Logic
Simulation
Machine
(LSM)
wasdeveloped
(Howard,
Malm,
Warren
1983).
It
is
anintegral
part ofthe
design
effort ratherthan
adesign
verification check on a completed circuit.It
consists of a set of
64
processors which operatein
parallelto
performthe
actual simulation of adesign.
The
software-is
writtenin
aninteractive
IBM
version ofPascal
whichtakes
advantage ofthe
speed andcapacity
ofthe
machine.The
input
and output are graphic.The
IBM
Yorktown
Simulation
Engine
is
the
second generation ofthe
LSM.
2.3.7
Microprocessor
Logic
Simulators
Two
simulators which arecurrently
availablefor
use onmicrocomputers
are calledLogicsim
andLogic
Desi
gner/Logi
cSi
mul ator.Logicsim
runs on anIBM-PC
as well as othermicrocomputers with
64K
of memory.It
will simulateTTL
7400
seriesICs
andCMOS
ICs.
It
has
available alibrary
ofpre-defined network macros which
the
usermay
incorporate
into
a circuitdesign.
Logicsim
uses a compiled simulationscheme and offers various analysis
tools
and printer andplotter options
for
output.Logic
Designer /Logic
Simulator
runs on anApple
11+
oran
IBM-PC.
The
Logic
Designer
enablesthe
userto
createhis
circuitdesign
directly
onthe
screen andit
incorporates
a number of routinesto
aidin
the
design
process.
Logic
Designer /Logic
Simulator
has
alimited
number of gates and
does
not usepreset,
clear and clocksignals,
nordoes
it
usedelays
in
the
circuit simulation.(Rubenstein
1983)
-2.4
Summary
Circuits
areincreasing
in
size and complexity.This
necessitates
design
tools
which arefaster
and moreaccurate.
Simulation
has
become
animportant
part ofthe
design
processlargely
because
ofthe
cost-reductionin
both
time
andmoney
which canbe
realized.Simulation
has
been
done
both
in
hardware
and softwaredepending
onthe
relativecosts and efficiencies of each at
the
time.
Multiprocessing
and parallel
processing
willbecome
moreimportant
in
circuit simulation
because
ofthe
speed required andthe
parallel nature of circuits.
CHAPTER
THREE
PROJECT
DEVELOPMENT
3.0
Introduction
In
the
process ofdeveloping
this
timing
simulator,several
topics
wereresearched,
including
appropriatesimulation
algorithms,
languages
andthe
selection of arepresentative set of gates and
integrated
circuits(referred
to
asICs).
Issues
such as multi-valuedlogic
andvarious
delay
models were also studied and certainassumptions were
determined
to
be
necessary.This
chapterwill
discuss
these
investigations
andthe
resulting
assumptions.
3.1.1
Algorithms,
Language
andElements
Event-directed
simulation was chosenbecause
it
is
moreefficient
than
compiler-drivensimulation,
asit
simulatesonly
the
active portions ofthe
circuit.Algorithms
to
do
event-driven simulation were studied and various
ideas
wereused
to
develop
the
simulation algorithmfor
this
problem.(Breuer
1975,
Ulrich
1980)
A
table
data
structure,
for
storing
information
about eachnode,
was adaptedfrom
Breuer
's work.
A
circuitdata
structure wasdeveloped
to
represent
the
connectionsbetween
elements.A
time-ordered
queue,
to
schedulethe
future
events,is
based
on Ulrich' stime-wheel
.C
was chosen asthe
language
in
whichto
codethis
project
for
several reasons.Pointers
and structures areheavily
used anddynamic
allocationis
usedfor
the
manipulation
ofthe
future
eventslist.
C
seemed mostappropriate
for
this
task.
A
subset ofTTL
elements was chosento
be
included
in
the
simulator'slibrary.
Elements
were chosento
provide areasonable subset with which
to
design
simple circuits.Information
about each elementincludes
propagationdelays
and
functional
data.
Two
values,usually
typical
andmax,
are stored
for
eachlow
to
high
andhigh
to
low
propagationdelay.
For
each elementthere
is
aC
function
whichdetermines
the
outputsfor
a given set ofinputs.
3.1.2
Types
ofDelay
Models
TIMSIM
is
designed
to
simulatethe
timing
of a circuitwith respect
to
propagationdelays
(low
to
high
andhigh
to
low)
withinthe
elements.There
are severaltypes
ofdelay
models which can
be
usedto
simulatethe
timing
in
acircuit.
This
section comparesthe
delay
characteristics ofTIMSIM
with otherdelay
models.A
transport
delay
simulator uses a rather simplisticconcept and can
be
modeled as a unitdelay
or zerodelay
simulator or with
variable
delays
assignedto
the
elements.It
will notfunction
as an accuratetiming
simulator.An
ambiguity
delay
simulatortakes
into
accountthe
ranges of each
propagation
delay,
ie.,
minimum and maximumpossible
timing
for
eachdelay.
Built
into
the
simulatorthen
is
a region ofambiguity
for
each signal change.During
these
times
ofambiguity
it
is
not clearif
the
signal
i
s a0
or a1
.These
regions ofambiguity
willpropagate
through
the
circuit oftenleading
to
anoverly
pessimistic analysis
(d'Abreu
1985).
The
TIMSIM
simulatoruses
only
one valuefor
each propagationdelay
anddoes
notcontain
these
regions of ambiguity.TIMSIM
uses a valuefor
the
delay
whichis
determined
by
the
random generation of a numberbetween
the
typical
value and
the
maximum value ofthe
delay.
The
typical
andmax values are used rather
than
min and maxbecause
often aminimum
is
not suppliedby
the
chip
manufacturer.The
random value
is
usedto
modelthe
real world situationin
which
two
identical
elements would nothave
exactly
the
same
delay
atevery
signal change.An
inertial
delay
simulatorincorporates
the
idea
that
a signal needs
to
remain unchanged atthe
input
of anelement
for
some specifiedlength
oftime
(particular
to
that
element)before
it
is
"recognized"by
the
element.If
the
pulseis
long
enoughit
may
cause a changein
the
outputsignal.
This
inertial
delay
conceptis
not usedin
TIMSIM.
-The
decisions
of whetherto
incorporate
inertial
delay
or
ambiguity
delay
were madeby
the
necessity
to
controlthe
complexity
ofthe
simulation
development.
It
was alsodecided
to
ignore
transition
time,
the
time
it
takes
for
asignal
to
gofrom
0
to
1,
but
instead,
considerthe
transition
to
be
instantaneous.
These
assumptions were madewith
the
realization
that
certain real world conditionsmight
be
missedin
the
modeling.For
example,
a spike whichmight
happen
in
a real circuitmay
notbe
generatedby
this
simulator
because
the
ambiguity
delays
which might cause aspike
to
occur are not allowed.Furthermore,
if
spikesdo
occur
in
a simulationrun,
the
simulatormay
propagatethem
through
the
circuitbecause
the
inertial
delays
presentin
areal circuit are not
there
to
filter
them
out.Therefore,
erroneous situations
may
notbe
recognizedby
this
simulatorbecause
ofits
limitations.
3.1.3
Multi
-valuedLogic
The
issue
of multi-valuedlogic
or multi-valued signalsis
discussed
in
several papers onlogic
simulators(d'Abreu
1985,
Szygenda
1975,
RNL,
Breuer
1975)
.These
sourcessuggest
the
addition of athird
logic
value expressed as 'X'or 'u'
to
representunknown,
undefined,
indeterminate
or'don't
care'states.
There
are severaldifferent
interpretations
for
this
third
logic
value and some authorsto
representfalling
andrising
values(d'Abreu
1985)
andpotential
spikes,
hazards
or races(Szygenda
1975).
Some
papers(RNL,
d'Abreu
1985)
useX
(unknown)
to
represent
the
value ofthe
signalbetween
0
and1,
i.e.
between
a validlow
and a validhigh.
Others
(Lewin
1977)
use
the
unknown stateto
represent a'don't
care7situation.
To
others,
(Szygenda
1975),
X
meansindeterminate,
e.g.the
value of
the
output of a clockedR-S
flip
flop
withinputs
of
1
and1.
TIMSIM
uses a -1to
representthe
indeterminate
state.
That
stateis
used when a nodeis
either0
or1
but
it
is
impossible
to
determine
whichit
is.
Several
sourcesindicate
the
importance
ofusing
unknown values at
the
point of "startup" ofthe
simulator.Setting
every
signalto
an unknownvalue,
then
resetting
prime
inputs
to
aknown
level
(0
or1),
andpropagating
the
signals
through
the
circuitis
a common circuitinitialization
procedure(RNL,
d'Abreu
1985).
If,
afterthis
initialization,
there
are still nodes which areunknown,
there
is
a problem.Unfortunately,
there
areseveral possible sources of
the
problem.They
include
the
circuit
design,
the
initialization
routineitself
orthe
simulator's
incapacity
to
deal
withthe
complexity
ofthe
circuit
(Breuer
1975).
TIMSIM
uses aninitialization
sequence ofthis
type
to
cause
the
circuitto
stabilizebefore
simulationbegins.
at
0
and a zerodelay
simulation
initialization
is
run onthe
circuit.If
any
nodes
remain atthe
unknown state atthis
point,
these
nodes are reportedto
the
user who canthen
electto
do
anotherinitialization
run.This
additional
initialization
procedure will setthe
outputs ofcertain clocked
ICs,
whichhave
known
values atthe
inputs
but
whichdo
not reach aknown
statein
the
zerodelay
simulation
initialization.
3.2
Essential
Features
ofthe
Simulator
A
library
oftwelve
standardTTL
gates andICs
forms
the
basis
ofTIMSIM.
These
components are oftwo
types
-simple gates with single outputs and symmetric
inputs
(ANDS,
ORS
andXORS)
andthe
more complexICs,
such as aJK
flip
flop
and alatch.
These
two
groupshave
different
requirements with respect
to
data
structures and algorithms.The
information
in
the
library
includes
arrays whichcontain
the
propagationdelays
for
eachTTL
component andC
functions
which computethe
value of eachoutput,
giventhe
inputs.
It
is
necessary
to
storefour
delay
times
(typical
and max
for
low
to
high
andfor
high
to
low
transitions)
for
each
distinct
combination ofinput
and output.In
the
caseof
the
simple gates(AND,
OR,
etc.),
the
inputs
aresymmetric and one
four
elementarray
is
sufficientfor
each.For
anIC
such asthe
7475
latch,
the
propagationdelays
aredifferent
depending
on whichinput
changed andtherefore
-more
delays
needto
be
stored.The
algorithm usedto
simulate
the
multi-output,
non-symmetricinput
componentsneeds
to
keep
track
of whichinput
caused a changeto
whichoutput and
then
to
retrievethe
correct propagationdelay
for
that
change.An
IC
such asthe
TTL
7474
d-type
flip
flop,
which usesthe
former
state ofits
input
lines
as well asthe
presentstate,
requiresthat
the
simulator storeboth
the
previousvalue and
the
present value.Components
with multipleoutputs require
keeping
track
ofthe
order ofthe
outputnodes.
Two
data
structures are usedto
storethe
connections
between
the
componentsin
the
circuit-one
which represents
the
circuit and one which storesinformation
aboutthe
nodes.A
significant aspect ofthe
simulation algorithmis
the
resolution of
overlapping
delay
scheduling.For
example,
suppose node n
is
scheduledto
change andthen,
because
of achange
in
anotherinput
to
noden,
another eventis
scheduled
for
node nbefore
the
previous oneis
executed.It
mustbe
determined
what value node n shouldtake.
This
involves
a schedule/deschedule algorithm which readsthe
future
eventlist
andschedules,
reschedules or cancels anevent.
-CHAPTER
FOUR
IMPLEMENTATION
4.0
Overview
The
implementation
ofthe
simulator canbe
described
in
several ways.Descriptions
ofthe
inputs
and outputs arefound
in
section4.1.
File
descriptions
ofthe
source codein
section4.2
indicate
the
organization ofthe
programs.Structure
charts withaccompanying
descriptions
for
the
modules are
located
in
sections4.3
and4.4.
Section
4.5
contains
detailed
descriptions
ofthe
data
structures andsection
4.6
describes
the
eventscheduling
andprocessing
procedure.
4. 1
Inputs
andOutputs
The
input
to
the
parseris
a circuitdescription
file,
e.g.
fname,
madeup
of a series of statementscontaining
key
words and
their
arguments,
enclosedin
parentheses.These
statements
specify
TTL
elements andtheir
associated nodes.As
is
illustrated
in
Fig.
4.1,
allthe
nodesin
the
circuit must
be
listed
first.
Each
elementis
followed
by
its
output nodes,then
its
input
nodes.The
connectionsin
the
circuit arethereby
establishedby
the
named nodes.The
symbol
5
identifies
a commentline.
There
areadditional
features
which canbe
included
in
the
circuit
description
which willgive
the
userflexibility
in
creating
acircuit.
The
key
words associated withthese
features
areinclude,
repeat,
and macro.Include
allows
another
file
whichis
storedin
the
user'sdirectory,
to
be
included
in
the
circuitbeing
developed.
Repeat
allows arepetitive
sequenceto
be
specified andthe
parser willexpand
it
as part ofthe
circuit.Macro
introduces
a macrodefinition
whichthe
parser will store and expand atthe
appropriate place
in
the
circuit.AH
jfile
je2
(node
AH
BH
BL
tl
t2
t3
yH)(inv
BL
BH)
(nand2
tl
AH
BL)
(nand2
t2
AH
yH)(nand2
t3
BH
yH)(nand3
yHtl
t2
t3)
^=0^
Fig.
4.1
Fig.
4.2
is
adata
flow
diagram
ofTIMSIM.
The
mainoutput of
the
parseris
afile
calledfname.
sim(see
Appendix
A),
whichis
storedin
the
user'sdirectory
aftersuccessful
parsing
ofthe
input
file.
This
file
containsthe
expanded circuitdescription
in
readableform.
The
usermay
verify
the
circuit connections withthis
file.
If
the
circuitdescription
file
was parsedcorrectly
amessage appears on
the
screen,
giving
the
name ofthe
parsedfile.
If
the
input
file
was notsyntactically
correct anerror message
is
output andthe
programhalts.
user
(screen)
circuit
descripti
file
[fname)
user
Data
Flow
Diagram
Fig.
4.2
One
input
to
the
simulatoris
the
fname.
simfile,
output
from
the
parser.The
simulator readsthis
file
andloads
the
information
into
the
internal
table
and circuitdata
structures.The
otherinput
to
the
simulatoris
a series ofcommands
that
define
the
parameters ofthe
simulation.These
commands canbe
runfrom
abatch
commandfile
orentered
interactively.
If
interactive,
the
user willbe
prompted
for
selections.
The
commandfile
which needsto
be
included
as a commandline
optionfollows
a preciseformat
for
choosing
the
simulation options.The
options availableto
the
user arethe
length
of a simulationstep,
the
format
of
the
output,
andthe
selection of nodesfor
the
outputreport.
These
options remain constantthrough
an entiresimulat
i
on.There
arethree
possible outputformats.
One
is
in
the
form
of atable
which reports allactivity
(changes
in
nodevalues)
during
the
simulationstep
andthe
times
ofthose
changes.
Another
outputformat
is
graphical with nodevalues reported at regular
intervals.
A
third
outputformat
reportsthe
value ofthe
nodes atthe
end ofthe
simulation
step
as well asthe
time
ofthe
last
statechange.
Default
for
the
output reportis
to
the
screen.There
is
also alog
file
commandline
option.Exercising
this
option causes
the
results of each simulationstep
(in
whichever
format
was chosen)to
be
placedin
afile
in
the
user's
directory.
The
file
is
calledlogfile.
To
begin
a simulationstep,
the
user setsthe
value ofany
or all nodes(not
only
primary
inputs)
andbegins
the
simulation.
The
simulatordetermines
whetherthere
areany
changes
to
the
values of output nodes affected
by
the
changes
in
input
values.If
a potential changeis
recognized,
the
propagation
delay
(low
to
high
orhigh
to
low)
for
the
particular
elementis
determined
andthe
event,
the
changein
value ofthe
outputnode,
is
put onthe
future
events
list.
This
process continuesfor
the
period oftime
chosen as
the
simulation
step
length.
4.2
Files
init.c
\
lib.c
tab.h
parse.c
tab.c
File
Structure
Figure
4.3
The
content of each ofthe
files
is
described
below.
lib.c
-The
lib.c
file
containsthe
library
ofTTL
elementswhich are available
to
the
simulator.The
library
includes
a
table
of propagationdelays
for
eachelement,
with eachdelay
being
representedby
atypical
and a maxdelay
time
for
low
to
high
andfor
high
to
low.
The
library
alsocontains subroutines which express
the
functionality
of eachelement.
-tab.h
-The
tab.h
file
contains
allthe
supporting
data
structures
for
the
simulator.
These
include
the
maintable
of nodes which
drives
the
simulation,
the
circuitstructure,
the
time-wheel
andthe
record array.The
table
is
anarray
of
structures,
eachrepresenting
a node andits
relatedinformation
-value,
previousvalue,
scheduledtime
to
change and
locations
in
the
circuit.The
circuitis
anarray
ofstructures,
eachrepresenting
an elementin
the
circuit.
It
storesthe
input
nodes and output nodesfor
each element.
The
time-wheel
is
a circulararray
ofpointers
to
linked
lists
which are usedto
storethe
pending
events
in
the
simulation.The
recordarray
keeps
track
ofall
the
events sothey
canbe
reported.parse. c
-The
parse.cfile
containsthe
executable codefor
the
parser with subroutinesfor
decoding
each ofthe
key
words
in
the
circuitdescription
file.
It
readsthe
circuitdescription
file,
expandsthe
macro and repeat constructsand outputs a
file
containing
the
expanded circuit.init.c
-The
init.c
file
containsthe
error messagesfor
the
parser and also
the
mapping
of elements andkey
wordsinto
integers.
tab.c
-The
tab.c
file
containsthe
executable codefor
the
simulator.
It
does
aninitialization
routine,
readsin
commands
from
the
user,
then
repeatedly
readsthe
future
events
list,
executesthe
changes,
then
schedules morechanges.
4.3
Modules
in
the
Parser
get_token
is_
white
is in
decode_stri
ng
output
file
i
ncludeJ
L
enter_
el ement
Structure
Chart
ofthe
Parser
The
following
arebrief
descriptions
ofthe
majorsubroutines
in
the
parser.
main
-opens and closes
the
input
file;
namesthe
outputfile
get_exp
-drives
the
parserget_token
-reads
the
nextcharacter;
determines
its
type
decode_string
-case statement
for
the
key
wordsin
input
exp_macro
-expands macros and puts
them
in
the
circuitf_macro
-stores a macro
description
for
later
processing
enter_nodes
-loads
nodesinto
the
table
f_repeat
-decodes
repeatloops
in
the
input
file
get_nodes
-deciphers
the
nodelist
in
a repeatloop
fill_circuit
-loads
the
circuitdata
structure withindexed
nodes
f_include
-handles
any
include
lines
in
the
input
file
enter_element
-puts an element with
its
nodesinto
the
circuit
data
structureoutput_file
4.4
Modules
in
the
Simulator
main
read
input
files
I
initialize
simulatezr
i
report
siminit
prime
inputs
init_
circuitsset nodes
read
in
-filecommands auto commands
active
lines
2
,
C
a_report
b_report
1
c_report
list
val
set
lines
f_delay
I
I
load
b
recordrecord
event
eval_schedule
I
schedule vent
mark cancel
Structure
Chart
ofthe
Simulator
Figure
4.5
-The
following
arebrief
descriptions
ofthe
majorsubroutines
in
the
simulator.
main
-opens
files;
initializes;
readsinput;
drives
simul ati on
set_lines
-resets nodes after each simulation
step
autocommands-interprets
commandsfrom
a commandline
file
commands
<