OpenROAD icon indicating copy to clipboard operation
OpenROAD copied to clipboard

SEGFAULT in CTS

Open oharboe opened this issue 1 year ago • 3 comments

Describe the bug

Running cts.tcl, stage 4_1_cts clock_tree_synthesis -sink_clustering_enable -balance_levels [INFO CTS-0050] Root buffer is BUFx24_ASAP7_75t_R. [INFO CTS-0051] Sink buffer is BUFx24_ASAP7_75t_R. [INFO CTS-0052] The following clock buffers will be used for CTS: BUFx24_ASAP7_75t_R [INFO CTS-0049] Characterization buffer is BUFx24_ASAP7_75t_R. [INFO CTS-0007] Net "clock" found for clock "clock". [INFO CTS-0011] Clock net "clock" for macros has 4 sinks. [INFO CTS-0011] Clock net "clock_regs" for registers has 40071 sinks. [INFO CTS-0008] TritonCTS found 2 clock nets. [INFO CTS-0097] Characterization used 1 buffer(s) types. [INFO CTS-0200] 4 placement blockages have been identified. [INFO CTS-0027] Generating H-Tree topology for net clock. [INFO CTS-0028] Total number of sinks: 4. [INFO CTS-0090] Sinks will be clustered based on buffer max cap. [INFO CTS-0030] Number of static layers: 0. [INFO CTS-0020] Wire segment unit: 1350 dbu (1 um). [INFO CTS-0023] Original sink region: [(172044, 815958), (748044, 815958)]. [INFO CTS-0024] Normalized sink region: [(127.44, 604.413), (554.107, 604.413)]. [INFO CTS-0025] Width: 426.6667. [INFO CTS-0026] Height: 0.0000. Level 1 Direction: Horizontal Sinks per sub-region: 2 Sub-region size: 213.3333 X 0.0000 [INFO CTS-0034] Segment length (rounded): 106. [INFO CTS-0032] Stop criterion found. Max number of sinks is 15. [INFO CTS-0035] Number of sinks covered: 4. [INFO CTS-0200] 4 placement blockages have been identified. [INFO CTS-0027] Generating H-Tree topology for net clock_regs. [INFO CTS-0028] Total number of sinks: 40071. [INFO CTS-0090] Sinks will be clustered based on buffer max cap. [INFO CTS-0030] Number of static layers: 0. [INFO CTS-0020] Wire segment unit: 1350 dbu (1 um). [INFO CTS-0206] Best clustering solution was found from clustering size of 20 and clustering diameter of 50. [INFO CTS-0019] Total number of sinks after clustering: 2572. [INFO CTS-0024] Normalized sink region: [(12.3189, 12.2765), (636.312, 617.975)]. [INFO CTS-0025] Width: 623.9933. [INFO CTS-0026] Height: 605.6986. Level 1 Direction: Horizontal Sinks per sub-region: 1286 Sub-region size: 311.9966 X 605.6986 [INFO CTS-0034] Segment length (rounded): 156. Level 2 Direction: Vertical Sinks per sub-region: 643 Sub-region size: 311.9966 X 302.8493 [INFO CTS-0034] Segment length (rounded): 152. Level 3 Direction: Horizontal Sinks per sub-region: 322 Sub-region size: 155.9983 X 302.8493 [INFO CTS-0034] Segment length (rounded): 78. Level 4 Direction: Vertical Sinks per sub-region: 161 Sub-region size: 155.9983 X 151.4246 [INFO CTS-0034] Segment length (rounded): 76. Level 5 Direction: Horizontal Sinks per sub-region: 81 Sub-region size: 77.9992 X 151.4246 [INFO CTS-0034] Segment length (rounded): 38. Level 6 Direction: Vertical Sinks per sub-region: 41 Sub-region size: 77.9992 X 75.7123 [INFO CTS-0034] Segment length (rounded): 38. Level 7 Direction: Horizontal Sinks per sub-region: 21 Sub-region size: 38.9996 X 75.7123 [INFO CTS-0034] Segment length (rounded): 20. Level 8 Direction: Vertical Sinks per sub-region: 11 Sub-region size: 38.9996 X 37.8562 [INFO CTS-0034] Segment length (rounded): 18. [INFO CTS-0032] Stop criterion found. Max number of sinks is 15. [INFO CTS-0035] Number of sinks covered: 2572. [INFO CTS-0018] Created 7 clock buffers. [INFO CTS-0012] Minimum number of buffers in the clock path: 4. [INFO CTS-0013] Maximum number of buffers in the clock path: 4. [INFO CTS-0015] Created 7 clock nets. [INFO CTS-0016] Fanout distribution for the current clock = 2:2.. [INFO CTS-0017] Max level of the clock tree: 1. [INFO CTS-0018] Created 3166 clock buffers. [INFO CTS-0012] Minimum number of buffers in the clock path: 20. [INFO CTS-0013] Maximum number of buffers in the clock path: 21. [INFO CTS-0014] 1 clock nets were removed/fixed. [INFO CTS-0015] Created 3165 clock nets. [INFO CTS-0016] Fanout distribution for the current clock = 0:1, 1:15, 2:27, 3:15, 4:10, 5:9, 6:23, 7:23, 8:23, 9:36, 10:41, 11:41, 12:92, 13:157, 14:305, 15:491, 16:604, 17:460, 18:258, 19:122, 20:48, 21:10, 22:7, 23:3, 24:1, 25:1, 26:1, 27:3.. [INFO CTS-0017] Max level of the clock tree: 8. Signal 11 received Stack trace: 0# 0x00005598CB4B75CB in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 1# 0x00007FF7D3A59520 in /lib/x86_64-linux-gnu/libc.so.6 2# odb::dbITerm::getMTerm() const in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 3# odb::dbITerm::isInputSignal(bool) in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 4# cts::TritonCTS::getFirstInput(odb::dbInst*) const in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 5# 0x00005598CD3F243C in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 6# 0x00005598CD3F00BE in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 7# cts::TritonCTS::computeIdealOutputCaps(cts::Clock&) in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 8# cts::TritonCTS::writeDummyLoadsToDb(cts::Clock&, std::unordered_set<odb::dbInst*, std::hashodb::dbInst*, std::equal_toodb::dbInst*, std::allocatorodb::dbInst* >&) in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 9# cts::TritonCTS::writeDataToDb() in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 10# cts::TritonCTS::runTritonCts() in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 11# 0x00005598CBB7C1B6 in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 12# TclNRRunCallbacks in /lib/x86_64-linux-gnu/libtcl8.6.so 13# 0x00007FF7D7ABB028 in /lib/x86_64-linux-gnu/libtcl8.6.so 14# Tcl_EvalEx in /lib/x86_64-linux-gnu/libtcl8.6.so 15# Tcl_Eval in /lib/x86_64-linux-gnu/libtcl8.6.so 16# sta::sourceTclFile(char const*, bool, bool, Tcl_Interp*) in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 17# ord::tclAppInit(Tcl_Interp*) in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 18# Tcl_MainEx in /lib/x86_64-linux-gnu/libtcl8.6.so 19# main in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad 20# 0x00007FF7D3A40D90 in /lib/x86_64-linux-gnu/libc.so.6 21# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6 22# _start in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad Command terminated by signal 11


