Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hier connect with test #6413

Open
wants to merge 14 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 35 additions & 3 deletions src/dbSta/src/dbNetwork.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2917,7 +2917,9 @@ void dbNetwork::getParentHierarchy(dbModule* start_module,
if (cur_module == top_module) {
return;
}
cur_module = start_module->getModInst()->getParent();
cur_module = cur_module->getModInst()
? cur_module->getModInst()->getParent()
: nullptr;
}
}

Expand Down Expand Up @@ -3035,14 +3037,44 @@ void dbNetwork::hierarchicalConnect(dbITerm* source_pin,
// in hierarchy, which is ok, and the source/dest modnet will be null
dbModNet* source_db_mod_net = source_pin->getModNet();
dbModNet* dest_db_mod_net = dest_pin->getModNet();
// case 1: source/dest in same module

//
// make sure there is a direct flat net connection
// Recall the hierarchical connections are overlayed
// onto the flat db network, so we have both worlds
// co-existing, something we respect even when making
// new hierarchical connections.

dbNet* source_db_net = source_pin->getNet();
dbNet* dest_db_net = dest_pin->getNet();

if (!source_db_net) {
std::string connection_name_str(connection_name);
std::string flat_name = connection_name_str + "_flat";
source_db_net = dbNet::create(block(), flat_name.c_str(), false);
source_pin->connect(source_db_net);
}

if (dest_db_net && (dest_db_net != source_db_net)) {
// if we have dest_mod_net, keep it
dbModNet* dest_mod_net = dest_pin->getModNet();
dest_pin->disconnect();
dest_pin->connect(source_db_net);
if (dest_mod_net) {
dest_pin->connect(dest_mod_net);
}
}

if (source_db_module == dest_db_module) {
if (!source_db_mod_net) {
source_db_mod_net = dbModNet::create(source_db_module, connection_name);
source_pin->connect(source_db_mod_net);
}
dest_pin->connect(source_db_mod_net);
} else {
}

else {
//
// Attempt to factor connection (minimize punch through)
//
dbModBTerm* dest_modbterm = nullptr;
Expand Down
8 changes: 8 additions & 0 deletions src/dbSta/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ or_integration_tests(
write_verilog7
write_verilog8
)


foreach(TEST_NAME IN LISTS TEST_NAMES)
or_integration_test("dbSta" ${TEST_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/regression)
endforeach()

add_subdirectory(cpp)

25 changes: 25 additions & 0 deletions src/dbSta/test/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
include(openroad)

add_executable(TestHconn TestHconn.cpp)
target_link_libraries(TestHconn
OpenSTA
GTest::gtest
GTest::gtest_main
GTest::gmock
dbSta_lib
utl_lib
${TCL_LIBRARY}
)

target_include_directories(TestHconn
PRIVATE
${PROJECT_SOURCE_DIR}/src/dbSta/src
)

gtest_discover_tests(TestHconn
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/..
)

add_dependencies(build_and_test TestHconn
)

Loading
Loading