Skip to content

Commit a55161a

Browse files
committed
odb: dbNet::getFirstOutput don't skip clocked OUTPUTs (clock-net driver)
dbNet::getFirstOutput() unconditionally skipped iterms with isClocked() == true. isClocked() returns true when the iterm's MTerm has SigType::CLOCK, which is the correct flag for INPUT clock-sinks (flop CLK pins) but ALSO for OUTPUT clock-source pins like a macro's clock-output (liberty `direction: output; clock: true;`) or a clock-buffer output. The unconditional skip drops the actual driver of any clock net whose source pin is tagged `clock: true`, leaving the function with no candidate and returning nullptr. Concrete downstream effect (cts/src/TritonCTS.cpp): the nullptr falls into the bterm branch, hits a second nullptr if there's no top-level bterm (the clock is driven by a macro pin), and emits [INFO CTS-0122] Clock net "<net>" is skipped for CTS because it is not connected to any output instance pin or input block terminal. even though the net IS driven by an OUTPUT instance pin -- just one that happens to be tagged as a clock source. The whole clock then goes unbuffered (no tree built), so every flop on that domain ends up distributed only by placement + routing's natural wire delay. Fix: drop the isClocked() skip entirely. The existing `getIoType() != dbIoType::OUTPUT` continue immediately below already filters clock sinks (they are INPUT pins), so the isClocked() skip was redundant for sinks and actively wrong for the legitimate clock-source OUTPUT. isClocked() is true for both ends of a clock net; only direction distinguishes source from sink. Verified on a design with the main system clock sourced from a blackbox PCIe hard-IP macro's `clock:true` output pin (~12k flops): without the fix, CTS-0122 fires and no tree is built (resulting in ~9 ns of naked wire-delay clock skew and several thousand hold violations). With the fix, TritonCTS recognizes the driver, builds a balanced clock tree (~12k register sinks + a smaller macro subnet), and CTS finishes normally. Related minimal reproducer (~50 lines of Verilog/LEF/LIB/SDC): a top with one flop clocked by a blackbox macro instance whose liberty declares `direction: output; clock: true;` on the macro's clock-out pin, with `create_clock` placed on the macro pin. Signed-off-by: mrg <mrg@ucsc.edu>
1 parent 53ec684 commit a55161a

1 file changed

Lines changed: 0 additions & 4 deletions

File tree

src/odb/src/db/dbNet.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,10 +1264,6 @@ dbITerm* dbNet::getFirstOutput() const
12641264
continue;
12651265
}
12661266

1267-
if (tr->isClocked()) {
1268-
continue;
1269-
}
1270-
12711267
if (tr->getIoType() != dbIoType::OUTPUT) {
12721268
continue;
12731269
}

0 commit comments

Comments
 (0)