T4.2.1 Declare the Divided Clock

MediumImplement25 minOpenROAD · serverReview the topic

Declare the clock made by a falling-edge divider, so every register is clocked and the crossings pair the right edges.

Hardware context: Clock divider flop whose output clocks a second register. Declare the divided clock so both crossings are timed against the master edge.

The block div2n runs on a 2 ns clock at port clk. Flop div is a falling-edge flop (dfrtn_1) that toggles on every falling edge of clk. Its output div/Q is therefore clk divided by two, and it clocks flop fb. Data crosses from fa (clk) to fb (divided) and back to fc (clk).

The starter SDC defines the master clock and propagated clocks but not the divided clock, so fb is unclocked. Complete it so the divided clock's edges fall where the circuit really makes them. The divider's clock-to-Q delay is real latency of the divided clock; keep the clocks propagated.

Requirements

RequirementLimitUnit
Register clock pins with no clock= 0count
Clocks defined= 2count
Setup slack into fb/D (clk to divided clock)same as the reference ± 0.001ns
Hold slack into fb/D (clk to divided clock)same as the reference ± 0.001ns
Setup slack into fc/D (divided clock to clk)same as the reference ± 0.001ns
Hold slack into fc/D (divided clock to clk)same as the reference ± 0.001ns
Longest clock period (the divided clock)same as the reference ± 0.0001ns

Live analysis: Live OpenSTA at tt_025C_1v80 with propagated clocks and no wire parasitics. Only the clock definitions are graded; input and output delays are outside this exercise. The crossing slacks must equal the reference, so any extra constraint that moves them, such as clock uncertainty, fails the match.

The Netlist

Bundled design div2n. Submit also times your SDC on 3 hidden variants with the same instance and port names.

// div2n: a toggle flop on the FALLING edge of clk divides it by two; its Q clocks fb. Data crosses from fa (clk, rising)
// to fb (divided clock) and back to fc (clk, rising). Lesson T4.2 uses div2, whose divider toggles on the rising edge.
module div2n (clk, d, q);
  input clk; input d; output q;
  wire one, dclk, dn, a, b, bn;
  sky130_fd_sc_hd__conb_1 tie (.HI(one));
  sky130_fd_sc_hd__dfrtn_1 div (.CLK_N(clk), .D(dn), .RESET_B(one), .Q(dclk));
  sky130_fd_sc_hd__inv_1 ud (.A(dclk), .Y(dn));
  sky130_fd_sc_hd__dfxtp_1 fa (.CLK(clk), .D(d), .Q(a));
  sky130_fd_sc_hd__dfxtp_1 fb (.CLK(dclk), .D(a), .Q(b));
  sky130_fd_sc_hd__inv_1 ub (.A(b), .Y(bn));
  sky130_fd_sc_hd__dfxtp_1 fc (.CLK(clk), .D(bn), .Q(q));
endmodule
Graded numberMeaning
unclockedRegister clock pins with no clock (check_setup)
clocksClocks defined
cross_setupWorst setup slack at fb/D, ns
cross_holdWorst hold slack at fb/D, ns
back_setupWorst setup slack at fc/D, ns
back_holdWorst hold slack at fc/D, ns
period_maxLongest clock period, ns
Full specification
Graded resultWhat it reads
Register clock pins with no clockunclocked = 0
Clocks definedclocks = 2
Setup slack into fb/D (clk to divided clock)cross_setup: same as the reference ± 0.001 on every netlist
Hold slack into fb/D (clk to divided clock)cross_hold: same as the reference ± 0.001 on every netlist
Setup slack into fc/D (divided clock to clk)back_setup: same as the reference ± 0.001 on every netlist
Hold slack into fc/D (divided clock to clk)back_hold: same as the reference ± 0.001 on every netlist
Longest clock period (the divided clock)period_max: same as the reference ± 0.0001 on every netlist

