12.4.1 Basic demos
These demos illustrate the use of certain stars without necessarily performing functions that are particularly interesting. The palette is shown in figure
Casestar by deconstructing a Poisson counting process into three subprocesses.
conditionalsDemonstrate the use of the
Testblock in its various configurations to compare the values of input events with floating-point values. The input test signal is a pair of ramps, with each event repeated once after some delay. Since the ramps have different steps, they will cross.
logicDemonstrate the use of the
Logicstar in its various instantiations as AND, NAND, OR, NOR, XOR, XNOR and inverter gates. The three test signals consist of square waves with periods 2, 4, and 6.
Mergestar. The star is fed two streams of regular arrivals, one a ramp beginning at 10.0, and one a ramp beginning at 0.0. The two streams are merged into one, in chronological order, with simultaneous events appearing in arbitrary order.
realTimeDemonstrate the use of the
Timerblocks. Input events from a
Clockstar are held by the
Synchronizestar until their time stamp, multiplied by the universe parameter timeScale, is equal to or larger than the elapsed real time since the start of the simulation. The
Timerstar then measures the actual (real) time at which the
Synchronizeoutput is produced. The closer the resulting plot is to a straight line with a slope of one, the more precise the timing of the
routerRandomly route an irregular but monotonic signal (a Poisson counting process) through two channels with random delay, and merge the channel outputs.
Samplerstar. A counting process with regular arrivals at intervals of 5.0 is sampled at regular intervals of 1.0. As expected, this produces 5 samples for each level of the counting process.
statisticsCompute the mean and variance of a random process using the
Statisticsstar. The mean and variance are sent to the standard output when the simulation stops. This action is triggered by an event produced by the
switchDemonstrate the use of the
Switchstar. A Poisson counting process is sent to one output of the switch for the first 10 time units, and to the other output of the switch for the remaining time.
testPacketConstruct packets consisting of five sequential values from a ramp, send these packets to a server with a random service time, and then deconstruct the packets by reading the items in the packet one by one.
timeoutDemonstrate the use of the
Timeoutstar. Every time unit, a timer is set. If after another 0.5 time units have elapsed, the timer is not cleared, an output is produced to indicate that the timer has expired. The signal that clears the timer is a Poisson process with a mean inter-arrival time of one time unit.
UDCounterstar. Events are generated at two different rates to count up and down. The up rate is faster than the down rate, so the trend is upwards. The value of the count is displayed every time it changes.
4BitDownCounterDemonstrate the use of the other Flip Flop stars.
blockageDemonstrate a blocking strategy in a queueing network. In a cascade of two queues and servers, when the second queue fills up, it prevents any further dequeueing of particles from the first queue until it once again has space.
delayVsServerIllustrate the difference between the
Delaypasses the input events to the output with a fixed time offset. The
Serveraccepts inputs only after the previous inputs have been served, and then holds that input for a fixed offset.
measureDelayDemonstrate the use of the
MeasureDelayblock to measure the sojourn time of particles in a simple queueing system with a single server with a random service time.
priorityDemonstrate the use of the
PriorityQueueblock together with a
Server. The upper input to the
PriorityQueuehas priority over the lower input. Thus, when the queue overflows, data is lost from the lower input.
psServerDemonstrate the processor-sharing server. Unlike other servers, this server accepts new inputs at any time, regardless of how busy it is. Accepting a new input, however, slows down the service to all particles currently being served.
qAndServerDemonstrate the use of the
Stackstars together with
Servers. A regular counting process is enqueued on both stars. The particles are dequeued whenever the server is free. The
Stackis set with a larger capacity than the
FIFOQueue, so it overflows second. Overflow events are displayed.
queueDemonstrate the use of the
Stackstars. A Poisson counting process is enqueued on both stars, and is dequeued at a regular rate, every 1.0 time units. The output of the
FIFOQueueis always monotonically increasing, because of the FIFO policy, but the output of the
Stackneed not be. The Stack is set with a smaller capacity than the
FIFOQueue, so it overflows first. Overflow events are displayed.
testServersDemonstrate servers with random service times (uniform and exponential).
FlushNetSimulate a queue with "input flushing" during overflow. If the queue reaches capacity, all new arrivals are discarded until all items in the queue have been served.
LBTestSimulate leaky bucket network rate controllers. These controllers moderate the flow of packets to keep them within specified rate and burstiness bounds.
VClockModel a network with four inputs and virtual clock buffer service.
wirelessNetworkDemonstrate shared media communication without graphical connectivity, using
EtherRecstars. Two clusters on the left transmit to two clusters on the right over two distinct media, radio and infrared. The communication is implemented using shared data structures between the stars.
shotNoiseGenerate a continuous-time shot-noise process and display regularly spaced samples of it. The shot noise is generated by feeding a Poisson process into a
hdShotNoiseGenerate a high-density shot noise process and verify its approximately Gaussian distribution by displaying a histogram.
roundRobinSimulate shared memory with round-robin arbitration at a high level.
prioritizedSimulate a shared memory with prioritized arbitration at a high level.
speechcodePerform speech compression with a combination of silence detection, adaptive quantization, and adaptive estimation. After speech samples are read from a file, they are encoded, packetized, depacketized, decoded, and played on the workstation speaker.
Synchronizestar to generate a beeping sound with a real-time rhythm.
distortionShow the effects on real-time signals of a highly simplified packet-switched network. Packets can arrive out of order, and they can also arrive too late to be useful. In this simplified system, a sinusoid is generated in the SDF domain, launched into a communication network implemented in the DE domain, and compared to the output of the communication network. Plots are given in the time and frequency domains of the sinusoid before and after the network.
distortionQSimilar to the distortion demo. The only difference is in the
reorderQwormhole, which introduces queueing.
wormShow how easy it is to use SDF stars to perform computation on DE particles. A Poisson process where particles have value 0.0 is sent into an SDF wormhole, where Gaussian noise is added to the samples.
four_levelA four level SDF/DE/SDF/DE system.
sourcesShow how to use an SDF star as a source by using a dummy input into the SDF system. The SDF subsystem fires instantaneously from the perspective of DE. The schedulePeriod SDF target parameter has no effect.
blockThe schedulePeriod parameter of the SDF target determines how the inside of the DE system interprets the timing of events arriving from SDF. When several samples are produced in one iteration, as here, the time stamps of the corresponding events are uniformly distributed over the schedule period.
TkButtonsby having the buttons generate events asynchronously with the simulation.
displaysDemonstrate some of the interactive displays in the DE domain.
TkSliderby having the slider produce events asynchronously. The asynchronous events are plotted together with a clock, which produces periodic outputs in simulated time. Notice that the behavior is roughly the same regardless of the interval of the clock.
sourcesA Tcl script writes asynchronously to its output roughly periodically in real time (using the Tk "after" command). The asynchronous events are plotted together with a clock, which produces periodic outputs in simulated time. Notice that the plot looks roughly the same regardless of the interval of the clock.
TkStripChartby plotting several different sources.
xyplotDisplay queue size as a function of time with an exponential random server.
TkPlotstar overlays the plots as time progresses, which the
TkXYPlotstar does not. Thus, the points on the
TkXYPlotstar go off the screen to the right. The
TkStripChartstar records the entire history.