S5.3.2 Constrain the Divided Clock

MediumImplement22 minOpenROAD · serverReview the topic

Time a peripheral divider whose input clock has a short high phase. Preserve its parent edge and real clock latency.

Hardware context: ap_soc timer crossing. Clock planning for peripherals

For this ap_crg design exercise, the supplied div2n netlist is the clock slice. H rises at 0 ns, falls at 3 ns and repeats every 8 ns. The falling-edge flop div toggles on each falling edge. Its Q clocks fb. Use the mode where Q first rises on the first falling edge of H. Data travels from fa through fb and back to fc.

Finish the SDC so each crossing uses the actual launching and capturing edges in both directions.

Requirements

RequirementLimitUnit
Unclocked register pinssame as the referencecount
Clock countsame as the referencecount
Shortest periodsame as the referencens
Longest periodsame as the referencens
Clock relationshipssame as the referencecount
Clock path latencysame as the referencecount
fast rise edgesame as the referencens
fast fall edgesame as the referencens
slow rise edgesame as the referencens
slow fall edgesame as the referencens
fb setupsame as the reference ± 0.001ns
fb holdsame as the reference ± 0.001ns
fc setupsame as the reference ± 0.001ns
fc holdsame as the reference ± 0.001ns

Live analysis: OpenSTA, SKY130 timing cells, propagated clocks. No wire parasitics.

The Netlist

Bundled design div2n. Submit also times your SDC on 1 hidden variant 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
period_minShortest clock period, ns
period_maxLongest clock period, ns
generated_countGenerated clocks in the clock report
ideal_pathsReported clock-to-clock paths with ideal launch or capture latency
fast_riseRising edge of shortest-period clock, ns
fast_fallFalling edge of shortest-period clock, ns
slow_riseRising edge of longest-period clock, ns
slow_fallFalling edge of longest-period clock, ns
fb_setupWorst setup slack at fb/D, ns
fb_holdWorst hold slack at fb/D, ns
fc_setupWorst setup slack at fc/D, ns
fc_holdWorst hold slack at fc/D, ns
Full specification

Define the two clocks, propagate both clock trees, and leave both directions timed. Use the shown waveform, including its duty cycle. For a generated waveform, -edges numbers successive master transitions from 1. Give the child’s rise, fall and next rise in order. Apply set_propagated_clock to clock objects after defining them. The feedback inverter and the divider clock-to-Q delay belong to the physical netlist.

Examples

Example 1

Master Only
Input
create_clock -name H -period 8 -waveform {0 3} [get_ports clk]
Output
clocks = 1

Only the input waveform has a clock definition.

Example 2

Two Independent Clocks
Input
create_clock -name H -period 8 -waveform {0 3} [get_ports clk]
create_clock -name P -period 16 [get_pins div/Q]
Output
longest = 16

The period looks right even when the parent relationship is missing.

Example 3

One Slower Master
Input
create_clock -name H -period 12 [get_ports clk]
Output
shortest = 12

Changing the oscillator changes the edge schedule for the whole slice.

Submission Rules

  • Submit SDC for the supplied netlist. The same SDC must work across library corners. Input and output delays are outside this exercise.

Hints

Hint 1

Trace the active edge of the cell that makes P.

Hint 2

Number rising and falling master edges in order.

Hint 3

Check the return crossing as well as the forward one.

What is checked: Clock waveforms, parentage, propagation and both directions of setup and hold must match on every netlist and corner.

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