RTL Studio Open IDE

Clock Generators

Startup Ready After N Cycles

Asserts a ready signal after a configurable number of clock cycles following reset.

About this block

Simulate it in the Verilog IDE

Mediumverilogsimsyn

Startup Ready After 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 asserts a ready signal after a configurable number of clock cycles following reset. It supports dynamic configuration of the wait count via the n_cycles and n_cycles_valid inputs. The ready signal is sticky once asserted and remains high until the next reset or valid configuration update.

This IP provides a simple and configurable startup delay mechanism. It is suitable for systems requiring a stable ready signal after power-on or reset.

  1. Choose Open in IDE. RTL Studio loads the packaged workspace for Startup Ready After N Cycles.
  2. Read the Verilog module in the editor. The catalog line for this block: Asserts a ready signal after a configurable number of clock cycles following reset.
  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 startup delay from 0 to 255 cycles.
  • Synchronous reset with active-low polarity.
  • Sticky ready output for stable system handshaking.
  • Dynamic reconfiguration support via n_cycles_valid.

Ports

Port NameDirectionWidthDescription
clkInput1Clock input
rst_nInput1Active-low reset input
n_cyclesInput8Number of cycles to wait
n_cycles_validInput1Valid signal for n_cycles configuration
readyOutput1Ready signal asserted after N cycles

Architecture

The module uses a synchronous counter to track the remaining cycles. When n_cycles_valid is asserted, the counter loads the value from n_cycles. The counter decrements on each clock cycle while counting is active. Once the counter reaches zero, the ready signal is asserted and counting stops. The ready signal remains high until a reset occurs or a new valid configuration is provided.

Verification

The testbench verifies the following scenarios:

Test CaseDescriptionExpected Result
TC1Reset stateready is 0
TC2N=2 cyclesready asserts after 2 cycles
TC3Sticky highready remains 1 after assertion
TC4N=3 cyclesready asserts after 3 cycles

All test cases passed successfully.

More in Clock Generators

All Clock Generators blocks