S5.1.2 Wait for Lock

MediumFix20 minIcarus Verilog · serverReview the topic

Repair a boot guard that grants a fast clock after a broken streak of good lock samples.

Hardware context: ap_soc boot clock tree. Bring-up of a clock controller

The PLL toggles throughout startup. The sequencer on the always-running clock qualifies its synchronized status before asking a separate mux to switch.

Signals in the Timeline

SignalWidthRole
dut_use_pll1stimulus, the same for every design
Full specification

On the third consecutive rising edge with request and lock_ok both high, assert use_pll. Keep it high on further good edges.

A rising edge with either input low clears the grant and the entire streak. Active-low asynchronous reset clears both immediately.

Examples

Example 1

Reset Asserted
Input
Reset asserted
Output
use_pll = 0

Reset clears permission.

Example 2

First Qualified Edge
Input
First qualified edge
Output
use_pll = 0

A single good sample starts the streak.

Example 3

Second Qualified Edge
Input
Second qualified edge
Output
use_pll = 0

The guard still owes one sample.

Example 4

Third Qualified Edge
Input
Third qualified edge
Output
use_pll = 1

Three consecutive samples grant the request.

Constraints and Contract

  • Between rising edges hold the registered result, except during reset. All inputs are binary. lock_ok and request already belong to clk.

Hints

Hint 1

Start a new streak at each interruption.

Hint 2

Check the sample before and after the boundary.

Hint 3

Separate an ordinary sampled loss from an asynchronous reset.

What the grader checks: Tests cover interrupted and sustained streaks, both input qualifiers, clock edges and asynchronous reset.

92 checks on Icarus Verilog · server. Run the examples first, then check the full regression. Full checks use the server judge. Downloads contain your source only; samples require the simulation service. A passing result establishes the tested cases, not a proof for all possible inputs.

See all 2 problems on this path

Report a problem with this page

Your code SystemVerilogSaved locally
Ln 1, Col 1Tab indents · Ctrl/⌘ + Enter runs samples
Not run yet

Reset Asserted

Input
Reset asserted
Expected output
use_pll = 0

Reset clears permission.

Run samples executes all 4 public checks. Check all tests runs 92 checks on the server.

Icarus Verilog · server