SequentialClock

Parent Previous Next

Full Library / Source / Clock / SequenceClock
Block Name: SequenceClock

Code File Location: VisualSim/actor/lib/SequenceClock

Block Overview

o       Produce a Sequence output with a shape specified by the parameters.  

Description

A clock source for sequence-capable simulators. This actor is considerably simpler than the Clock block. On each execution, it produces the next value from its values parameter, and schedules another firing at a future time determined by the offsets and period parameters.

This actor can be used in the Digital simulator to generate a sequence of events at regularly spaced intervals. It cannot be used in Continuous, because Continuous will invoke it at times where it has not requested a firing, and it will inappropriately advance to the next output value.

At the beginning of each time interval of length given by period, it initiates a sequence of output events with values given by values and offset into the period given by offsets. These parameters contain arrays, which are required to have the same length. The offsets array must be nondecreasing and nonnegative, or an exception will be thrown when it is set. Moreover, its largest entry must be smaller than period or an exception will be thrown by the fire() method.
The values parameter by default contains an array of IntTokens with values 1 and 0. The default offsets array is {0.0, 1.0}. Thus, the default output will be alternating 1 and 0 with 50% duty cycle. The default period is 2.0.

The type of the output can be any token type. This type is inferred from the element type of the values parameter.

This actor is a timed source; the untimed version is Pulse.

Refer SequenceClock Demo Model.

Parameter

Explanation

Type

Example

period

The period of the output waveform. 

Double

2.0

offsets

The offsets at which the specified values will be produced. 

Array

{0.0, 1.0}

values

The values that will be produced at the specified offsets. 

Array

{1, 0}

Port

Explanation

Type

Output

At every sequence edge a value is output on this port 

Any Type inferred from value parameter

Created with the Personal Edition of HelpNDoc: Benefits of a Help Authoring Tool