From b2818a1aa69e03435f133d57c296ee161a2509c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E6=B3=A5=E5=96=B5=E7=88=AA?= Date: Mon, 20 Oct 2025 16:43:07 +0800 Subject: [PATCH 1/6] fix: add const qualifier to `CompInnerNode::operator()` declaration Missing the `const` qualifier can cause errors when this class is used in STL classes that require this function to be `const`. --- src/third_party/salt/base/rsa.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/third_party/salt/base/rsa.h b/src/third_party/salt/base/rsa.h index 172829fa7..41dd6222b 100644 --- a/src/third_party/salt/base/rsa.h +++ b/src/third_party/salt/base/rsa.h @@ -37,7 +37,7 @@ class InnerNode class CompInnerNode { public: - bool operator()(const InnerNode* a, const InnerNode* b) + bool operator()(const InnerNode* a, const InnerNode* b) const { return a->dist > b->dist || // prefer fathest one (a->dist == b->dist @@ -88,4 +88,4 @@ class RsaBuilder : public RSABase void PrintOuterNodes(); }; -} // namespace salt \ No newline at end of file +} // namespace salt -- Gitee From 0c3fbed7843d5f57d1ab21e983ab806f0d636c82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E6=B3=A5=E5=96=B5=E7=88=AA?= Date: Mon, 20 Oct 2025 16:47:13 +0800 Subject: [PATCH 2/6] fix: add `[[noreturn]]` qualifier to `Logger::error`. This function outputs an error message and stopps the program. When used in functions that returns a value to stop on a non-recoverable error, it can cause the "no return value on all pathes" compilation error without the `[[noreturn]]` qualifier. --- src/operation/iRT/source/toolkit/logger/Logger.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/operation/iRT/source/toolkit/logger/Logger.hpp b/src/operation/iRT/source/toolkit/logger/Logger.hpp index ac0d87479..834fa1369 100644 --- a/src/operation/iRT/source/toolkit/logger/Logger.hpp +++ b/src/operation/iRT/source/toolkit/logger/Logger.hpp @@ -68,7 +68,7 @@ class Logger } template - void error(Loc location, const T& value, const Args&... args) + [[noreturn]] void error(Loc location, const T& value, const Args&... args) { printLog(LogLevel::kError, location, value, args...); closeLogFileStream(); -- Gitee From 5bc8962b236f60131485511f8d63671965ba1120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E6=B3=A5=E5=96=B5=E7=88=AA?= Date: Mon, 20 Oct 2025 16:49:29 +0800 Subject: [PATCH 3/6] fix: use explicit `static_cast` to prevent compilation error in clang --- .../src/layout/data_manager/vec_wire_pattern.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vectorization/src/layout/data_manager/vec_wire_pattern.cc b/src/vectorization/src/layout/data_manager/vec_wire_pattern.cc index 02484af5b..bbdd366b1 100644 --- a/src/vectorization/src/layout/data_manager/vec_wire_pattern.cc +++ b/src/vectorization/src/layout/data_manager/vec_wire_pattern.cc @@ -85,11 +85,11 @@ std::vector VecWirePatternGenerator::getPointList(VecNetWire& wire) auto& path = wire.get_paths(); std::vector points; for (auto& [start, end] : path) { - auto start_point = Point{start->get_x(), start->get_y(), start->get_layer_id()}; + auto start_point = Point{static_cast(start->get_x()), static_cast(start->get_y()), start->get_layer_id()}; points.push_back(start_point); } auto end = path.back().second; - points.push_back(Point{end->get_x(), end->get_y(), end->get_layer_id()}); + points.push_back(Point{static_cast(end->get_x()), static_cast(end->get_y()), end->get_layer_id()}); return points; } @@ -160,4 +160,4 @@ VecWirePatternSequence VecWirePatternGenerator::calcPattern(const std::vector Date: Mon, 20 Oct 2025 16:54:09 +0800 Subject: [PATCH 4/6] feat: enable OpenMP in VecFeatureDrc only for gcc Some gcc-only OpenMP features are used in `VecFeatureDrc::markNodes()`. This will prevent this file from being compiled in clang. This commit adds macros to enable the `#pragma omp` only when compiling with gcc. --- src/vectorization/src/feature/vec_feature_drc.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/vectorization/src/feature/vec_feature_drc.cpp b/src/vectorization/src/feature/vec_feature_drc.cpp index 967d79689..5a705e930 100644 --- a/src/vectorization/src/feature/vec_feature_drc.cpp +++ b/src/vectorization/src/feature/vec_feature_drc.cpp @@ -71,7 +71,9 @@ void VecFeatureDrc::markNodes() for (auto& [rule, drc_list_map] : detail_drc_map) { for (auto& [layer_name, drc_spot_list] : drc_list_map) { -#pragma omp parallel for schedule(dynamic) +#if defined(__GNUC__) && !defined(__clang__) && !defined(__INTEL_COMPILER) + #pragma omp parallel for schedule(dynamic) +#endif for (int i = 0; i < (int) drc_spot_list.size(); ++i) { /// set to node if node data exist auto& drc_spot = drc_spot_list[i]; @@ -291,4 +293,4 @@ void VecFeatureDrc::markNets() LOG_INFO << "Vectorization mark net drc end..."; } -} // namespace ivec \ No newline at end of file +} // namespace ivec -- Gitee From bd95c5db0f74ff447691ee8d345bf655a200a769 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E6=B3=A5=E5=96=B5=E7=88=AA?= Date: Mon, 20 Oct 2025 17:09:20 +0800 Subject: [PATCH 5/6] fix: probably wrong logic of `IdbLayerImplant::get_min_spacing()` The original function only returns a valid value when` _spacing_list->get_num()` returns 1. This logic might be flawed and can cause "no return value on all pathes" error. This commit is an ad-hoc fix that is not completely verified. I recomend the maintainers to check all related logics. If 1 is the only valid value of ` _spacing_list->get_num()`, an error should be expilcity produced instead of silently return an undefined value. If other values are also valid, these cases should be dealt with. If this function has not been completely implemented yet, it should cause an "unimplemented error" when the value is not 1. --- src/database/data/design/db_layout/IdbLayer.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/database/data/design/db_layout/IdbLayer.h b/src/database/data/design/db_layout/IdbLayer.h index 00239857a..ee803ca2e 100644 --- a/src/database/data/design/db_layout/IdbLayer.h +++ b/src/database/data/design/db_layout/IdbLayer.h @@ -766,9 +766,13 @@ class IdbLayerImplant : public IdbLayer ////getter int32_t get_min_spacing() { - if (_spacing_list->get_num() == 1) { - return _spacing_list->get_min_spacing(0)->get_min_spacing(); + int32_t min_spacing = INT32_MAX; + int32_t n = _spacing_list->get_num(); + for (size_t i=0; iget_min_spacing(i)->get_min_spacing(), min_spacing); } + return min_spacing; } IdbLayerImplantSpacingList* get_min_spacing_list() { return _spacing_list; } int32_t get_min_width() { return _min_width; } -- Gitee From eb2c309c80010ad62dbb8cbadefa5ce56c0045a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E6=B3=A5=E5=96=B5=E7=88=AA?= Date: Mon, 20 Oct 2025 17:17:32 +0800 Subject: [PATCH 6/6] feat: add clang version detection in build.sh --- build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.sh b/build.sh index 2763549e0..ab8c800c3 100755 --- a/build.sh +++ b/build.sh @@ -134,7 +134,7 @@ check_compiler_version() { exit 1 fi - local version_str=$("$compiler_path" --version | grep -E -m1 '(gcc|g\+\+)' | head -1) + local version_str=$("$compiler_path" --version | grep -E -m1 '(gcc|g\+\+|clang|clang\+\+)' | head -1) local version_num=$(echo "$version_str" | grep -oP '(?<= )\d+\.\d+(?=\.)?' | head -1) -- Gitee