Periodic Pulse
Emits a one-clock-wide pulse every N clock cycles. The period is either a constant typed in the properties or a 32-bit input pin that can be changed at run time.
Introduction
The Periodic Pulse block is the simplest possible rate generator: give it
a period in clock cycles and it raises PULSE for exactly one clock every
time that many cycles have elapsed.
PERIOD = 5
CLK _|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_|‾|_
PULSE ________________|‾|________________|‾|___
^ ^
5 clocks 5 clocks
It is not the same block as Pulse Generator (PWM): that one takes a
period and a width and is meant for duty-cycle control. This one only ever
produces a single-clock tick, which is what you want to drive a counter, an
acquisition trigger, a GET request, or any “do something every N clocks”
input.
Pin Description
Properties
CONSTANT: the period is the value typed below and is fixed in the bitstream. PORT: a 32-bit PERIOD input pin appears on the block and the period can be changed at run time.
- CONSTANT – the period is fixed at compile time to the Period
value below; no
PERIODpin is created. - PORT – a 32-bit
PERIODinput pin is created and the period can be changed while the design runs.
Default: CONSTANT
Options: CONSTANT PORT
Number of clock cycles between two pulses, 1 to 4294967295. Only used when Period Source is CONSTANT. A period of 1 pulses every clock.
Number of clock cycles between two pulses, 1 to 4294967295, default 1000. Only used when Period Source is CONSTANT; ignored in PORT mode. Rejected when the property window is confirmed if it is not a whole number in range.Default: 1000
Usage
Timing contract
With PERIOD = N:
- the first pulse comes
Nclocks afterRESETis released; - consecutive pulses are exactly
Nclocks apart; PULSEis high for exactly one clock.
Where the period comes from
The Period Source property decides:
- CONSTANT – the period is the number typed in the Period property
and is fixed in the bitstream. The block has no
PERIODpin. - PORT – a 32-bit
PERIODinput pin appears on the block and the period can be changed at run time, for example from a register.
Either way the value is a plain count of clock cycles, from 1 to 4294967295.
Changing the period at run time
The value on PERIOD is latched at each wrap, so the interval already in
progress always completes with the value it started with. A new value
therefore takes effect from the next pulse onwards. This is deliberate: a
mid-period change can never produce a runt interval or a stretched one.
Degenerate values
PERIOD = 1 pulses on every clock. PERIOD = 0 is treated the same way: a
period of zero samples has no meaning, and clamping it to 1 also keeps the
internal PERIOD-1 arithmetic from wrapping around. To stop the block, use
EN rather than a zero period.
EN
Driving EN low freezes the counter where it is and forces PULSE low.
Raising it again resumes the interval from that point – it does not restart
it. Leave it unconnected and it is tied to '1', so the block free-runs.
Typical applications
- Acquisition or trigger tick at a fixed rate.
- Driving
GETon a queue-based block (for example the Random Generator) at a controlled rate. - Clock-enable / rate divider for a slower downstream stage.
- Periodic refresh, watchdog kick or housekeeping strobe.
Resources & Timing
-
Latency: PULSE is registered: it appears one clock after the counter wraps
-
Throughput: one pulse every PERIOD clocks
Pure VHDL, no HLS, no DSP: one 32-bit counter, one comparator and a register for the latched period. In CONSTANT mode the comparison is against a constant, so synthesis prunes most of the period register.