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
| Requirement | Limit | Unit |
|---|---|---|
| Unclocked register pins | same as the reference | count |
| Clock count | same as the reference | count |
| Shortest period | same as the reference | ns |
| Longest period | same as the reference | ns |
| Clock relationships | same as the reference | count |
| Clock path latency | same as the reference | count |
| fast rise edge | same as the reference | ns |
| fast fall edge | same as the reference | ns |
| slow rise edge | same as the reference | ns |
| slow fall edge | same as the reference | ns |
| fb setup | same as the reference ± 0.001 | ns |
| fb hold | same as the reference ± 0.001 | ns |
| fc setup | same as the reference ± 0.001 | ns |
| fc hold | same as the reference ± 0.001 | ns |
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 number | Meaning |
|---|---|
| unclocked | Register clock pins with no clock (check_setup) |
| clocks | Clocks defined |
| period_min | Shortest clock period, ns |
| period_max | Longest clock period, ns |
| generated_count | Generated clocks in the clock report |
| ideal_paths | Reported clock-to-clock paths with ideal launch or capture latency |
| fast_rise | Rising edge of shortest-period clock, ns |
| fast_fall | Falling edge of shortest-period clock, ns |
| slow_rise | Rising edge of longest-period clock, ns |
| slow_fall | Falling edge of longest-period clock, ns |
| fb_setup | Worst setup slack at fb/D, ns |
| fb_hold | Worst hold slack at fb/D, ns |
| fc_setup | Worst setup slack at fc/D, ns |
| fc_hold | Worst 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