TDEB Top Bar

Trending
Semiconductor Industry News — The Digital Electronics Blog
Follow Us

TDEB Masthead

The Semiconductor Hub

Semiconductors.  Chips and Systems.  Innovation.

Indexed by leading Search Engines, AI and referenced by Engineers worldwide 500+ Articles 10M+ Pageviews 30+ Reports 50+ Citations

Reading Real Reports, Part 7: Reading an SDC File as a Reviewer, from create_clock to set_false_path

The Semiconductor Hub
by
0
Share Facebook X LinkedIn WhatsApp Email
Lines from an illustrative SDC constraints file: clock definition, propagated clocks, clock latency, clock groups and two false path exceptions.

Every timing report in this series so far has depended on one file most people never read line by line: the SDC. It decides which clocks exist, how much of each period belongs to the outside world, and which paths the timer should ignore. A wrong number in a report is usually visible. A wrong line in the SDC makes the report quietly answer a different question.

This is Part 7 of Reading Real Reports. Today we read a short constraints file the way a reviewer does: in a fixed order, asking of each line what it adds, what it removes and who agreed to it. We finish with the arithmetic each line implies and a list of the lines this sample should not pass with.

Key takeaways

  • Read an SDC in layers: units and clocks, then clock attributes, then I/O budgets, then exceptions. Each layer depends on the one before.
  • Every exception removes checking. Count them, and ask for a reason for each one.
  • Order matters. A later line can undo an earlier one, as with clock latency after propagated clocks.
  • Wildcards and broad commands such as all_inputs sweep in pins the author may not have thought about.
  • Check what the tool actually holds, not only what the file says, by writing the constraints back out.

In this post

What an SDC file is

SDC (Synopsys Design Constraints) is a set of Tcl commands that describe timing requirements. The UC Santa Cruz constraints tutorial calls it the industry-standard way to specify STA constraints, read by commercial synthesis and timing tools as well as OpenROAD (STA Timing Constraints). The same file usually travels from synthesis through placement and routing to sign-off, picking up edits along the way.

A useful way to think about it: the netlist says what is connected, the libraries say how fast each cell is, and the SDC says what "fast enough" means. If the SDC is wrong, every slack number is an answer to the wrong question.

When you review one

At every hand-off: from RTL to synthesis, from synthesis to physical design, and before sign-off. Also whenever a timing report changes more than the design did. In OpenSTA, read_sdc with -echo prints each command as it is evaluated, and write_sdc writes the constraints the tool holds back to a file. Comparing that output with the source file is a fast way to catch lines that did not do what their author expected.

The reviewer's reading order

  1. Units and clocks. What time unit is in force, and does every clock have the right period, waveform and source pin? create_clock with no pins makes a virtual clock, which is normal for I/O budgets and wrong anywhere else.
  2. Generated clocks. Each create_generated_clock needs a -source pin that its master clock really reaches.
  3. Clock attributes. Latency, uncertainty and propagation, per clock, for this stage of the flow.
  4. I/O budgets. Input and output delays, driving cells and loads. Who agreed each number?
  5. Exceptions. Clock groups, false paths, multicycle paths, case analysis. Each one switches off checking somewhere.
  6. The tool's view. Run check_setup (Part 6) and write_sdc, and compare.

Common traps

  • Exceptions as fixes. The UC Santa Cruz tutorial warns that an incorrectly placed exception hides a real violation (Timing Exceptions).
  • One-way false paths. set_false_path -from A -to B says nothing about paths from B to A.
  • Commands the tool ignores. The OpenSTA reference lists some commands as parsed but ignored, such as set_ideal_network. A line that works in one tool may do nothing in another.
  • Copy and paste between modes. A functional SDC with set_case_analysis on a test pin is not a test-mode SDC.

Deep dive: the numbers and details

This part holds a sample SDC, a reading of each block, the arithmetic behind its numbers and the checklists. Skip it if the overview is all you need.

The illustrative sample

