Languages
Is there a way to generate a digital pulse that alternates between long and short pulsewidths as shown below?
Starting with the XMODEL 2022.02 release, the 'pulse_gen'
primitive can produce digital pulses with arbitrary waveforms. For instance, its real-typed array parameter 'data'
can define the individual transition time instants of a digital pulse waveform. Also, if the waveform repeats a certain pattern, the parameters 'period'
and 'repeat_pos'
can define its repetition period and starting position. For the complete information on this 'pulse_gen'
primitive, please refer to its documentation.
The digital waveform you described can be generated using this 'pulse_gen'
instance:
xbit out; pulse_gen #(.init_value(0), .data('{0.0,1e-9,3e-9,5e-9}), .period(6e-9)) INST (out);
This 'pulse_gen'
instance generates a pulse that starts at an initial value of 0 and toggles to a different value at the time instants of 0, 1ns, 3ns, and 5ns. Afterwards, the pulse repeats the same pattern with the period of 6ns. The simulated waveform shown below confirms that the instance generates the desired digital pulse.
Please login or Register to submit your answer
Starting with the XMODEL 2022.02 release, the 'pulse_gen'
primitive can produce digital pulses with arbitrary waveforms. For instance, its real-typed array parameter 'data'
can define the individual transition time instants of a digital pulse waveform. Also, if the waveform repeats a certain pattern, the parameters 'period'
and 'repeat_pos'
can define its repetition period and starting position. For the complete information on this 'pulse_gen'
primitive, please refer to its documentation.
The digital waveform you described can be generated using this 'pulse_gen'
instance:
xbit out; pulse_gen #(.init_value(0), .data('{0.0,1e-9,3e-9,5e-9}), .period(6e-9)) INST (out);
This 'pulse_gen'
instance generates a pulse that starts at an initial value of 0 and toggles to a different value at the time instants of 0, 1ns, 3ns, and 5ns. Afterwards, the pulse repeats the same pattern with the period of 6ns. The simulated waveform shown below confirms that the instance generates the desired digital pulse.
Please login or Register to submit your answer