|
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 | | -void DbStrDebugHierarchy(dbBlock* block, std::stringstream& str_db) |
| 44 | +static void DbStrDebugHierarchy(dbBlock* block, std::stringstream& str_db) |
44 | 45 | { |
45 | 46 | str_db << fmt::format("Debug: Data base tables for block at {}:\n", |
46 | 47 | block->getName()); |
@@ -527,9 +528,11 @@ class TestHconn : public ::tst::Fixture |
527 | 528 | inv4_3_op_->connect(op2_net_); |
528 | 529 | inv4_4_op_->connect(op3_net_); |
529 | 530 |
|
530 | | - // std::stringstream str_str; |
531 | | - // DbStrDebugHierarchy(block_, str_str); |
532 | | - // 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 | + } |
533 | 536 |
|
534 | 537 | // Now build the hierarchical "overlay" |
535 | 538 | // What we are doing here is adding the modnets which hook up |
@@ -645,11 +648,12 @@ class TestHconn : public ::tst::Fixture |
645 | 648 | inv4_mod_level2_inst_o3_miterm_->connect(inv4_mod_level2_inst_o3_mnet_); |
646 | 649 | inv4_mod_level1_master_o3_port_->connect(inv4_mod_level2_inst_o3_mnet_); |
647 | 650 |
|
648 | | - // Uncomment this to see the full design |
649 | | - // std::stringstream full_design; |
650 | | - // DbStrDebugHierarchy(block_, full_design); |
651 | | - // printf("The design created (flat and hierarchical) %s\n", |
652 | | - // 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 | + } |
653 | 657 | } |
654 | 658 |
|
655 | 659 | sta::LibertyLibrary* library_; |
@@ -788,9 +792,11 @@ class TestHconn : public ::tst::Fixture |
788 | 792 |
|
789 | 793 | TEST_F(TestHconn, ConnectionMade) |
790 | 794 | { |
791 | | - // std::stringstream str_str_initial; |
792 | | - // DbStrDebugHierarchy(block_, str_str_initial); |
793 | | - // 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 | + } |
794 | 800 |
|
795 | 801 | // ECO test: get initial state before we start modifying |
796 | 802 | // the design. Then at end we undo everything and |
@@ -896,10 +902,11 @@ TEST_F(TestHconn, ConnectionMade) |
896 | 902 | db_network_->hierarchicalConnect( |
897 | 903 | inv1_2_inst_op0, inv4_4_ip_, hier_net_name.c_str()); |
898 | 904 |
|
899 | | - // Uncomment this to see the final design |
900 | | - // std::stringstream str_str_final; |
901 | | - // DbStrDebugHierarchy(block_, str_str_final); |
902 | | - // 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 | + } |
903 | 910 |
|
904 | 911 | // Example of how to turn on the call backs for all the bterms/iterms |
905 | 912 | // used by the sta |
|
0 commit comments