The file below is an illustrative sample SDC in the style used with OpenSTA/OpenROAD, written for this post. Its I/O budget pattern, a virtual I/O clock with delays set as a share of the period, follows the public OpenROAD-flow-scripts example gcd constraint.sdc. Names and numbers are invented, and several lines contain deliberate review problems. Time unit is nanoseconds.

# top.sdc (post-CTS, functional mode)
current_design top

set clk_period 2.00
set io_pct     0.20

create_clock -name core_clk -period $clk_period [get_ports clk]
create_clock -name vclk_io  -period $clk_period
create_generated_clock -name clk_div2 -source [get_ports clk] \
    -divide_by 2 [get_pins u_clkgen/div_reg/Q]
create_clock -name uart_clk -period 20.83 [get_ports uart_clk]

set_propagated_clock [all_clocks]
set_clock_latency 0.30 [get_clocks core_clk]
set_clock_uncertainty -setup 0.10 [get_clocks core_clk]
set_clock_uncertainty -hold  0.03 [get_clocks core_clk]

set_input_delay  [expr $clk_period * $io_pct] -clock vclk_io [all_inputs -no_clocks]
set_output_delay [expr $clk_period * $io_pct] -clock vclk_io [all_outputs]
set_driving_cell -lib_cell BUF_X2 -pin Z [all_inputs -no_clocks]
set_load 0.010 [all_outputs]

set_clock_groups -asynchronous -group {core_clk clk_div2 vclk_io} -group {uart_clk}

set_case_analysis 0 [get_ports test_mode]
set_false_path -from [get_ports rst_n]
set_false_path -to [get_ports dbg_out*]
set_false_path -from [get_clocks core_clk] -to [get_clocks clk_div2]
set_multicycle_path 2 -setup -from [get_pins u_mac/a_reg*/CK] -to [get_pins u_mac/acc_reg*/D]

Line-by-line walk-through

Variables. clk_period and io_pct keep the budget in one place, which is good practice. A reviewer still writes down the numbers they produce, because a later script may change them.

Clocks. core_clk sits on a real port. vclk_io has no pins, so per the create_clock reference it is virtual and exists only for input and output delays. Neither has a -waveform, so each rises at zero and falls at half the period. uart_clk is a second real clock on its own port.

Generated clock. clk_div2 divides the clock on port clk by two at the divider's Q pin. The reference describes the result for a power-of-two divisor: the period is multiplied by the divisor, the rise time matches the source clock, and the fall comes half a period later.

Propagation, then latency. set_propagated_clock [all_clocks] turns on real tree delays. The next line, set_clock_latency 0.30 on core_clk, is the first problem. The set_clock_latency reference says it describes clock tree delay for ideal clocks and removes the propagated property from the clocks it names. Read in this order, core_clk ends up ideal with 0.30 ns of latency everywhere. If 0.30 ns was meant as off-block insertion delay, the line needs -source.

Uncertainty. Separate setup and hold values on core_clk, as set_clock_uncertainty allows. clk_div2 and uart_clk get none in this file. That may be deliberate; the reviewer asks.

I/O budget. 20 percent of the period on each side, against the virtual clock. all_inputs with -no_clocks excludes clock ports but still includes rst_n, test_mode and any UART data pin. Each of them gets the same 0.40 ns budget whether that is true or not. set_driving_cell and set_load model the outside driver and load; the reviewer checks the load against the real board or package.

Clock groups. set_clock_groups -asynchronous puts uart_clk in its own group. Per the reference, clocks in different groups do not interact and paths between them are not reported. That is right only if every crossing has a synchronizer, which is a question for the CDC report, not the timer.

Case analysis. test_mode tied to 0. Paths are not propagated from constant pins, so everything that only matters in test mode disappears from this run. A separate test-mode SDC must exist.

False path from rst_n. The UC Santa Cruz tutorial lists asynchronous reset assertion as a common false path. The reviewer asks whether the reset is synchronized inside the chip. If it is not, this line also removes the recovery and removal checks that protect reset release.

