From 8fd54addc1f1e8c44253e4867c08c48c11d65c68 Mon Sep 17 00:00:00 2001 From: meme Date: Sun, 7 Aug 2022 13:36:09 -0400 Subject: [PATCH 01/10] Build on M1 This allows vpr to be built on M1 MacBooks. For this to work, you need tbb@2020 from Homebrew. I was able to build the software using this CMake command: TBBROOT=$(brew --prefix)/opt/tbb@2020/ cmake -DCMAKE_BUILD_TYPE=Release -DVPR_USE_EZGL=OFF -G Ninja -S . -B build --- cmake/modules/FindTBB.cmake | 2 +- libtatum/CMakeLists.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cmake/modules/FindTBB.cmake b/cmake/modules/FindTBB.cmake index 0a1a5bb..f2dbb40 100644 --- a/cmake/modules/FindTBB.cmake +++ b/cmake/modules/FindTBB.cmake @@ -198,7 +198,7 @@ if(NOT TBB_FOUND) # Find TBB components ################################## - if(TBB_VERSION VERSION_LESS 4.3) + if(TBB_VERSION VERSION_LESS 4.3 AND NOT TBB_VERSION_MAJOR STREQUAL 2020) set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc tbb) else() set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc_proxy tbbmalloc tbb) diff --git a/libtatum/CMakeLists.txt b/libtatum/CMakeLists.txt index 64fd602..35fb9d6 100644 --- a/libtatum/CMakeLists.txt +++ b/libtatum/CMakeLists.txt @@ -76,7 +76,7 @@ if (TATUM_USE_EXECUTION_ENGINE STREQUAL "tbb") target_compile_definitions(libtatum PUBLIC TATUM_USE_TBB) target_link_libraries(libtatum tbb) - target_link_libraries(libtatum tbbmalloc_proxy) #Use the scalable memory allocator + target_link_libraries(libtatum ${TBB_tbbmalloc_proxy_LIBRARY}) #Use the scalable memory allocator elseif (TATUM_USE_EXECUTION_ENGINE STREQUAL "serial") #Nothing to do From 80d989329ec7b688207f300f03d582b24dde4965 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fahrican=20Ko=C5=9Far?= Date: Mon, 10 Oct 2022 22:26:26 -0400 Subject: [PATCH 02/10] migrate to oneTBB --- cmake/modules/FindTBB.cmake | 303 ------------------------------------ 1 file changed, 303 deletions(-) delete mode 100644 cmake/modules/FindTBB.cmake diff --git a/cmake/modules/FindTBB.cmake b/cmake/modules/FindTBB.cmake deleted file mode 100644 index f2dbb40..0000000 --- a/cmake/modules/FindTBB.cmake +++ /dev/null @@ -1,303 +0,0 @@ -# The MIT License (MIT) -# -# Copyright (c) 2015 Justus Calvin -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in all -# copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -# -# FindTBB -# ------- -# -# Find TBB include directories and libraries. -# -# Usage: -# -# find_package(TBB [major[.minor]] [EXACT] -# [QUIET] [REQUIRED] -# [[COMPONENTS] [components...]] -# [OPTIONAL_COMPONENTS components...]) -# -# where the allowed components are tbbmalloc and tbb_preview. Users may modify -# the behavior of this module with the following variables: -# -# * TBB_ROOT_DIR - The base directory the of TBB installation. -# * TBB_INCLUDE_DIR - The directory that contains the TBB headers files. -# * TBB_LIBRARY - The directory that contains the TBB library files. -# * TBB__LIBRARY - The path of the TBB the corresponding TBB library. -# These libraries, if specified, override the -# corresponding library search results, where -# may be tbb, tbb_debug, tbbmalloc, tbbmalloc_debug, -# tbb_preview, or tbb_preview_debug. -# * TBB_USE_DEBUG_BUILD - The debug version of tbb libraries, if present, will -# be used instead of the release version. -# -# Users may modify the behavior of this module with the following environment -# variables: -# -# * TBB_INSTALL_DIR -# * TBBROOT -# * LIBRARY_PATH -# -# This module will set the following variables: -# -# * TBB_FOUND - Set to false, or undefined, if we haven’t found, or -# don’t want to use TBB. -# * TBB__FOUND - If False, optional part of TBB sytem is -# not available. -# * TBB_VERSION - The full version string -# * TBB_VERSION_MAJOR - The major version -# * TBB_VERSION_MINOR - The minor version -# * TBB_INTERFACE_VERSION - The interface version number defined in -# tbb/tbb_stddef.h. -# * TBB__LIBRARY_RELEASE - The path of the TBB release version of -# , where may be tbb, tbb_debug, -# tbbmalloc, tbbmalloc_debug, tbb_preview, or -# tbb_preview_debug. -# * TBB__LIBRARY_DEGUG - The path of the TBB release version of -# , where may be tbb, tbb_debug, -# tbbmalloc, tbbmalloc_debug, tbb_preview, or -# tbb_preview_debug. -# -# The following varibles should be used to build and link with TBB: -# -# * TBB_INCLUDE_DIRS - The include directory for TBB. -# * TBB_LIBRARIES - The libraries to link against to use TBB. -# * TBB_LIBRARIES_RELEASE - The release libraries to link against to use TBB. -# * TBB_LIBRARIES_DEBUG - The debug libraries to link against to use TBB. -# * TBB_DEFINITIONS - Definitions to use when compiling code that uses -# TBB. -# * TBB_DEFINITIONS_RELEASE - Definitions to use when compiling release code that -# uses TBB. -# * TBB_DEFINITIONS_DEBUG - Definitions to use when compiling debug code that -# uses TBB. -# -# This module will also create the "tbb" target that may be used when building -# executables and libraries. - -include(FindPackageHandleStandardArgs) - -if(NOT TBB_FOUND) - - ################################## - # Check the build type - ################################## - - if(NOT DEFINED TBB_USE_DEBUG_BUILD) - if(CMAKE_BUILD_TYPE MATCHES "(Debug|DEBUG|debug|RelWithDebInfo|RELWITHDEBINFO|relwithdebinfo)") - set(TBB_BUILD_TYPE DEBUG) - else() - set(TBB_BUILD_TYPE RELEASE) - endif() - elseif(TBB_USE_DEBUG_BUILD) - set(TBB_BUILD_TYPE DEBUG) - else() - set(TBB_BUILD_TYPE RELEASE) - endif() - - ################################## - # Set the TBB search directories - ################################## - - # Define search paths based on user input and environment variables - set(TBB_SEARCH_DIR ${TBB_ROOT_DIR} $ENV{TBB_INSTALL_DIR} $ENV{TBBROOT}) - - # Define the search directories based on the current platform - if(CMAKE_SYSTEM_NAME STREQUAL "Windows") - set(TBB_DEFAULT_SEARCH_DIR "C:/Program Files/Intel/TBB" - "C:/Program Files (x86)/Intel/TBB") - - # Set the target architecture - if(CMAKE_SIZEOF_VOID_P EQUAL 8) - set(TBB_ARCHITECTURE "intel64") - else() - set(TBB_ARCHITECTURE "ia32") - endif() - - # Set the TBB search library path search suffix based on the version of VC - if(WINDOWS_STORE) - set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11_ui") - elseif(MSVC14) - set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc14") - elseif(MSVC12) - set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc12") - elseif(MSVC11) - set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc11") - elseif(MSVC10) - set(TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc10") - endif() - - # Add the library path search suffix for the VC independent version of TBB - list(APPEND TBB_LIB_PATH_SUFFIX "lib/${TBB_ARCHITECTURE}/vc_mt") - - elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin") - # OS X - set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb") - - # TODO: Check to see which C++ library is being used by the compiler. - if(NOT ${CMAKE_SYSTEM_VERSION} VERSION_LESS 13.0) - # The default C++ library on OS X 10.9 and later is libc++ - set(TBB_LIB_PATH_SUFFIX "lib/libc++" "lib") - else() - set(TBB_LIB_PATH_SUFFIX "lib") - endif() - elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") - # Linux - set(TBB_DEFAULT_SEARCH_DIR "/opt/intel/tbb") - - # TODO: Check compiler version to see the suffix should be /gcc4.1 or - # /gcc4.1. For now, assume that the compiler is more recent than - # gcc 4.4.x or later. - if(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") - set(TBB_LIB_PATH_SUFFIX "lib/intel64/gcc4.4") - elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "^i.86$") - set(TBB_LIB_PATH_SUFFIX "lib/ia32/gcc4.4") - endif() - endif() - - ################################## - # Find the TBB include dir - ################################## - - find_path(TBB_INCLUDE_DIRS tbb/tbb.h - HINTS ${TBB_INCLUDE_DIR} ${TBB_SEARCH_DIR} - PATHS ${TBB_DEFAULT_SEARCH_DIR} - PATH_SUFFIXES include) - - ################################## - # Set version strings - ################################## - - if(TBB_INCLUDE_DIRS) - file(READ "${TBB_INCLUDE_DIRS}/tbb/tbb_stddef.h" _tbb_version_file) - string(REGEX REPLACE ".*#define TBB_VERSION_MAJOR ([0-9]+).*" "\\1" - TBB_VERSION_MAJOR "${_tbb_version_file}") - string(REGEX REPLACE ".*#define TBB_VERSION_MINOR ([0-9]+).*" "\\1" - TBB_VERSION_MINOR "${_tbb_version_file}") - string(REGEX REPLACE ".*#define TBB_INTERFACE_VERSION ([0-9]+).*" "\\1" - TBB_INTERFACE_VERSION "${_tbb_version_file}") - set(TBB_VERSION "${TBB_VERSION_MAJOR}.${TBB_VERSION_MINOR}") - endif() - - ################################## - # Find TBB components - ################################## - - if(TBB_VERSION VERSION_LESS 4.3 AND NOT TBB_VERSION_MAJOR STREQUAL 2020) - set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc tbb) - else() - set(TBB_SEARCH_COMPOMPONENTS tbb_preview tbbmalloc_proxy tbbmalloc tbb) - endif() - - # Find each component - foreach(_comp ${TBB_SEARCH_COMPOMPONENTS}) - if(";${TBB_FIND_COMPONENTS};tbb;" MATCHES ";${_comp};") - - # Search for the libraries - find_library(TBB_${_comp}_LIBRARY_RELEASE ${_comp} - HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR} - PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH - PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX}) - - find_library(TBB_${_comp}_LIBRARY_DEBUG ${_comp}_debug - HINTS ${TBB_LIBRARY} ${TBB_SEARCH_DIR} - PATHS ${TBB_DEFAULT_SEARCH_DIR} ENV LIBRARY_PATH - PATH_SUFFIXES ${TBB_LIB_PATH_SUFFIX}) - - if(TBB_${_comp}_LIBRARY_DEBUG) - list(APPEND TBB_LIBRARIES_DEBUG "${TBB_${_comp}_LIBRARY_DEBUG}") - endif() - if(TBB_${_comp}_LIBRARY_RELEASE) - list(APPEND TBB_LIBRARIES_RELEASE "${TBB_${_comp}_LIBRARY_RELEASE}") - endif() - if(TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE} AND NOT TBB_${_comp}_LIBRARY) - set(TBB_${_comp}_LIBRARY "${TBB_${_comp}_LIBRARY_${TBB_BUILD_TYPE}}") - endif() - - if(TBB_${_comp}_LIBRARY AND EXISTS "${TBB_${_comp}_LIBRARY}") - set(TBB_${_comp}_FOUND TRUE) - else() - set(TBB_${_comp}_FOUND FALSE) - endif() - - # Mark internal variables as advanced - mark_as_advanced(TBB_${_comp}_LIBRARY_RELEASE) - mark_as_advanced(TBB_${_comp}_LIBRARY_DEBUG) - mark_as_advanced(TBB_${_comp}_LIBRARY) - - endif() - endforeach() - - ################################## - # Set compile flags and libraries - ################################## - - set(TBB_DEFINITIONS_RELEASE "") - set(TBB_DEFINITIONS_DEBUG "-DTBB_USE_DEBUG=1") - - if(TBB_LIBRARIES_${TBB_BUILD_TYPE}) - set(TBB_DEFINITIONS "${TBB_DEFINITIONS_${TBB_BUILD_TYPE}}") - set(TBB_LIBRARIES "${TBB_LIBRARIES_${TBB_BUILD_TYPE}}") - elseif(TBB_LIBRARIES_RELEASE) - set(TBB_DEFINITIONS "${TBB_DEFINITIONS_RELEASE}") - set(TBB_LIBRARIES "${TBB_LIBRARIES_RELEASE}") - elseif(TBB_LIBRARIES_DEBUG) - set(TBB_DEFINITIONS "${TBB_DEFINITIONS_DEBUG}") - set(TBB_LIBRARIES "${TBB_LIBRARIES_DEBUG}") - endif() - - find_package_handle_standard_args(TBB - REQUIRED_VARS TBB_INCLUDE_DIRS TBB_LIBRARIES - HANDLE_COMPONENTS - VERSION_VAR TBB_VERSION) - - ################################## - # Create targets - ################################## - - if(NOT CMAKE_VERSION VERSION_LESS 3.0 AND TBB_FOUND) - add_library(tbb SHARED IMPORTED) - set_target_properties(tbb PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES ${TBB_INCLUDE_DIRS} - IMPORTED_LOCATION ${TBB_LIBRARIES}) - if(TBB_LIBRARIES_RELEASE AND TBB_LIBRARIES_DEBUG) - set_target_properties(tbb PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "$<$,$>:TBB_USE_DEBUG=1>" - IMPORTED_LOCATION_DEBUG ${TBB_LIBRARIES_DEBUG} - IMPORTED_LOCATION_RELWITHDEBINFO ${TBB_LIBRARIES_DEBUG} - IMPORTED_LOCATION_RELEASE ${TBB_LIBRARIES_RELEASE} - IMPORTED_LOCATION_MINSIZEREL ${TBB_LIBRARIES_RELEASE} - ) - elseif(TBB_LIBRARIES_RELEASE) - set_target_properties(tbb PROPERTIES IMPORTED_LOCATION ${TBB_LIBRARIES_RELEASE}) - else() - set_target_properties(tbb PROPERTIES - INTERFACE_COMPILE_DEFINITIONS "${TBB_DEFINITIONS_DEBUG}" - IMPORTED_LOCATION ${TBB_LIBRARIES_DEBUG} - ) - endif() - endif() - - mark_as_advanced(TBB_INCLUDE_DIRS TBB_LIBRARIES) - - unset(TBB_ARCHITECTURE) - unset(TBB_BUILD_TYPE) - unset(TBB_LIB_PATH_SUFFIX) - unset(TBB_DEFAULT_SEARCH_DIR) - -endif() From 6693b9532cf923dc3091c3eac59110f466895a87 Mon Sep 17 00:00:00 2001 From: saaramahmoudi Date: Thu, 20 Apr 2023 14:10:59 -0400 Subject: [PATCH 03/10] updated cmake_minimum_required in CMakeLists.txt --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3dd7618..664d5fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.9) +cmake_minimum_required(VERSION 3.16) project("tatum") From 67e374e8772bce6df80a6bbb4687bfb4e33e8fd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fahrican=20Ko=C5=9Far?= Date: Mon, 12 Jun 2023 03:54:39 -0400 Subject: [PATCH 04/10] turn off tatum's TBB by default --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 664d5fe..3b9f10f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.16) project("tatum") -set(TATUM_EXECUTION_ENGINE "auto" CACHE STRING "Specify the framework for (potential) parallel execution") +set(TATUM_EXECUTION_ENGINE "serial" CACHE STRING "Specify the framework for (potential) parallel execution") set_property(CACHE TATUM_EXECUTION_ENGINE PROPERTY STRINGS auto serial tbb) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") From 02e662200ad2f7c671e9db35b43cce6582063017 Mon Sep 17 00:00:00 2001 From: Duck Deux Date: Mon, 12 Jun 2023 13:19:58 -0400 Subject: [PATCH 05/10] add comment about serial --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3b9f10f..29d78da 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 3.16) project("tatum") +# Parallel tatum gives non-deterministic results. Use serial by default until resolved set(TATUM_EXECUTION_ENGINE "serial" CACHE STRING "Specify the framework for (potential) parallel execution") set_property(CACHE TATUM_EXECUTION_ENGINE PROPERTY STRINGS auto serial tbb) From faac3e46eb06893b49ac718535556ae629659661 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fahrican=20Ko=C5=9Far?= Date: Thu, 24 Mar 2022 19:21:19 -0400 Subject: [PATCH 06/10] cleanup and add baseline parallel router This commit has a bunch of cleanups piggybacked onto the baseline parallel router: * Use RRNodeId where possible * Remove dead code and docs left from breadth-first router * Fix nondeterminism in parallel tatum * Fix performance penalty from NetPinTimingInvalidator --- CMakeLists.txt | 3 +-- .../tatum/graph_walkers/SerialIncrWalker.hpp | 16 ++++++++++++++-- libtatum/tatum/util/tatum_strong_id.hpp | 14 ++++++++------ 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 29d78da..664d5fe 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,7 @@ cmake_minimum_required(VERSION 3.16) project("tatum") -# Parallel tatum gives non-deterministic results. Use serial by default until resolved -set(TATUM_EXECUTION_ENGINE "serial" CACHE STRING "Specify the framework for (potential) parallel execution") +set(TATUM_EXECUTION_ENGINE "auto" CACHE STRING "Specify the framework for (potential) parallel execution") set_property(CACHE TATUM_EXECUTION_ENGINE PROPERTY STRINGS auto serial tbb) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules") diff --git a/libtatum/tatum/graph_walkers/SerialIncrWalker.hpp b/libtatum/tatum/graph_walkers/SerialIncrWalker.hpp index 79ee6b0..8ece8e4 100644 --- a/libtatum/tatum/graph_walkers/SerialIncrWalker.hpp +++ b/libtatum/tatum/graph_walkers/SerialIncrWalker.hpp @@ -1,5 +1,10 @@ #pragma once #include + +#ifdef TATUM_USE_TBB +#include +#endif + #include "tatum/graph_walkers/TimingGraphWalker.hpp" #include "tatum/TimingGraph.hpp" #include "tatum/delay_calc/DelayCalculator.hpp" @@ -431,9 +436,16 @@ class SerialIncrWalker : public TimingGraphWalker { t_incr_traversal_update incr_arr_update_; t_incr_traversal_update incr_req_update_; - //Set of invalidated edges, and bitset for membership + /** Set of invalidated edges, and bitset for membership. + * Use thread safe alternatives when TBB is on, since invalidate_edge_impl + * may be called concurrently */ +#ifdef TATUM_USE_TBB + tbb::concurrent_vector invalidated_edges_; + tatum::util::linear_map edge_invalidated_; +#else std::vector invalidated_edges_; - tatum::util::linear_map edge_invalidated_; + tatum::util::linear_map edge_invalidated_; +#endif //Nodes which have been modified during timing update, and bitset for membership std::vector nodes_modified_; diff --git a/libtatum/tatum/util/tatum_strong_id.hpp b/libtatum/tatum/util/tatum_strong_id.hpp index 69f020f..71f5b7a 100644 --- a/libtatum/tatum/util/tatum_strong_id.hpp +++ b/libtatum/tatum/util/tatum_strong_id.hpp @@ -176,22 +176,24 @@ class StrongId { //Default to the sentinel value constexpr StrongId() : id_(sentinel) {} - //Only allow explict constructions from a raw Id (no automatic conversions) - explicit StrongId(T id) noexcept : id_(id) {} + //Only allow explicit constructions from a raw Id (no automatic conversions) + explicit constexpr StrongId(T id) noexcept : id_(id) {} //Allow some explicit conversion to useful types //Allow explicit conversion to bool (e.g. if(id)) - explicit operator bool() const { return *this != INVALID(); } + explicit operator bool() const { return id_ != sentinel; } + + /// @brief Another name for the bool cast + constexpr bool is_valid() const { return id_ != sentinel; } //Allow explicit conversion to size_t (e.g. my_vector[size_t(strong_id)]) explicit operator std::size_t() const { return static_cast(id_); } - - //To enable hasing Ids + //To enable hashing Ids friend std::hash>; - //To enable comparisions between Ids + //To enable comparisons between Ids // Note that since these are templated functions we provide an empty set of template parameters // after the function name (i.e. <>) friend bool operator== <>(const StrongId& lhs, const StrongId& rhs); From 57e691fe086127d5fec20ec461ab7a9d96600c4c Mon Sep 17 00:00:00 2001 From: Oleksandr Date: Fri, 15 Mar 2024 21:16:25 +0200 Subject: [PATCH 07/10] add Interactive Path Analysis (iteration 2, with multiselection feature), except draw_basic.cpp/h changes, will be updated separately due to conflict with layered draw ability --- libtatum/tatum/TimingReporter.cpp | 33 +++++++++++++++++++++++++------ libtatum/tatum/TimingReporter.hpp | 9 ++++++--- 2 files changed, 33 insertions(+), 9 deletions(-) diff --git a/libtatum/tatum/TimingReporter.cpp b/libtatum/tatum/TimingReporter.cpp index 609b0c0..bda7eb4 100644 --- a/libtatum/tatum/TimingReporter.cpp +++ b/libtatum/tatum/TimingReporter.cpp @@ -99,6 +99,15 @@ void TimingReporter::report_timing_setup(std::ostream& os, report_timing(os, paths); } +void TimingReporter::report_timing_setup(std::vector& paths, + std::ostream& os, + const SetupTimingAnalyzer& setup_analyzer, + size_t npaths, bool usePathElementSeparator) const { + paths = path_collector_.collect_worst_setup_timing_paths(timing_graph_, setup_analyzer, npaths); + + report_timing(os, paths, usePathElementSeparator); +} + void TimingReporter::report_timing_hold(std::string filename, const HoldTimingAnalyzer& hold_analyzer, size_t npaths) const { @@ -114,6 +123,16 @@ void TimingReporter::report_timing_hold(std::ostream& os, report_timing(os, paths); } +void TimingReporter::report_timing_hold(std::vector& paths, + std::ostream& os, + const HoldTimingAnalyzer& hold_analyzer, + size_t npaths, + bool usePathElementSeparator) const { + paths = path_collector_.collect_worst_hold_timing_paths(timing_graph_, hold_analyzer, npaths); + + report_timing(os, paths, usePathElementSeparator); +} + void TimingReporter::report_skew_setup(std::string filename, const SetupTimingAnalyzer& setup_analyzer, size_t nworst) const { @@ -195,7 +214,7 @@ void TimingReporter::report_unconstrained_hold(std::ostream& os, */ void TimingReporter::report_timing(std::ostream& os, - const std::vector& paths) const { + const std::vector& paths, bool usePathElementSeparator) const { tatum::OsFormatGuard flag_guard(os); os << "#Timing report of worst " << paths.size() << " path(s)\n"; @@ -206,14 +225,14 @@ void TimingReporter::report_timing(std::ostream& os, size_t i = 0; for(const auto& path : paths) { os << "#Path " << ++i << "\n"; - report_timing_path(os, path); + report_timing_path(os, path, usePathElementSeparator); os << "\n"; } os << "#End of timing report\n"; } -void TimingReporter::report_timing_path(std::ostream& os, const TimingPath& timing_path) const { +void TimingReporter::report_timing_path(std::ostream& os, const TimingPath& timing_path, bool usePathElementSeparator) const { std::string divider = "--------------------------------------------------------------------------------"; TimingPathInfo path_info = timing_path.path_info(); @@ -252,7 +271,7 @@ void TimingReporter::report_timing_path(std::ostream& os, const TimingPath& timi arr_path = report_timing_clock_launch_subpath(os, path_helper, timing_path.clock_launch_path(), path_info.launch_domain(), path_info.type()); - arr_path = report_timing_data_arrival_subpath(os, path_helper, timing_path.data_arrival_path(), path_info.launch_domain(), path_info.type(), arr_path); + arr_path = report_timing_data_arrival_subpath(os, path_helper, timing_path.data_arrival_path(), path_info.launch_domain(), path_info.type(), arr_path, usePathElementSeparator); { //Final arrival time @@ -584,7 +603,8 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os, const TimingSubPath& subpath, DomainId domain, TimingType timing_type, - Time path) const { + Time path, + bool usePathElementSeparator) const { { //Input constraint @@ -615,7 +635,7 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os, //Launch data for(const TimingPathElem& path_elem : subpath.elements()) { - + if (usePathElementSeparator) os << "el{\n"; //Ask the application for a detailed breakdown of the edge delays auto delay_breakdown = name_resolver_.edge_delay_breakdown(path_elem.incomming_edge(), delay_type); if (!delay_breakdown.components.empty()) { @@ -644,6 +664,7 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os, path = path_elem.tag().time(); path_helper.update_print_path(os, point, path); + if (usePathElementSeparator) os << "el}\n"; } return path; } diff --git a/libtatum/tatum/TimingReporter.hpp b/libtatum/tatum/TimingReporter.hpp index 1569aa6..a3a381f 100644 --- a/libtatum/tatum/TimingReporter.hpp +++ b/libtatum/tatum/TimingReporter.hpp @@ -64,9 +64,11 @@ class TimingReporter { public: void report_timing_setup(std::string filename, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; void report_timing_setup(std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; + void report_timing_setup(std::vector& paths, std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS, bool usePathElementSeparator=false) const; void report_timing_hold(std::string filename, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; void report_timing_hold(std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; + void report_timing_hold(std::vector& paths, std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS, bool usePathElementSeparator=false) const; void report_skew_setup(std::string filename, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const; void report_skew_setup(std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const; @@ -94,9 +96,9 @@ class TimingReporter { }; private: - void report_timing(std::ostream& os, const std::vector& paths) const; + void report_timing(std::ostream& os, const std::vector& paths, bool usePathElementSeparator = false) const; - void report_timing_path(std::ostream& os, const TimingPath& path) const; + void report_timing_path(std::ostream& os, const TimingPath& path, bool usePathElementSeparator = false) const; void report_unconstrained(std::ostream& os, const NodeType type, const detail::TagRetriever& tag_retriever) const; @@ -123,7 +125,8 @@ class TimingReporter { const TimingSubPath& subpath, DomainId domain, TimingType timing_type, - Time path) const; + Time path, + bool usePathElementSeparator = false) const; Time report_timing_data_required_element(std::ostream& os, detail::ReportTimingPathHelper& path_helper, From 42614fa59de0d04bfd2397810190aaa37f30a67a Mon Sep 17 00:00:00 2001 From: Oleksandr Date: Thu, 28 Mar 2024 13:18:21 +0200 Subject: [PATCH 08/10] remove timing report modification, adding report metadata string to the end of the report (will be used in parser on client side) --- libtatum/tatum/TimingReporter.cpp | 22 +++++++++------------- libtatum/tatum/TimingReporter.hpp | 11 +++++------ 2 files changed, 14 insertions(+), 19 deletions(-) diff --git a/libtatum/tatum/TimingReporter.cpp b/libtatum/tatum/TimingReporter.cpp index bda7eb4..ac352f3 100644 --- a/libtatum/tatum/TimingReporter.cpp +++ b/libtatum/tatum/TimingReporter.cpp @@ -102,10 +102,10 @@ void TimingReporter::report_timing_setup(std::ostream& os, void TimingReporter::report_timing_setup(std::vector& paths, std::ostream& os, const SetupTimingAnalyzer& setup_analyzer, - size_t npaths, bool usePathElementSeparator) const { + size_t npaths) const { paths = path_collector_.collect_worst_setup_timing_paths(timing_graph_, setup_analyzer, npaths); - report_timing(os, paths, usePathElementSeparator); + report_timing(os, paths); } void TimingReporter::report_timing_hold(std::string filename, @@ -126,11 +126,10 @@ void TimingReporter::report_timing_hold(std::ostream& os, void TimingReporter::report_timing_hold(std::vector& paths, std::ostream& os, const HoldTimingAnalyzer& hold_analyzer, - size_t npaths, - bool usePathElementSeparator) const { + size_t npaths) const { paths = path_collector_.collect_worst_hold_timing_paths(timing_graph_, hold_analyzer, npaths); - report_timing(os, paths, usePathElementSeparator); + report_timing(os, paths); } void TimingReporter::report_skew_setup(std::string filename, @@ -214,7 +213,7 @@ void TimingReporter::report_unconstrained_hold(std::ostream& os, */ void TimingReporter::report_timing(std::ostream& os, - const std::vector& paths, bool usePathElementSeparator) const { + const std::vector& paths) const { tatum::OsFormatGuard flag_guard(os); os << "#Timing report of worst " << paths.size() << " path(s)\n"; @@ -225,14 +224,14 @@ void TimingReporter::report_timing(std::ostream& os, size_t i = 0; for(const auto& path : paths) { os << "#Path " << ++i << "\n"; - report_timing_path(os, path, usePathElementSeparator); + report_timing_path(os, path); os << "\n"; } os << "#End of timing report\n"; } -void TimingReporter::report_timing_path(std::ostream& os, const TimingPath& timing_path, bool usePathElementSeparator) const { +void TimingReporter::report_timing_path(std::ostream& os, const TimingPath& timing_path) const { std::string divider = "--------------------------------------------------------------------------------"; TimingPathInfo path_info = timing_path.path_info(); @@ -271,7 +270,7 @@ void TimingReporter::report_timing_path(std::ostream& os, const TimingPath& timi arr_path = report_timing_clock_launch_subpath(os, path_helper, timing_path.clock_launch_path(), path_info.launch_domain(), path_info.type()); - arr_path = report_timing_data_arrival_subpath(os, path_helper, timing_path.data_arrival_path(), path_info.launch_domain(), path_info.type(), arr_path, usePathElementSeparator); + arr_path = report_timing_data_arrival_subpath(os, path_helper, timing_path.data_arrival_path(), path_info.launch_domain(), path_info.type(), arr_path); { //Final arrival time @@ -603,8 +602,7 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os, const TimingSubPath& subpath, DomainId domain, TimingType timing_type, - Time path, - bool usePathElementSeparator) const { + Time path) const { { //Input constraint @@ -635,7 +633,6 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os, //Launch data for(const TimingPathElem& path_elem : subpath.elements()) { - if (usePathElementSeparator) os << "el{\n"; //Ask the application for a detailed breakdown of the edge delays auto delay_breakdown = name_resolver_.edge_delay_breakdown(path_elem.incomming_edge(), delay_type); if (!delay_breakdown.components.empty()) { @@ -664,7 +661,6 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os, path = path_elem.tag().time(); path_helper.update_print_path(os, point, path); - if (usePathElementSeparator) os << "el}\n"; } return path; } diff --git a/libtatum/tatum/TimingReporter.hpp b/libtatum/tatum/TimingReporter.hpp index a3a381f..590e3bc 100644 --- a/libtatum/tatum/TimingReporter.hpp +++ b/libtatum/tatum/TimingReporter.hpp @@ -64,11 +64,11 @@ class TimingReporter { public: void report_timing_setup(std::string filename, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; void report_timing_setup(std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; - void report_timing_setup(std::vector& paths, std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS, bool usePathElementSeparator=false) const; + void report_timing_setup(std::vector& paths, std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; void report_timing_hold(std::string filename, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; void report_timing_hold(std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; - void report_timing_hold(std::vector& paths, std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS, bool usePathElementSeparator=false) const; + void report_timing_hold(std::vector& paths, std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; void report_skew_setup(std::string filename, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const; void report_skew_setup(std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const; @@ -96,9 +96,9 @@ class TimingReporter { }; private: - void report_timing(std::ostream& os, const std::vector& paths, bool usePathElementSeparator = false) const; + void report_timing(std::ostream& os, const std::vector& paths) const; - void report_timing_path(std::ostream& os, const TimingPath& path, bool usePathElementSeparator = false) const; + void report_timing_path(std::ostream& os, const TimingPath& path) const; void report_unconstrained(std::ostream& os, const NodeType type, const detail::TagRetriever& tag_retriever) const; @@ -125,8 +125,7 @@ class TimingReporter { const TimingSubPath& subpath, DomainId domain, TimingType timing_type, - Time path, - bool usePathElementSeparator = false) const; + Time path) const; Time report_timing_data_required_element(std::ostream& os, detail::ReportTimingPathHelper& path_helper, From 2192ee3f502962babad9d79760e10d73e3e19aec Mon Sep 17 00:00:00 2001 From: Oleksandr Date: Thu, 28 Mar 2024 13:34:30 +0200 Subject: [PATCH 09/10] minimize diff in tatum/TimingReporter.cpp --- libtatum/tatum/TimingReporter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libtatum/tatum/TimingReporter.cpp b/libtatum/tatum/TimingReporter.cpp index ac352f3..69c9ba0 100644 --- a/libtatum/tatum/TimingReporter.cpp +++ b/libtatum/tatum/TimingReporter.cpp @@ -633,6 +633,7 @@ Time TimingReporter::report_timing_data_arrival_subpath(std::ostream& os, //Launch data for(const TimingPathElem& path_elem : subpath.elements()) { + //Ask the application for a detailed breakdown of the edge delays auto delay_breakdown = name_resolver_.edge_delay_breakdown(path_elem.incomming_edge(), delay_type); if (!delay_breakdown.components.empty()) { From 3ac1fde33bc0b6f7e8dad6eb305b8f1cc45c6a14 Mon Sep 17 00:00:00 2001 From: AlexandreSinger Date: Mon, 27 May 2024 12:22:57 -0400 Subject: [PATCH 10/10] [Warnings] Removed Deprecated STD Iterator From Timing Tags --- libtatum/tatum/tags/TimingTags.hpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libtatum/tatum/tags/TimingTags.hpp b/libtatum/tatum/tags/TimingTags.hpp index 192442c..afab50f 100644 --- a/libtatum/tatum/tags/TimingTags.hpp +++ b/libtatum/tatum/tags/TimingTags.hpp @@ -1,4 +1,5 @@ #pragma once +#include #include #include @@ -104,15 +105,15 @@ class TimingTags { //Iterator definition template - class Iterator : public std::iterator { + class Iterator { friend TimingTags; public: - using value_type = typename std::iterator::value_type; - using difference_type = typename std::iterator::difference_type; - using pointer = typename std::iterator::pointer; - using reference = typename std::iterator::reference; - using iterator_category = typename std::iterator::iterator_category; - public: + using iterator_category = std::random_access_iterator_tag; + using difference_type = std::ptrdiff_t; + using value_type = T; + using pointer = T*; + using reference = T&; + Iterator(): p_(nullptr) {} Iterator(pointer p): p_(p) {} Iterator(const Iterator& other): p_(other.p_) {} @@ -143,7 +144,7 @@ class TimingTags { friend bool operator>=(Iterator lhs, Iterator rhs) { return lhs.p_ >= rhs.p_; } friend void swap(Iterator lhs, Iterator rhs) { std::swap(lhs.p_, rhs.p_); } private: - T* p_ = nullptr; + pointer p_ = nullptr; }; private: