Skip to content
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
5 changes: 4 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ set(CMAKE_CXX_STANDARD 20)
set(CMAKE_VERBOSE_MAKEFILE OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall -Werror=return-type")
set(CMAKE_C_FLAGS_RELEASE "$ENV{CFLAGS} -O1 -Wall -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O1 -Wall -Werror=return-type -DNDEBUG")
set(CMAKE_C_FLAGS_DEBUG "$ENV{CFLAGS} -O0 -Wall -g2 -ggdb")
set(CMAKE_CXX_FLAGS_DEBUG "$ENV{CXXFLAGS} -O0 -Wall -g2 -ggdb -Werror=return-type")

if(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
Expand All @@ -40,6 +42,7 @@ option(SANITIZER "Enable address sanitizer (default OFF)" OFF)
option(BUILD_GUI "Enable GUI components (default OFF)" OFF)
option(USE_GPU "Enable GPU acceleration (default OFF)" OFF)
option(ENABLE_AI "Enable AI modules (default OFF)" OFF)
option(BUILD_NOTIFICATION "Enable notification subsystem (default ON)" ON)
option(COMPATIBILITY_MODE "Enable compatibility mode (disable aggressive optimizations)" ON)

# Define GLOG_USE_GLOG_EXPORT for glog 0.7.1+ compatibility
Expand Down
9 changes: 7 additions & 2 deletions src/interface/tcl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ add_subdirectory(tcl_feature)
add_subdirectory(tcl_eval)
add_subdirectory(tcl_eco)
add_subdirectory(tcl_vec)
add_subdirectory(tcl_notification)
if(BUILD_NOTIFICATION)
add_subdirectory(tcl_notification)
endif()

if(CONTEST)
add_subdirectory(tcl_contest)
Expand Down Expand Up @@ -58,7 +60,6 @@ target_link_libraries(ieda_tcl
tcl_eco
tcl_vec
tcl_ipnp
tcl_notification
)

target_include_directories(ieda_tcl
Expand All @@ -74,6 +75,10 @@ target_include_directories(ieda_tcl
${HOME_PLATFORM}/tool_manager/tool_api
)

if(BUILD_NOTIFICATION)
target_link_libraries(ieda_tcl PUBLIC tcl_notification)
endif()

if(BUILD_GUI)
target_link_libraries(ieda_tcl PUBLIC tcl_gui)

Expand Down
6 changes: 5 additions & 1 deletion src/interface/tcl/tcl_register.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
#include "tcl_register_to.h"
#include "tcl_register_vec.h"
#include "tcl_register_pnp.h"
#ifdef BUILD_NOTIFICATION
#include "tcl_register_notification.h"
#endif

#ifdef CONTEST
#include "tcl_register_contest.h"
Expand Down Expand Up @@ -121,8 +123,10 @@ int registerCommands()

/// PNP
registerCmdPNP();


#ifdef BUILD_NOTIFICATION
registerCmdNotification();
#endif

#ifdef CONTEST
registerCmdContest();
Expand Down
8 changes: 7 additions & 1 deletion src/operation/iRT/interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@ target_link_libraries(irt_interface
power
ieda_feature
idm
notification
)

if(BUILD_NOTIFICATION)
target_link_libraries(irt_interface
PRIVATE
notification
)
endif()

target_include_directories(irt_interface
PUBLIC
${IRT_INTERFACE}
Expand Down
8 changes: 8 additions & 0 deletions src/operation/iRT/interface/RTInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
#include "GDSPlotter.hpp"
#include "LayerAssigner.hpp"
#include "Monitor.hpp"
#ifdef BUILD_NOTIFICATION
#include "NotificationUtility.h"
#endif
#include "PinAccessor.hpp"
#include "RTInterface.hpp"
#include "SpaceRouter.hpp"
Expand Down Expand Up @@ -1837,6 +1839,7 @@ std::vector<Segment<PlanarCoord>> RTInterface::getPlanarTopoList(std::vector<Pla

void RTInterface::sendNotification(std::string stage, int32_t iter, std::map<std::string, std::string> json_path_map)
{
#ifdef BUILD_NOTIFICATION
std::map<std::string, std::any> notification;
notification["step_name"] = "routing";
notification["stage"] = stage;
Expand All @@ -1845,6 +1848,11 @@ void RTInterface::sendNotification(std::string stage, int32_t iter, std::map<std
if (!ieda::NotificationUtility::getInstance().sendNotification("iRT", notification).success) {
RTLOG.warn(Loc::current(), "Failed to send notification!");
}
#else
(void)stage;
(void)iter;
(void)json_path_map;
#endif
}

#endif
Expand Down
7 changes: 4 additions & 3 deletions src/operation/iRT/source/toolkit/utility/Utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class Utility

static Orientation getOppositeOrientation(Orientation orientation)
{
Orientation opposite_orientation;
Orientation opposite_orientation = Orientation::kNone;
switch (orientation) {
case Orientation::kEast:
opposite_orientation = Orientation::kWest;
Expand All @@ -142,7 +142,7 @@ class Utility
break;
default:
RTLOG.error(Loc::current(), "The orientation is error!");
break;
return Orientation::kNone;
}
return opposite_orientation;
}
Expand Down Expand Up @@ -345,7 +345,7 @@ class Utility
if (intersection_point.get_x() == -1 && intersection_point.get_y() == -1) {
return false;
}
return false;
return true;
}

// 判断矩形是否与线段相交
Expand Down Expand Up @@ -492,6 +492,7 @@ class Utility
{
if (coord_list.empty()) {
RTLOG.error(Loc::current(), "The coord list is empty!");
return false;
} else if (coord_list.size() <= 2) {
return true;
} else {
Expand Down
19 changes: 13 additions & 6 deletions src/operation/iSTA/source/module/delay/ReduceDelayCal.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,9 @@ namespace ista {
void ReducedPath::deleteNoCapNode(RcTree& rc_tree,
const std::set<RctNode*>& pin_nodes) {
Vector<RctNode*> to_be_removed_nodes;
for (auto& [node_name, rc_node] : rc_tree.get_nodes()) {
for (auto& node_pair : rc_tree.get_nodes()) {
auto& node_name = node_pair.first;
auto& rc_node = node_pair.second;
if (rc_node.cap() == 0.0) {
// only delete the internal direct node.
if (((rc_node.get_fanin().size() == 2) &&
Expand Down Expand Up @@ -543,7 +545,10 @@ MatrixXd ArnoldiNet::calcDelayAndSlew(
}
}

auto [diag, B, W] = *_diag_B_W;
auto diag_B_W = *_diag_B_W;
auto& diag = std::get<0>(diag_B_W);
auto& B = std::get<1>(diag_B_W);
auto& W = std::get<2>(diag_B_W);

DVERBOSE_VLOG(1) << "diag\n" << diag;
DVERBOSE_VLOG(1) << "W\n" << W;
Expand Down Expand Up @@ -831,8 +836,9 @@ std::optional<std::pair<double, MatrixXd>> ArnoldiNet::delay(
std::optional<LibCurrentData*> output_current, AnalysisMode mode,
TransType trans_type) {
if (output_current) {
auto [total_time, num_points] =
(*output_current)->getSimulationTotalTimeAndNumPoints();
auto total_time_and_num_points = (*output_current)->getSimulationTotalTimeAndNumPoints();
auto total_time = std::get<0>(total_time_and_num_points);
auto num_points = std::get<1>(total_time_and_num_points);

auto get_current = [&output_current](
double start_time, double end_time,
Expand Down Expand Up @@ -869,8 +875,9 @@ std::optional<double> ArnoldiNet::slew(
// }

if (output_current) {
auto [total_time, num_points] =
(*output_current)->getSimulationTotalTimeAndNumPoints();
auto total_time_and_num_points = (*output_current)->getSimulationTotalTimeAndNumPoints();
auto total_time = std::get<0>(total_time_and_num_points);
auto num_points = std::get<1>(total_time_and_num_points);

auto get_current = [&output_current](
double start_time, double end_time,
Expand Down
4 changes: 3 additions & 1 deletion src/operation/iSTA/source/module/sdc-cmd/CmdGetClocks.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@ unsigned CmdGetClocks::exec() {

std::vector<SdcCollectionObj> obj_list;

for (auto& [clock_name, the_clock] : the_clocks) {
for (auto& clock_pair : the_clocks) {
auto& clock_name = clock_pair.first;
auto& the_clock = clock_pair.second;
auto it = std::find_if(
clock_list.begin(), clock_list.end(), [clock_name](auto clock_pattern) {
if ((clock_pattern == "*") || (clock_name == clock_pattern)) {
Expand Down
4 changes: 3 additions & 1 deletion src/operation/iSTA/source/module/sta/StaApplySdc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -671,7 +671,9 @@ unsigned StaApplySdc::processClockUncertainty(

auto obj2uncertainty = get_uncertainty();

for (auto [obj, uncertainty] : obj2uncertainty) {
for (auto& obj_pair : obj2uncertainty) {
auto& obj = obj_pair.first;
auto& uncertainty = obj_pair.second;
std::visit(overloaded{
[&apply_clock_uncertainty_to_clk,
uncertainty](SdcCommandObj* sdc_obj) {
Expand Down
118 changes: 60 additions & 58 deletions src/utility/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,58 +1,60 @@
cmake_minimum_required(VERSION 3.11)
set(CMAKE_CXX_STANDARD 20)

# add include and lib dirs
include_directories(SYSTEM ${HOME_THIRDPARTY})
include_directories(${HOME_UTILITY}/stdBase/include)
include_directories(${HOME_UTILITY}/stdBase/graph)
include_directories(${HOME_UTILITY}/log)
include_directories(${HOME_UTILITY}/string)
include_directories(${HOME_UTILITY}/tcl)
include_directories(${HOME_UTILITY})

link_directories(${CMAKE_BINARY_DIR}/lib)

add_subdirectory(json)
add_subdirectory(log)
add_subdirectory(string)
add_subdirectory(tcl)
add_subdirectory(time)
add_subdirectory(stdBase)
add_subdirectory(usage)
add_subdirectory(report)
add_subdirectory(memory)
add_subdirectory(notification)

option(BASE_RUN_TESTS "If ON, the tests will be run." OFF)

if(BASE_RUN_TESTS)
message(STATUS "RUN BASE TESTS")

# build test
aux_source_directory(./test SourceFiles)
add_executable(base_test ${SourceFiles})

set(MyLibs
log
tcl
str
time
graph)

target_link_libraries(
base_test
gmock_main
gtest
gmock
pthread
${MyLibs})

add_custom_command(
TARGET base_test
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SO_FILES}
${CMAKE_CURRENT_BINARY_DIR}/
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${GLOG_SO_FILES}
${CMAKE_CURRENT_BINARY_DIR}/)

endif(BASE_RUN_TESTS)
cmake_minimum_required(VERSION 3.11)
set(CMAKE_CXX_STANDARD 20)

# add include and lib dirs
include_directories(SYSTEM ${HOME_THIRDPARTY})
include_directories(${HOME_UTILITY}/stdBase/include)
include_directories(${HOME_UTILITY}/stdBase/graph)
include_directories(${HOME_UTILITY}/log)
include_directories(${HOME_UTILITY}/string)
include_directories(${HOME_UTILITY}/tcl)
include_directories(${HOME_UTILITY})

link_directories(${CMAKE_BINARY_DIR}/lib)

add_subdirectory(json)
add_subdirectory(log)
add_subdirectory(string)
add_subdirectory(tcl)
add_subdirectory(time)
add_subdirectory(stdBase)
add_subdirectory(usage)
add_subdirectory(report)
add_subdirectory(memory)
if(BUILD_NOTIFICATION)
add_subdirectory(notification)
endif()

option(BASE_RUN_TESTS "If ON, the tests will be run." OFF)

if(BASE_RUN_TESTS)
message(STATUS "RUN BASE TESTS")

# build test
aux_source_directory(./test SourceFiles)
add_executable(base_test ${SourceFiles})

set(MyLibs
log
tcl
str
time
graph)

target_link_libraries(
base_test
gmock_main
gtest
gmock
pthread
${MyLibs})

add_custom_command(
TARGET base_test
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${SO_FILES}
${CMAKE_CURRENT_BINARY_DIR}/
COMMAND ${CMAKE_COMMAND} -E copy_if_different ${GLOG_SO_FILES}
${CMAKE_CURRENT_BINARY_DIR}/)

endif(BASE_RUN_TESTS)
21 changes: 15 additions & 6 deletions src/vectorization/src/feature/vec_feature_drc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,12 @@ void VecFeatureDrc::markNodes()
// used for recording the mapping between drc_id and drc_type (rule)
std::map<int, std::string> drc_id_to_type;

for (auto& [rule, drc_list_map] : detail_drc_map) {
for (auto& [layer_name, drc_spot_list] : drc_list_map) {
for (auto& rule_pair : detail_drc_map) {
auto& rule = rule_pair.first;
auto& drc_list_map = rule_pair.second;
for (auto& layer_pair : drc_list_map) {
auto& layer_name = layer_pair.first;
auto& drc_spot_list = layer_pair.second;
#pragma omp parallel for schedule(dynamic)
for (int i = 0; i < (int) drc_spot_list.size(); ++i) {
/// set to node if node data exist
Expand All @@ -84,8 +88,11 @@ void VecFeatureDrc::markNodes()

/// get row & col
bool b_find_net = false;
auto [row_1, row_2, co_1, col_2]
= gridInfoInst.get_node_id_range(drc_spot.ll_x - 1, drc_spot.ll_y + 1, drc_spot.ur_x - 1, drc_spot.ur_y + 1);
auto node_range = gridInfoInst.get_node_id_range(drc_spot.ll_x - 1, drc_spot.ll_y + 1, drc_spot.ur_x - 1, drc_spot.ur_y + 1);
auto row_1 = std::get<0>(node_range);
auto row_2 = std::get<1>(node_range);
auto co_1 = std::get<2>(node_range);
auto col_2 = std::get<3>(node_range);
for (int row = row_1; row <= row_2; ++row) {
for (int col = co_1; col <= col_2; ++col) {
auto* node = grid.get_node(row, col);
Expand Down Expand Up @@ -150,7 +157,9 @@ void VecFeatureDrc::markWires()
auto* wire_feature = wire.get_feature(true);

std::set<VecNode*> node_list;
for (auto& [node1, node2] : wire.get_paths()) {
for (auto& node_pair : wire.get_paths()) {
auto* node1 = node_pair.first;
auto* node2 = node_pair.second;
if (node1->get_layer_id() == node2->get_layer_id()) {
auto order = node1->get_layer_id();
auto& grid = layout_layers.findLayoutLayer(order)->get_grid();
Expand Down Expand Up @@ -291,4 +300,4 @@ void VecFeatureDrc::markNets()
LOG_INFO << "Vectorization mark net drc end...";
}

} // namespace ivec
} // namespace ivec
Loading