False path to dbg_out*. A wildcard that cancels the output delays set three blocks earlier. It also removes these ports from the unconstrained warnings in Part 6, so the problem no longer shows up anywhere. It needs a written reason or removal.

False path from core_clk to clk_div2. The second serious problem. clk_div2 is derived from the same source, so the two clocks have a fixed relationship. The UC Santa Cruz tutorial notes that STA analyzes paths between a clock and its divided clock correctly once the relationship is described (RTL clock divider). This line throws that analysis away in one direction, and leaves the other direction, clk_div2 to core_clk, still timed. It also contradicts the clock group above, which places both clocks in the same group, the group of clocks meant to be timed together.

Multicycle path. set_multicycle_path 2 -setup with no matching -hold line. Whether the hold check lands where the designer intended is the subject of Part 8.

Worked arithmetic check

Clock numbers.

core_clk : period 2.00 ns, rise 0.00, fall 1.00     -> 500 MHz
clk_div2 : period 2.00 x 2 = 4.00 ns, rise 0.00, fall 2.00  -> 250 MHz
uart_clk : period 20.83 ns                           -> 1 / 20.83 ns = 48.0 MHz

I/O budget.

input delay  = 2.00 x 0.20 = 0.40
output delay = 2.00 x 0.20 = 0.40
input port to first flop, setup : 2.00 - 0.40 - 0.10 (uncertainty) = 1.50 ns, before library setup time
port to port feedthrough        : 2.00 - 0.40 - 0.40 - 0.10        = 1.10 ns

If the real outside world needs 0.70 ns on the input side, the input-to-flop budget drops from 1.50 to 1.20 ns. The SDC number is a contract, and a reviewer asks who signed it.

The latency line. With core_clk ideal at 0.30 ns, launch and capture flops both see 0.30 ns, so flop-to-flop skew is exactly zero. In the Part 4 sample, the real tree had the capture clock 0.06 ns early on a critical path. That 0.06 ns would vanish from every report, and a path with 0.04 ns of reported slack would really fail by 0.02 ns.

The multicycle line. With a setup multiplier of 2, the setup check moves from the edge at 2.00 ns to the edge at 4.00 ns, giving these paths two periods.

Exception count. One clock group, one case analysis, three false paths and one multicycle path: six lines that switch off or relax checking. Of the six, the reviewer would sign off two as written (case analysis, with a test-mode SDC to match, and the clock group, pending the CDC report), question two (reset and multicycle), and reject two (the debug wildcard and the divided-clock false path).

Red flags table

What you seeWhy it mattersWhat to ask
set_clock_latency after set_propagated_clockThe clock can become ideal againWas -source intended?
False path between related clocksReal synchronous paths are droppedWhy is this crossing not timed, and what about the reverse direction?
Wildcard in an exceptionIt may match more pins than intendedWhat does it match today, and after the next netlist change?
all_inputs budget with no exceptions per portResets and test pins get data budgetsWhich ports need their own numbers?
Clock with no uncertaintyNo jitter margin for that domainIs that deliberate for this stage?
Exception with no commentNobody can review it laterWho added it, when and why? (-comment is accepted.)

Sign-off checklist

  • Time unit confirmed with report_units before reading any number.
  • Every clock listed with period, waveform, source pin and owner.
  • Every generated clock's source pin confirmed on the master clock's path.
  • Clock attributes checked in file order, with no later line undoing an earlier one.
  • Every port's input or output delay traced to an agreed budget.
  • Every exception counted, commented and signed off by name.
  • write_sdc output compared with the source file.
  • check_setup -verbose clean, or each warning explained.

Next in the series: Auditing Multicycle and False Path Exceptions in a Timing Report.

Share Facebook X LinkedIn WhatsApp Email

Post a Comment

0 Comments

Your comments will be moderated before it appears here.

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn more
Ok, Go it!