pulse_gen :
A digital pulse generator
The pulse_gen primitive generates an xbit-typed, digital pulse signal with a periodic or arbitrary waveform. The output pulse waveform can be described using one of the two methods:
1) Defining the pulse width and period of a periodic pulse waveform
The first method describes the waveform of a periodic digital pulse. The pulse starts at the value defined by the parameter init_value at time 0. After an initial delay defined by the parameter delay, the pulse toggles to the opposite value, i.e., ~init_value, which lasts for the duration defined by width. This finite-duration pulse is repeated for every period defined by the parameter period. The resulting waveform is illustrated below:
~init_value +--------+ +--------+
| | | |
init_value ---------+ +------------------+ +------- ...
^ ^ ^ ^
| | | |
time 0 delay delay+width delay+period
The waveform can be a single pulse or a single step when the parameter period or width has a negative value, respectively. In other words, the pulse stops toggling after the second transition when period is negative, and stops toggling after the first transition when width is negative. When using this method, the parameter repeat_pos is not used (i.e. assumed to be 0).
2) Defining the series of transition time instants of an arbitrary pulse waveform
The second method describes the waveform of a digital pulse with arbitrary transition time instants. The real-typed array parameter data lists the transition time instant values:
'{ t1, t2, t3, t4, t5, ...}.
The pulse starts at the value defined by the parameter init_value at time 0. At time t1, the pulse toggles to the opposite value, i.e., ~init_value. And at time t2, the pulse toggles back to init_value, and so on. The resulting waveform is illustrated below:
~init_value +--------+ +--------+ +--------
| | | | | ...
init_value ------+ +------------+ +-------+
^ ^ ^ ^ ^ ^
| | | | | |
time 0 t1 t2 t3 t4 t5
When using this method, the parameter period defines the period at which the waveform is repeated. If its value is negative (e.g. -1), the waveform is not repeated. The parameter repeat_pos defines the start point of the waveform to repeat (by default, 0.0). The parameter delay defines the initial delay for the primitive to wait before generating the described waveform.
When the parameter filename is defined, the primitive reads the named file that defines the parameter values in Python format. The following example shows the content of a parameter file describing the pulse waveform using the second method:
data = [ 1e-9, 2e-9, 3.5e-9, 4.5e-9, 5.5e-9 ]
period = 7.0e-9
repeat_pos = 0.0
delay = 10e-9
On the other hand, an analog pulse can be generated by using this pulse_gen primitive followed by a transition primitive.
Input/Output Terminals
| Name | I/O | Type | Description |
| out | output | xbit | output signal |
Parameters
| Name | Type | Default | Unit | Description |
| init_value | logic | 0 | None | initial value |
| delay | real | 0.0 | seconds | initial delay |
| width | real | 1.0e-9 | seconds | pulse width |
| period | real | -1.0 | seconds | repetition period |
| repeat_pos | real | 0.0 | seconds | repetition start position |
| data | real_array | ‘{-1.0} | seconds | time instant series |
| filename | string | “” | None | parameter definition file |