Sequence two clock sources and a first request through a flickering lock indication and an unexpected loss of power.
Hardware context: ap_crg startup sequencer. Cold boot diagnosis on an MCU board
Implement a startup controller with clean digital ready inputs. enables[0] requests the oscillator, bit 1 requests the PLL and bit 2 releases the manager.
Signals in the Timeline
| Signal | Width | Role |
|---|---|---|
sample | 12 | input of each check |
Full specification
When good falls, immediately clear all enables and forget all progress. After good returns, advance only on rising clk edges.
The first edge enables only the oscillator. On a later edge with osc_ok high, enable the PLL too. Beginning on the following edge, require two consecutive high locked samples.
A low sample between the two restarts qualification. On a strictly later edge after qualification, release the manager if route_ok is high. Hold earlier enables throughout.
Once qualified, lock need not be sampled again. Once running, ignore readiness changes until good falls. Inputs may already be high when an earlier stage starts.
Examples
Example 1
Supply Absent- Input
good=0
- Output
enables = 0
All three enables clear.
Example 2
First Edge- Input
good=1, readiness low
- Output
enables = 1
Only the oscillator is requested.
Example 3
Early Lock- Input
osc_ok=0, locked=1, route_ok=1
- Output
enables = 1
Later indications cannot advance the oscillator stage.
Constraints and Contract
- Keep the release_chain ports. Enables must stay stable between rising edges except for loss of good. The grader observes outputs, so choose your own state encoding.
Hints
Hint 1
Write down which ready inputs can affect each state.
Hint 2
Distinguish the first high lock sample from a qualified lock.
Hint 3
Try removing good while clk is low.
What the grader checks: Every binary input combination is presented between edges and at an edge from each startup phase, followed by recovery.
1018 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