### Expected Behavior

v2.0-13893-gf0cc0ee1a

### Environment

```shell
v2.0-13893-gf0cc0ee1a

To Reproduce

Can't share test case, will contact @maliberty out of band with details.

Relevant log output

No response

Screenshots

No response

Additional Context

No response

oharboe avatar May 22 '24 09:05 oharboe

@maliberty is this enough? deltaDebug is still gnawing on the problem...

image

oharboe avatar May 22 '24 17:05 oharboe

It's not obvious enough so I'll need a test case.

maliberty avatar May 22 '24 18:05 maliberty

Short term workaround -dont_use_dummy_load

oharboe avatar May 24 '24 07:05 oharboe

@maliberty FYI, observed again now with different input:

[INFO CTS-0017]     Max level of the clock tree: 8.
Signal 11 received
Stack trace:
 0# 0x0000563A37508B4B in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
 1# 0x000074B00035A520 in /lib/x86_64-linux-gnu/libc.so.6
 2# odb::dbITerm::getMTerm() const in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
 3# odb::dbITerm::isInputSignal(bool) in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
 4# cts::TritonCTS::getFirstInput(odb::dbInst*) const in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
 5# 0x0000563A3944B58C in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
 6# 0x0000563A3944920E in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
 7# cts::TritonCTS::computeIdealOutputCaps(cts::Clock&) in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
 8# cts::TritonCTS::writeDummyLoadsToDb(cts::Clock&, std::unordered_set<odb::dbInst*, std::hash<odb::dbInst*>, std::equal_to<odb::dbInst*>, std::allocator<odb::dbInst*> >&) in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
 9# cts::TritonCTS::writeDataToDb() in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
10# cts::TritonCTS::runTritonCts() in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
11# 0x0000563A37BCDA26 in /OpenROAD-flow-scripts/tools/install/OpenROAD/bin/openroad
12# TclNRRunCallbacks in /lib/x86_64-linux-gnu/libtcl8.6.so
13# 0x000074B0043BC028 in /lib/x86_64-linux-gnu/libtcl8.6.so
14# Tcl_EvalEx in /lib/x86_64-linux-gnu/libtcl8.6.so

oharboe avatar May 29 '24 09:05 oharboe

This was fixed on PR: #5222

arthurjolo avatar Jun 17 '24 21:06 arthurjolo