prim_prog_clk_div_posedge

Divide clk_i on the positive edge with a programmable ratio and duty cycle.

update_settings_i samples divider_i and duty_cycle_i into the divider; after reset the divider is INITIAL_DIVIDER_VAL with a 50% duty cycle. use_clk_div_i selects the divided clock through a glitch-free mux; otherwise clk_o follows clk_i. test_en_i muxes scan_rst_ni onto the reset path; it does not bypass the divider. RESET_WIDTH stretches the synchronized reset in clk_i cycles.

Parameters

Table 1. Parameters
NameTypeDefaultDescription
RESET_WIDTHint unsigned16Synchronized reset stretch in clk_i cycles.
INITIAL_DIVIDER_VALbit [7:0]8'd2Divider value after reset.
DIVIDED_CLOCK_ON_RESETbit1'b0Starts with the divider engaged after reset.

Ports

Table 2. Ports
NameDirectionTypeDescription
clk_iinputlogicSource clock.
rst_niinputlogicAsync reset, active-low; synchronized to clk_i internally.
update_settings_iinputlogicSamples divider_i and duty_cycle_i.
divider_iinputlogic [7:0]Divide ratio in clk_i cycles; values below 2 act as 2.
duty_cycle_iinputlogic [7:0]High time in 1/256 of the divided period, clamped to 1 to divider-1 clk_i cycles; 0 acts as 1.
use_clk_div_iinputlogicSelects the divided clock when high.
test_en_iinputlogicTest mode; selects scan_rst_ni as the internal reset.
scan_rst_niinputlogicDFT scan reset, active-low.
clk_ooutputlogicDivided or bypassed clock.