|
34 | 34 | namespace odb { |
35 | 35 |
|
36 | 36 | static const std::string prefix("_main/src/dbSta/test/"); |
| 37 | +static constexpr bool kDebugMsgs = false; |
37 | 38 |
|
38 | 39 | /* |
39 | 40 | Extract the hierarchical information in human readable format. |
40 | 41 | Shows the dbNet and dbModNet view of the database. |
41 | 42 | */ |
42 | 43 |
|
43 | | -// NOLINTNEXTLINE(clang-diagnostic-unused-function) |
44 | 44 | static void DbStrDebugHierarchy(dbBlock* block, std::stringstream& str_db) |
45 | 45 | { |
46 | 46 | str_db << fmt::format("Debug: Data base tables for block at {}:\n", |
@@ -528,9 +528,11 @@ class TestHconn : public ::tst::Fixture |
528 | 528 | inv4_3_op_->connect(op2_net_); |
529 | 529 | inv4_4_op_->connect(op3_net_); |
530 | 530 |
|
531 | | - // std::stringstream str_str; |
532 | | - // DbStrDebugHierarchy(block_, str_str); |
533 | | - // printf("The Flat design created %s\n", str_str.str().c_str()); |
| 531 | + if (kDebugMsgs) { |
| 532 | + std::stringstream str_str; |
| 533 | + DbStrDebugHierarchy(block_, str_str); |
| 534 | + printf("The Flat design created %s\n", str_str.str().c_str()); |
| 535 | + } |
534 | 536 |
|
535 | 537 | // Now build the hierarchical "overlay" |
536 | 538 | // What we are doing here is adding the modnets which hook up |
@@ -646,11 +648,12 @@ class TestHconn : public ::tst::Fixture |
646 | 648 | inv4_mod_level2_inst_o3_miterm_->connect(inv4_mod_level2_inst_o3_mnet_); |
647 | 649 | inv4_mod_level1_master_o3_port_->connect(inv4_mod_level2_inst_o3_mnet_); |
648 | 650 |
|
649 | | - // Uncomment this to see the full design |
650 | | - // std::stringstream full_design; |
651 | | - // DbStrDebugHierarchy(block_, full_design); |
652 | | - // printf("The design created (flat and hierarchical) %s\n", |
653 | | - // full_design.str().c_str()); |
| 651 | + if (kDebugMsgs) { |
| 652 | + std::stringstream full_design; |
| 653 | + DbStrDebugHierarchy(block_, full_design); |
| 654 | + printf("The design created (flat and hierarchical) %s\n", |
| 655 | + full_design.str().c_str()); |
| 656 | + } |
654 | 657 | } |
655 | 658 |
|
656 | 659 | sta::LibertyLibrary* library_; |
@@ -789,9 +792,11 @@ class TestHconn : public ::tst::Fixture |
789 | 792 |
|
790 | 793 | TEST_F(TestHconn, ConnectionMade) |
791 | 794 | { |
792 | | - // std::stringstream str_str_initial; |
793 | | - // DbStrDebugHierarchy(block_, str_str_initial); |
794 | | - // printf("The initial design: %s\n", str_str_initial.str().c_str()); |
| 795 | + if (kDebugMsgs) { |
| 796 | + std::stringstream str_str_initial; |
| 797 | + DbStrDebugHierarchy(block_, str_str_initial); |
| 798 | + printf("The initial design: %s\n", str_str_initial.str().c_str()); |
| 799 | + } |
795 | 800 |
|
796 | 801 | // ECO test: get initial state before we start modifying |
797 | 802 | // the design. Then at end we undo everything and |
@@ -897,10 +902,11 @@ TEST_F(TestHconn, ConnectionMade) |
897 | 902 | db_network_->hierarchicalConnect( |
898 | 903 | inv1_2_inst_op0, inv4_4_ip_, hier_net_name.c_str()); |
899 | 904 |
|
900 | | - // Uncomment this to see the final design |
901 | | - // std::stringstream str_str_final; |
902 | | - // DbStrDebugHierarchy(block_, str_str_final); |
903 | | - // printf("The final design: %s\n", str_str_final.str().c_str()); |
| 905 | + if (kDebugMsgs) { |
| 906 | + std::stringstream str_str_final; |
| 907 | + DbStrDebugHierarchy(block_, str_str_final); |
| 908 | + printf("The final design: %s\n", str_str_final.str().c_str()); |
| 909 | + } |
904 | 910 |
|
905 | 911 | // Example of how to turn on the call backs for all the bterms/iterms |
906 | 912 | // used by the sta |
|
0 commit comments