RTL Studio Open IDE

Clock Generators

Run Window for N Cycles

Generates a busy signal for a configurable number of clock cycles triggered by a start pulse.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Run Window for N Cycles is a Verilog reference block in the Clock Generators catalog. Clock dividers, gating, and clock distribution helpers. Marked Medium: more state or a wider datapath, still one workspace in the IDE.

This IP implements a run window generator that asserts a busy signal for a configurable number of clock cycles. It accepts a start trigger and a width-8 cycle count input. The busy output remains high until the counter decrements to zero. Subsequent start signals are ignored while the window is active.

This IP provides a reliable mechanism for generating fixed-duration busy windows. It is suitable for controlling peripheral access or state machine timing. The design is fully synchronous and reset-safe. Simulation results confirm correct behavior across all tested conditions.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Run Window for N Cycles.
  2. Read the Verilog module in the editor. The catalog line for this block: Generates a busy signal for a configurable number of clock cycles triggered by a start pulse.
  3. Run the packaged testbench with the in-browser Verilator simulator, then open the VCD in the waveform viewer.
  4. Run Yosys in the same IDE for a generic netlist. Sky130 liberty mapping is a separate Pro library option.

RTL Studio is the Verilog simulator and IDE around this block: Slang lint, Verilator, VCD waveforms, and Yosys, in the browser. Simulation guide · Yosys guide.

Features

  • Configurable window duration via [7:0] n_cycles input.
  • Non-retriggerable behavior during active window.
  • Asynchronous reset deasserts busy and clears the counter.
  • Synchronous start detection on positive clock edge.
  • Simple interface suitable for state machine control.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low reset
startInput1Start trigger
n_cyclesInput8Number of cycles to run
busyOutput1Active-high busy flag

Verification

The testbench verifies four key scenarios:

  1. Reset deasserts the busy signal immediately.
  2. A single start pulse initiates a window of N cycles.
  3. Concurrent start signals during an active window are ignored.
  4. A one-cycle window correctly asserts and deasserts busy.

All test cases passed in simulation.

Test CaseDescriptionResult
TC1Reset state verificationPASS
TC23-cycle window executionPASS
TC3Ignore start while busyPASS
TC41-cycle window executionPASS

More in Clock Generators

All Clock Generators blocks