Simulation and Metamorphosis - PowerPoint PPT Presentation

1 / 28
About This Presentation
Title:

Simulation and Metamorphosis

Description:

Metamorphosis. Function tables are used to support polymorphism. Function ... Metamorphosis requires read-write function tables, or generic function pointers ... – PowerPoint PPT presentation

Number of Views:21
Avg rating:3.0/5.0
Slides: 29
Provided by: newsPete
Category:

less

Transcript and Presenter's Notes

Title: Simulation and Metamorphosis


1
Simulation and Metamorphosis
  • Peter M. Maurer
  • Baylor University

2
Simulation Types I
  • Event Driven / Oblivious
  • Oblivious Simulation time is not dependent on
    input values
  • Event Driven Simulation time is a function of
    the number of changes in gate input values

3
Simulation Types II
  • Compiled / Interpreted
  • Compiled Simulation converts a circuit
    description into a program, which is then
    compiled to create the simulator for the circuit
  • Interpreted simulation performs simulation based
    on a set of internal tables, which can be changed
    dynamically

4
The Usual Combinations
  • Levelized Compiled Code
  • Oblivious
  • Compiled
  • Zero Delay
  • Event Driven Simulation
  • Event Driven
  • Interpreted
  • Unit Delay

5
The Inversion Algorithm
  • The First Metamorphic Algorithm
  • Event Driven
  • Eliminates intermediate net values
  • Eliminates all NOT gates
  • Eliminates XOR/XNOR Gates
  • AND, OR, NAND, NOR are all the same
  • At an activity rate of 60, is almost as fast as
    levelized compiled code

6
Functions As Type Codes
  • Gate-Simulation Example
  • Old Style Structures
  • Each Structure contains a type code
  • Decode the type code to select a simulation
    routine
  • Objects
  • A different class is used for each gate-type
  • Each class has its own simulation routine
  • Functions accessed through a pointer table

7
Polymorphism
  • Create a base type
  • Define a virtual function in the base type
  • Define several derived types
  • Override the virtual function in the derived
    types
  • Calling the virtual function through the
    base-type pointer calls the function in the
    derived type

8
Metamorphosis
  • Function tables are used to support polymorphism
  • Function tables are read only
  • Metamorphosis requires read-write function
    tables, or generic function pointers
  • Threaded-Code pointers can also be used

9
Metamorphic State Machines
  • Function Pointers are used for state codes
  • Instead of the following code
  • If StateCode A Then Call B
  • We call B directly through a function pointer
  • Used in the Inversion Algorithm to represent net
    states
  • Used for everything in EVCF

10
The EVCF Technique
  • Internal States
  • Net State 1/0 or Dominant/Non-Dominant Depending
    on Gate Type
  • Gate State Number of Dominant Inputs
  • Queue Status Output Events Queued/Not
  • Monitored Net 1/0
  • Queue Empty/Not-Empty
  • Separate Gate/Net Structures

11
Net/Event Structure
struct Net struct Net Next struct Net
Prev Address ProcessRoutine struct Gate
Output struct Gate Driver
12
Event Processing Routines
EVUP Shp-gtProcessRoutine EVDN Shp2
Shp-gtOutput goto Shp2-gtUp EVDN Shp-gtProcess
Routine EVUP Shp2 Shp-gtOutput goto
Shp2-gtDown
13
The Gate Structure
struct Gate struct Net Begin struct Net
End Address Up Address Down Address
Schedule struct Net QueueHead
14
Gate Simulation Routines
 
DN0 shp shp-gtNext goto shp-gtProcessRoutine
UP0 shp2-gtUp UP1 shp2-gtDown DN1 goto
shp2-gtSchedule
UP1 shp2-gtUp UP2 shp2-gtDown DN2 shp
shp-gtNext goto shp-gt ProcessRoutine
DN1 shp2-gtUp UP0 shp2-gtDown DN0 goto
shp2-gtSchedule
15
More Gate Simulation
UP2 shp2-gtUp UP3 shp2-gtDown DN3 shp
shp-gtNext goto shp-gt ProcessRoutine
DN2 shp2-gtUp UP1 shp2-gtDown DN1 shp
shp-gtNext goto shp-gt ProcessRoutine
16
Queueing
  • Single-List Processing is used
  • When an event is queued, there may already be an
    event for the net in the queue
  • Complementary events should cancel one another

17
Queueing Routine
QUEUE shp2-gtSchedule DEQUEUE
shp2-gtEnd-gtNext shp2-gtHead-gtNext
shp2-gtHead-gtNext-gtPrev shp2-gtEnd
shp2-gtHead-gtNext shp2-gtBegin
shp2-gtBegin-gtPrev shp2-gtHead shp
shp-gtNext goto shp-gtRtn
18
Dequeueing Routine
DEQUEUE shp2-gtSchedule QUEUE
shp2-gtBegin-gtPrev-gtNext shp2-gtEnd-gtNext
shp2-gtEnd-gtNext-gtPrev shp2-gtBegin-gtPrev shp
shp-gtNext goto shp-gtRtn
19
Event Structures
20
The End of a Chain
  • The final element in a prelinked chain of event
    structures uses a different set of event handlers

EVUP1 shp-gtRtn EVDN1
shp-gtDriver-gtSchedule QUEUE
shp2 shp-gtGate goto shp2-gtUp
EVDN1 shp-gtRtn EVUP1
shp-gtDriver-gtSchedule QUEUE
shp2 shp-gtGate goto shp2-gtDown
21
Queue Content
  • Multiple Queues are used for zero-delay
    processing
  • When one queue empties, it is necessary to
    advance to the next queue
  • An array of queue head pointers are used
  • Trailer elements mark the end of the queue and
    perform end-of-queue operations

22
The Trailer Routines
TRAILER // All but last queue in array
shp-gtHead-gtNext shp shp-gtPrev shp-gtHead
shp (struct Net )(shp-gtGate) goto
shp-gtRtn   TRAILER1 // Last Queue in Array
shp-gtHead-gtNext shp shp-gtPrev shp-gtHead
return
23
Monitored Nets
  • Most nets have no value maintained for them
  • Monitored nets require a current value
  • A special fanout-branch event is added to each
    monitored net
  • These monitor events calculate the value of the
    net
  • The monitor event is not processed unless the net
    changes value

24
Monitor Routines
MONITOR0 shp-gtProcessRoutine MONITOR1
(long)(shp-gtGate) '0' shp shp-gtNext
goto shp-gtRtn MONITOR1 shp-gtProcessRoutine
MONITOR0 (long)(shp-gtGate) '1' shp
shp-gtNext goto shp-gtRtn
25
Performance Details
  • Time Measured in CPU Seconds using UNIX /bin/time
    command
  • SUN UltraSparc-II 300MHZ
  • 128MB RAM
  • Times are the difference between simulating
    50,000 random vectors and 50,000 vectors of all
    zeros.
  • Each test was repeated several times and the
    results were averaged.

26
Performance Results (CPU Sec)
27
EVCF Summary
  • The EVCF technique is many times faster than
    conventional event-driven simulation
  • It is comparable in speed to the Inversion
    Algorithm, but considerably more versatile
  • It is cache-friendly, the simulation kernel is
    about 1200 bytes long

28
The Future
  • BDD Simulation
  • Boolean Equations
  • Other Objects
  • Metamorphic state machines
  • One-Hot state machines
  • New Ideas
Write a Comment
User Comments (0)
About PowerShow.com