Skip to content

set_disable_clock_gating_check#49

Merged
akashlevy merged 1 commit intomainfrom
set_disable_clock_gating_check
Apr 26, 2026
Merged

set_disable_clock_gating_check#49
akashlevy merged 1 commit intomainfrom
set_disable_clock_gating_check

Conversation

@akashlevy
Copy link
Copy Markdown

No description provided.

@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Apr 26, 2026

Greptile Summary

This PR implements set_disable_clock_gating_check as a proper SDC command (previously only the internal alias set_disable_inferred_clock_gating existed) and extends it to support liberty-cell objects in addition to instances and pins. The old name is retained as a backward-compatible alias. write_sdc serialization is also added for all three object types via the new writeDisabledClockGatingChecks() helper, and the instance-level query now inherits the cell-level disable correctly.

Confidence Score: 4/5

Safe to merge; only P2 style/robustness issues found, no logic or security bugs.

All findings are P2: non-deterministic sort order for same-named cells across libraries in write_sdc, and missing explanatory comments on two complex code blocks per the team's documentation rule. No P0 or P1 issues identified.

sdc/WriteSdc.cc — lib-cell sort comparator and missing comments on writeDisabledClockGatingChecks.

Important Files Changed

Filename Overview
sdc/WriteSdc.cc Adds writeDisabledClockGatingChecks() to serialize lib-cell, instance, and pin clock gating check disables; lib-cell sort uses only cell name, which could be non-deterministic for same-named cells across libraries.
sdc/Sdc.cc Adds LibertyCell-level disable support: insert/erase/query for lib-cell set, and instance check now also queries cell set for inherited disable.
search/Search.tcl Renames set_disable_inferred_clock_gating to set_disable_clock_gating_check; old name kept as a backward-compatible alias delegating to the new implementation; adds lib-cell and port handling.
include/sta/Sdc.hh Declares new LibertyCell-overloaded disable/remove/query methods and adds the disabled_clk_gating_checks_lib_cell_ set member along with three new accessor methods.
search/Sta.cc Forwards LibertyCell overloads of disableClockGatingCheck/removeDisableClockGatingCheck to sdc_ and invalidates endpoints.
sdc/Sdc.i Adds SWIG bindings for disable_clock_gating_check_lib_cell and unset_disable_clock_gating_check_lib_cell, mirroring the existing inst/pin bindings.
sdc/WriteSdcPvt.hh Adds declaration for the new writeDisabledClockGatingChecks() method.
test/disable_clock_gating_check.tcl New regression test covering lib-cell, instance, pin, port, mixed, back-compat alias, and write_sdc round-trip for the new command.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A["set_disable_clock_gating_check {objects}"] --> B{Object type}
    B -->|get_lib_cells| C["disable_clock_gating_check_lib_cell(cell)\n→ Sdc::disabled_clk_gating_checks_lib_cell_"]
    B -->|get_cells| D["disable_clock_gating_check_inst(inst)\n→ Sdc::disabled_clk_gating_checks_inst_"]
    B -->|get_pins| E["disable_clock_gating_check_pin(pin)\n→ Sdc::disabled_clk_gating_checks_pin_"]
    B -->|get_ports| F["disable_clock_gating_check_pin(get_port_pin)\n→ Sdc::disabled_clk_gating_checks_pin_"]
    G["GatedClk::isGatedClkEnable / gatedClkEnables"] --> H["isDisableClockGatingCheck(pin)"]
    G --> I["isDisableClockGatingCheck(inst)"]
    I --> J{inst in disabled_inst set?}
    J -->|yes| K[return true]
    J -->|no| L["network_->libertyCell(inst)"]
    L --> M{cell in disabled_cell set?}
    M -->|yes| K
    M -->|no| N[return false]
    O["write_sdc → writeDisabledClockGatingChecks()"] --> P["Write set_disable_clock_gating_check\nfor lib cells / instances / pins"]
Loading

Reviews (1): Last reviewed commit: "set_disable_clock_gating_check" | Re-trigger Greptile

Comment thread sdc/WriteSdc.cc
Comment thread sdc/WriteSdc.cc
Comment thread sdc/Sdc.cc
@akashlevy akashlevy merged commit 683ec16 into main Apr 26, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant