From dae0843e87876214443659a905c695e9788b246e Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Mon, 5 Aug 2024 10:34:31 -0700 Subject: [PATCH 1/7] CentOS/RHEL 7 compatibility: Dockerfile and CMakeLists.txt --- CMakeLists.txt | 1 + Dockerfile | 70 ++++++++++++++++---------------------------------- 2 files changed, 23 insertions(+), 48 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 26e05729..a28ab98d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -509,6 +509,7 @@ target_sources(OpenSTA ) target_link_libraries(OpenSTA + stdc++fs Eigen3::Eigen ${TCL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} diff --git a/Dockerfile b/Dockerfile index 7256bcc2..d32467a0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,54 +3,29 @@ LABEL author="James Cherry" LABEL maintainer="James Cherry " # Install dev and runtime dependencies -RUN yum group install -y "Development Tools" \ - && yum install -y https://repo.ius.io/ius-release-el7.rpm \ - && yum install -y centos-release-scl \ - && yum install -y wget devtoolset-8 \ - && yum install -y qt5-qtbase-devel \ - devtoolset-8-libatomic-devel tcl-devel tcl tk libstdc++ tk-devel pcre-devel \ - python36u python36u-libs python36u-devel python36u-pip && \ - yum clean -y all && \ - rm -rf /var/lib/apt/lists/* - -ENV CC=/opt/rh/devtoolset-8/root/usr/bin/gcc \ - CPP=/opt/rh/devtoolset-8/root/usr/bin/cpp \ - CXX=/opt/rh/devtoolset-8/root/usr/bin/g++ \ - PATH=/opt/rh/devtoolset-8/root/usr/bin:$PATH \ - LD_LIBRARY_PATH=/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:/opt/rh/devtoolset-8/root/usr/lib64/dyninst:/opt/rh/devtoolset-8/root/usr/lib/dyninst:/opt/rh/devtoolset-8/root/usr/lib64:/opt/rh/devtoolset-8/root/usr/lib:$LD_LIBRARY_PATH - -# Install CMake -RUN wget https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.sh && \ - chmod +x cmake-3.14.0-Linux-x86_64.sh && \ - ./cmake-3.14.0-Linux-x86_64.sh --skip-license --prefix=/usr/local && rm -rf cmake-3.14.0-Linux-x86_64.sh \ +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo \ + && sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo \ + && sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo \ + && yum update -y \ + && yum install -y centos-release-scl epel-release +RUN sed -i s/mirror.centos.org/vault.centos.org/g /etc/yum.repos.d/*.repo \ + && sed -i s/^#.*baseurl=http/baseurl=http/g /etc/yum.repos.d/*.repo \ + && sed -i s/^mirrorlist=http/#mirrorlist=http/g /etc/yum.repos.d/*.repo \ + && yum install -y devtoolset-8 wget cmake3 make eigen3-devel tcl-devel tcl-tclreadline-devel swig3 bison flex zlib-devel \ && yum clean -y all -# Install any git version > 2.6.5 -RUN yum remove -y git* && yum install -y rh-git227 -RUN rm -f /usr/bin/git; ln -s /opt/rh/rh-git227/root/bin/git /usr/bin/git - -# Install SWIG -RUN yum remove -y swig \ - && wget https://github.com/swig/swig/archive/rel-4.0.1.tar.gz \ - && tar xfz rel-4.0.1.tar.gz \ - && rm -rf rel-4.0.1.tar.gz \ - && cd swig-rel-4.0.1 \ - && ./autogen.sh && ./configure --prefix=/usr && make -j $(nproc) && make install \ - && cd .. \ - && rm -rf swig-rel-4.0.1 - -# download CUDD -# RUN wget https://www.davidkebo.com/source/cudd_versions/cudd-3.0.0.tar.gz && \ -# tar -xvf cudd-3.0.0.tar.gz && \ -# rm cudd-3.0.0.tar.gz - -# install CUDD -# RUN cd cudd-3.0.0 && \ -# mkdir ../cudd && \ -# ./configure --prefix=$HOME/cudd && \ -# make && \ -# make install +# Download CUDD +RUN wget https://raw.githubusercontent.com/davidkebo/cudd/main/cudd_versions/cudd-3.0.0.tar.gz && \ + tar -xvf cudd-3.0.0.tar.gz && \ + rm cudd-3.0.0.tar.gz +# Install CUDD +RUN source /opt/rh/devtoolset-8/enable && \ + cd cudd-3.0.0 && \ + mkdir ../cudd && \ + ./configure && \ + make -j`nproc` && \ + make install FROM base-dependencies AS builder @@ -58,9 +33,8 @@ COPY . /OpenSTA WORKDIR /OpenSTA # Build -RUN mkdir build -#RUN cd buld && cmake .. -DCUDD=$HOME/cudd && make -j 8 -RUN cd build && cmake .. && make -j 8 +RUN rm -rf build && mkdir build +RUN source /opt/rh/devtoolset-8/enable && cd build && cmake3 .. && make -j`nproc` # Run sta on entry ENTRYPOINT ["OpenSTA/app/sta"] From d7de166e05b71feb227c7e91a561c4da2b618704 Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Mon, 5 Aug 2024 10:36:23 -0700 Subject: [PATCH 2/7] Fix minor typo --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a28ab98d..08d124c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,7 +29,7 @@ project(STA VERSION 2.6.0 ) option(CUDD_DIR "CUDD BDD package directory") -option(USE_TCL_READLINE "Use TCL readliine package" ON) +option(USE_TCL_READLINE "Use TCL readline package" ON) option(USE_SANITIZE "Compile with santize address enabled") # Turn on to debug compiler args. From d9b597f40703d106de05c1d465d7121bb07cd661 Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Mon, 5 Aug 2024 17:32:38 -0700 Subject: [PATCH 3/7] Remove filesystem linked lib --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 08d124c7..4540de0b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -509,7 +509,6 @@ target_sources(OpenSTA ) target_link_libraries(OpenSTA - stdc++fs Eigen3::Eigen ${TCL_LIBRARY} ${CMAKE_THREAD_LIBS_INIT} From 8c9959a44c9781b4495430af0b4d0fd6849438db Mon Sep 17 00:00:00 2001 From: James Cherry Date: Wed, 7 Aug 2024 13:37:08 -0700 Subject: [PATCH 4/7] Search::makePathGroups public Signed-off-by: James Cherry --- include/sta/Search.hh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/include/sta/Search.hh b/include/sta/Search.hh index 37d65dfc..d4039f50 100644 --- a/include/sta/Search.hh +++ b/include/sta/Search.hh @@ -156,6 +156,18 @@ public: PathGroup *pathGroup(const PathEnd *path_end) const; void deletePathGroups(); + void makePathGroups(int group_count, + int endpoint_count, + bool unique_pins, + float min_slack, + float max_slack, + PathGroupNameSet *group_names, + bool setup, + bool hold, + bool recovery, + bool removal, + bool clk_gating_setup, + bool clk_gating_hold); virtual ExceptionPath *exceptionTo(ExceptionPathType type, const Path *path, const Pin *pin, @@ -511,18 +523,6 @@ protected: void tnsDecr(Vertex *vertex, PathAPIndex path_ap_index); void tnsNotifyBefore(Vertex *vertex); - void makePathGroups(int group_count, - int endpoint_count, - bool unique_pins, - float min_slack, - float max_slack, - PathGroupNameSet *group_names, - bool setup, - bool hold, - bool recovery, - bool removal, - bool clk_gating_setup, - bool clk_gating_hold); bool matchesFilterTo(Path *path, const ClockEdge *to_clk_edge) const; PathRef pathClkPathArrival1(const Path *path) const; From 7dbb5a2b73b32d72731008508e6c8c6937070509 Mon Sep 17 00:00:00 2001 From: Akash Levy Date: Fri, 9 Aug 2024 09:28:06 -0700 Subject: [PATCH 5/7] Update Dockerfile suffix --- Dockerfile => Dockerfile.centos7 | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Dockerfile => Dockerfile.centos7 (100%) diff --git a/Dockerfile b/Dockerfile.centos7 similarity index 100% rename from Dockerfile rename to Dockerfile.centos7 From 9d259796ca542ab338ddc616db0e11e18a48e1e3 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Fri, 9 Aug 2024 14:02:25 -0700 Subject: [PATCH 6/7] cudd usage memory leak Signed-off-by: James Cherry --- search/Bdd.cc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/search/Bdd.cc b/search/Bdd.cc index 43e55adc..a2598c15 100644 --- a/search/Bdd.cc +++ b/search/Bdd.cc @@ -115,9 +115,9 @@ Bdd::ensureNode(const LibertyPort *port) auto port_var = bdd_port_var_map_.find(port); DdNode *node = nullptr; if (port_var == bdd_port_var_map_.end()) { - node = Cudd_bddNewVar(cudd_mgr_); + unsigned var_index = bdd_port_var_map_.size(); + node = Cudd_bddIthVar(cudd_mgr_, var_index); bdd_port_var_map_[port] = node; - unsigned var_index = Cudd_NodeReadIndex(node); bdd_var_idx_port_map_[var_index] = port; Cudd_Ref(node); } @@ -149,8 +149,6 @@ Bdd::varIndexPort(int var_index) void Bdd::clearVarMap() { - for (const auto [port, var_node] : bdd_port_var_map_) - Cudd_RecursiveDeref(cudd_mgr_, var_node); bdd_port_var_map_.clear(); bdd_var_idx_port_map_.clear(); } From 5261a2a91ba505fbf2ad4dabf525eb328ff61365 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Fri, 9 Aug 2024 15:40:21 -0700 Subject: [PATCH 7/7] liberty min_pulse_width missing related_pin Signed-off-by: James Cherry --- liberty/LibertyBuilder.cc | 2 ++ liberty/LibertyReader.cc | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/liberty/LibertyBuilder.cc b/liberty/LibertyBuilder.cc index 1b353ebf..9b52db9f 100644 --- a/liberty/LibertyBuilder.cc +++ b/liberty/LibertyBuilder.cc @@ -678,6 +678,8 @@ LibertyBuilder::makeMinPulseWidthArcs(LibertyCell *cell, TimingRole *role, TimingArcAttrsPtr attrs) { + if (from_port == nullptr) + from_port = to_port; TimingArcSet *arc_set = makeTimingArcSet(cell, from_port, to_port, related_out, role, attrs); for (auto to_rf : RiseFall::range()) { diff --git a/liberty/LibertyReader.cc b/liberty/LibertyReader.cc index d8064180..72749377 100644 --- a/liberty/LibertyReader.cc +++ b/liberty/LibertyReader.cc @@ -4119,7 +4119,8 @@ LibertyReader::endTiming(LibertyGroup *group) } TimingType timing_type = timing_->attrs()->timingType(); if (timing_->relatedPortNames() == nullptr - && !(timing_type == TimingType::min_clock_tree_path + && !(timing_type == TimingType::min_pulse_width + || timing_type == TimingType::min_clock_tree_path || timing_type == TimingType::max_clock_tree_path)) libWarn(1243, group, "timing group missing related_pin/related_bus_pin."); }