Live OpenSTA at tt_025C_1v80 with propagated clocks and no wire parasitics. Only the clock definitions are graded; input and output delays are outside this exercise. The crossing slacks must equal the reference, so any extra constraint that moves them, such as clock uncertainty, fails the match.

Run times your SDC on the public netlist. Submit also times it on 3 hidden variants of the block and compares what OpenSTA reports.

Examples

Example 1

The Rising-Edge Habit
Input
The starter plus create_generated_clock -divide_by 2 on div/Q
Output
Register clock pins with no clock: 0
Clocks defined: 2
Setup slack into fb/D (clk to divided clock): 2.0075 ns
Hold slack into fb/D (clk to divided clock): -0.072 ns
Setup slack into fc/D (divided clock to clk): 1.188 ns
Hold slack into fc/D (divided clock to clk): 0.7331 ns
Longest clock period (the divided clock): 4 ns

The period is right, but the clock now rises on the rising edges of clk. That pairs the wrong edges: a false hold violation into fb, and 1 ns too much setup slack into fc.

Example 2

A Clock Created on the Divider Output
Input
The starter plus create_clock -name dclk -period 4.0 -waveform {1 3} [get_pins div/Q]
Output
Register clock pins with no clock: 0
Clocks defined: 2
Setup slack into fb/D (clk to divided clock): 0.6336 ns
Hold slack into fb/D (clk to divided clock): 1.3019 ns
Setup slack into fc/D (divided clock to clk): 0.5619 ns
Hold slack into fc/D (divided clock to clk): 1.3591 ns
Longest clock period (the divided clock): 4 ns

The edges are in the right place, but the new clock starts at div/Q with no latency. The crossing slacks therefore differ from the reference.

Example 3

Divided by Four
Input
The generated clock with -edges {2 6 10}
Output
Register clock pins with no clock: 0
Clocks defined: 2
Setup slack into fb/D (clk to divided clock): 1.0075 ns
Hold slack into fb/D (clk to divided clock): 0.928 ns
Setup slack into fc/D (divided clock to clk): 0.188 ns
Hold slack into fc/D (divided clock to clk): 1.7331 ns
Longest clock period (the divided clock): 8 ns

The closest edge pairs are the same, so all four crossing slacks look right. Only the clock period shows that this clock runs at half the real rate.

Submission Rules

  • Submit one SDC file for the supplied netlist. The commands and options are the ones Try it accepts; anything else is refused before the tool runs.
  • Run times your SDC on the public netlist. Submit also times it on 3 hidden variants with the same instance and port names. A variant may use other cell sizes, extra logic or another corner.
  • Grading reads the timing results: slack values, the endpoints and check types of the paths, and check_setup findings. The text of your SDC is never compared.

Hints

Hint 1

A clock that a register makes inside the design is a generated clock. Name its source pin and the master edges that make it.

Hint 2

Count the master edges from 1 at the first rising edge. Which numbered edges make div/Q rise and fall?

Hint 3

A create_clock on div/Q starts a new clock at that pin, with no divider delay. Do not tune a latency to match one netlist.

Hint 4

SDC runs line by line. set_propagated_clock [all_clocks] applies only to the clocks that exist when it runs, so define every clock above it.

What is checked: Live OpenSTA at tt_025C_1v80 with propagated clocks and no wire parasitics. Only the clock definitions are graded; input and output delays are outside this exercise. The crossing slacks must equal the reference, so any extra constraint that moves them, such as clock uncertainty, fails the match.

Run times your SDC on the public netlist. Submit times it on the public netlist and every hidden variant, beside the reference constraints. The fixed circuit and allowed settings use the pinned OpenROAD/OpenSTA engine.

More problems on this topic

Report a problem with this page

Your constraints SDCSaved locally
Ln 1, Col 1Ctrl/⌘ + Enter runs
Not run yet

Run your constraints on the public netlist to inspect the result.

OpenROAD · server