Commit a55161a
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
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1264 | 1264 | | |
1265 | 1265 | | |
1266 | 1266 | | |
1267 | | - | |
1268 | | - | |
1269 | | - | |
1270 | | - | |
1271 | 1267 | | |
1272 | 1268 | | |
1273 | 1269 | | |
| |||
0 commit comments