Games / Command flash cards / OpenROAD flow commands / Optimization and repair

Optimization and repair

The cards come in more than one shape: a command to explain, and steps to put in order. A missed card returns later in the round and starts the schedule over. A card answered correctly moves up the schedule and next appears after 1, 3, 7, then 21 days. Keys 1 to 4 choose an option, h shows a hint, and Enter moves on. A hint keeps the card where it is on the schedule. An ordering card is answered by clicking its items in order, and one wrong click ends it. Time values are in nanoseconds. Progress is stored in this browser.

SourceThese cards follow OpenROAD's own commands, checked against the signatures printed by the tool (OpenROAD 26Q3) and the documentation of the module that implements each one. Each answer links to that module's documentation. Commands differ between versions, and commercial tools use different names entirely. Reference: OpenROAD module documentation (OpenROAD on GitHub).
All 15 cards in this section, with answers
  • repair_design
    Buffers nets and resizes gates to fix the design-rule violations.

    Hint: It is about design rules, not about slack.

    The violations are slew, capacitance, fanout, and long wires: too slow a transition, too much load, too many loads, or too long a wire. Run estimate_parasitics -placement first, so the repair sees wire load. Timing repair is a separate command. OpenROAD reference

  • repair_design -slew_margin 20 -cap_margin 20
    Repairs to limits 20% tighter than the real ones, leaving margin.

    Hint: Ask why you would repair to a stricter limit than the real one.

    Before routing, parasitics are estimated from placement and are optimistic; the real wires are worse. Repairing against a tighter limit buys margin so the design still passes once it is routed. OpenROAD reference

  • repair_design -max_wire_length 100
    Also splits any wire longer than 100 microns by inserting buffers.

    Hint: A long wire has resistance as well as capacitance. Ask what buffers do to its delay.

    A wire's delay grows with the square of its length, so splitting it with buffers turns one long quadratic segment into several short ones. The default limit is the length that minimizes wire delay for the values given to set_wire_rc. OpenROAD reference

  • repair_timing -setup -setup_margin 0.05
    Fixes setup violations and keeps going until 0.05 ns of slack is left.

    Hint: Ask what the margin is for, given that zero slack already passes.

    Repair works by sizing gates, inserting buffers, cloning gates, and swapping pins. The margin leaves headroom for what later steps add, since routing and extraction usually make timing a little worse. OpenROAD reference

  • repair_timing -hold -hold_margin 0.02
    Fixes hold violations by adding delay, keeping 0.02 ns of margin.

    Hint: A hold violation means data arrives too early. Ask what fixes that.

    Delay is added with buffers on the fast paths. Setup is repaired before hold, so hold repair does not undo it, and hold repair refuses to insert a buffer that would break setup unless -allow_setup_violations is given. Run it after clock tree synthesis, with propagated clocks. OpenROAD reference

  • repair_timing -recover_power 20
    Downsizes gates on the 20% of paths that have the most slack.

    Hint: A path with plenty of slack is paying for speed it does not need.

    Slack is money left on the table: a smaller cell is slower but leaks less and presents less load. Recovering power gives it back on the paths that can afford it, without touching the critical ones. OpenROAD reference

  • set_dont_use {CLKBUF_* AOI211_X1}
    Keeps optimization from choosing those library cells at all.

    Hint: It names library cells, not instances of them.

    Sizing and buffering will not pick them. Clock buffers are excluded from data-path use, and cells known to behave badly are excluded outright. report_dont_use lists the excluded cells and reset_dont_use clears the list. Protecting a specific instance is set_dont_touch instead. OpenROAD reference

  • set_dont_touch u_clkgate
    Protects that instance from being resized, buffered, or removed.

    Hint: Compare it with set_dont_use: one names a library cell, the other an object in the design.

    It applies to instances and nets in the design, for logic that must survive exactly as it is, such as a synchronizer or a cell a later step depends on. It concerns optimization, not placement or routing. OpenROAD reference

  • buffer_ports -inputs
    Inserts a buffer just inside every input port of the block.

    Hint: Ask what the block knows about what lies outside it.

    A buffer at the boundary isolates the inside of the block from whatever drives it, so one weak external driver cannot slow a whole cone of logic. -outputs does the same for outputs, where the buffer takes the external load. OpenROAD reference

  • remove_buffers
    Removes the netlist's buffers so later steps insert their own.

    Hint: It is usually the first thing a placement-aware repair flow does.

    Repair and clock tree synthesis insert their own. Synthesis buffers a netlist without knowing where anything will be placed, so its buffers are guesses. Removing them lets repair rebuild with real distances. Instances marked set_dont_touch are kept. OpenROAD reference

  • repair_tie_fanout -separation 2 LOGIC0_X1/Z
    Gives each constant load its own copy of the tie cell, 2 microns away.

    Hint: A tie cell holds a net at a constant. Ask why its loads should not be shared.

    A shared tie cell would drive a long, high-fanout net held at a constant, which is fragile and wastes area. A copy beside each load keeps the net tiny. The separation keeps the copy off its load's own pin. OpenROAD reference

  • eliminate_dead_logic
    Removes logic whose output reaches no port and no register.

    Hint: Ask which logic can be removed without changing what the block does.

    Logic that drives nothing costs area, leakage, and routing while affecting nothing. It appears after other transformations, so the pass is run late rather than trusted to synthesis alone. OpenROAD reference

  • insert_buffer -buffer_cell BUF_X4 -net n42 -location {100 200}
    Inserts one buffer of that cell on net n42, at the given point.

    Hint: Every other repair command decides for itself where buffers go.

    It is the manual escape hatch, for a net that repair keeps getting wrong or an experiment. -load_pins chooses which loads move behind the new buffer, so the net can be split deliberately. OpenROAD reference

  • set_opt_config -limit_sizing_area 1.2
    Limits what later repair commands may do, here the area sizing may add.

    Hint: It changes nothing by itself. Ask what obeys it afterwards.

    The repair commands would otherwise trade as much area, leakage, or site change as they need. The configuration bounds them, with limits on sizing area and leakage and flags to keep the site or the threshold voltage. report_opt_config prints it and reset_opt_config clears it. OpenROAD reference

  • Put these repairs in the order the flow performs them.
    1. repair_design
    2. repair_timing -setup
    3. repair_timing -hold
    4. detailed_placement

    Hint: One of them adds delay, so it cannot go first; one of them cleans up after the rest.

    Design rules are fixed first, since a pin over its transition limit makes every timing number unreliable. Setup comes before hold, because hold fixes add delay and would otherwise be undone. Everything here inserts and resizes cells, so the row has to be legalized afterwards. OpenROAD reference