S5.9.2 The Sequencer FSM

MediumImplement24 minIcarus Verilog · serverReview the topic

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

SignalWidthRole
sample12input 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

Report a problem with this page

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

Supply Absent

Input
good=0
Expected output
enables = 0

All three enables clear.

Run samples executes all 3 public checks. Check all tests runs 1018 checks on the server.

Icarus Verilog · server