S5.10.1 Read a Clock Switch

EasyImplement12 minIcarus Verilog · serverReview the topic

Read one switch from the RC clock to a PLL clock, event by event: find the cut pulse, the two grants and the pause.

Hardware context: Two clock muxes of ap_soc, an ordinary one and a glitch-free one, under one request. Reading a clock switch on a logic analyser during bring-up

This list of events comes from the two muxes of lesson S5.10, with another PLL and a request at another moment. An ordinary mux and a glitch-free mux get the same two clocks and the same request. Before the request both pass the RC clock. After the request the ordinary mux passes the PLL clock.

This worksheet uses named constants. The first three entries show how to record your decisions.

Signals in the Timeline

SignalWidthRole
question8input of each check
Full specification
Time in nsEvent
60The RC clock rises
60The ordinary mux output rises
60The glitch-free mux output rises
73The request changes from RC to PLL
73The ordinary mux output falls
77The ordinary mux output rises
80The RC clock falls
80The glitch-free mux output falls
84The ordinary mux output falls
91The ordinary mux output rises
98The ordinary mux output falls
100The RC clock rises
100The glitch-free mux output rises
105The ordinary mux output rises
112The ordinary mux output falls
119The ordinary mux output rises
120The RC clock falls
120The glitch-free mux output falls
120The RC grant goes off
126The ordinary mux output falls
133The ordinary mux output rises
140The RC clock rises
140The ordinary mux output falls
140The PLL grant comes on
147The ordinary mux output rises
147The glitch-free mux output rises
154The ordinary mux output falls
154The glitch-free mux output falls
160The RC clock falls
161The ordinary mux output rises
161The glitch-free mux output rises
168The ordinary mux output falls

Every change of a listed signal between 55 ns and 168 ns is in the list. Events at one time are listed in no special order. Enter every answer as a plain number: times and widths in nanoseconds.

EntryYour decision
RC_PERIODPeriod of the RC clock.
REQUEST_TIMETime at which the request changes.
PLL_PERIODPeriod of the PLL clock.
CUT_WIDTHWidth of the high pulse that the ordinary mux was passing when the request came.
WHOLE_WIDTHWidth of the same pulse at the output of the glitch-free mux.
LOSTHow much shorter the cut pulse is than the whole one.
OLD_EDGESNumber of falling edges of the RC clock from the request to the moment the RC grant goes off, that edge included.
OLD_OFFTime at which the RC grant goes off.
NEW_ONTime at which the PLL grant comes on.
FIRST_RISETime of the first rising edge of the PLL clock at the output of the glitch-free mux.
PAUSEHow long the output of the glitch-free mux stays low during the switch.
NEW_HIGHWidth of the first high pulse after the switch, at the output of the glitch-free mux.
OFF_AFTER_NSuppose this mux waited for N falling edges of the RC clock after the request, in place of 2. At what time, in ns, would the RC grant go off?

Examples

Example 1

RC PERIOD
Input
Period of the RC clock.
Output
matches = 1

The RC clock rises at 60 and at 100 ns. The difference is 40.

Example 2

REQUEST TIME
Input
Time at which the request changes.
Output
matches = 1

The list has "The request changes from RC to PLL" at 73.

Example 3

PLL PERIOD
Input
Period of the PLL clock.
Output
matches = 1

After the request the ordinary mux passes the PLL clock. Its output rises at 77 and at 91: 14 apart.

Constraints and Contract

  • Keep the parameter and named constants. Use the numeric codes and units on this page.
  • For OFF_AFTER_N, enter a constant expression using N. Only this entry changes with the parameter. The supported integer range is 1 through 5, inclusive.

Hints

Hint 1

Two rising edges of one clock give its period. After the request the ordinary mux shows the PLL clock.

Hint 2

Follow each mux output from its rise at 60 ns to its next fall.

Hint 3

The old grant goes off first. The new grant comes on later. The glitch-free output is low in between.

What the grader checks: Each check compares the full eight-bit answer. Parameter trials change one condition and keep the other decisions fixed.

13 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 1 problem 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

RC PERIOD

Input
Period of the RC clock.
Expected output
matches = 1

The RC clock rises at 60 and at 100 ns. The difference is 40.

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

Icarus Verilog · server