diff --git a/.gitignore b/.gitignore index c08a6d12009..f0a4ccd7a5d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,7 @@ bin/ # CMakeCache.txt CMakeFiles -build +build*/ # #VTR Tasks diff --git a/.gitpod.Dockerfile b/.gitpod.Dockerfile new file mode 100644 index 00000000000..21cd9885e8e --- /dev/null +++ b/.gitpod.Dockerfile @@ -0,0 +1,39 @@ +FROM gitpod/workspace-full:latest + +USER root +# Install util tools. +RUN apt-get update \ + && apt-get install -y \ + apt-utils \ + sudo \ + git \ + less \ + libfmt-dev \ + libspdlog-dev \ + lcov \ + binutils \ + binutils-gold \ + build-essential \ + flex \ + fontconfig \ + libcairo2-dev \ + libgtk-3-dev \ + libevent-dev \ + libfontconfig1-dev \ + liblist-moreutils-perl \ + libncurses5-dev \ + libx11-dev \ + libxft-dev \ + libxml++2.6-dev \ + python-lxml \ + qt5-default \ + wget \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + + +# Give back control +USER root + +# Cleaning +RUN apt-get clean diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000000..7a15128a921 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1,10 @@ +image: + file: .gitpod.Dockerfile +tasks: +- command: pyenv global 3.7.4 && + chmod +x envconfig.sh + +vscode: + extensions: + - ms-vscode.cmake-tools@1.2.3:qLtqI3aUcEBX9EpuK0ZCyw== + - ms-vscode.cpptools@0.26.2:Pq/tmf2WN3SanVzB4xZc1g== \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index dfa818ac22e..401fabc2559 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -396,3 +396,12 @@ list(APPEND DIRS_TO_FORMAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/libs/libvtrutil") list(APPEND DIRS_TO_FORMAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/libs/libpugiutil") list(APPEND DIRS_TO_FORMAT_CPP "${CMAKE_CURRENT_SOURCE_DIR}/libs/liblog") include(AutoClangFormat) + +# Adds convenience methods, see cmake/cleanCppExtensions.cmake +# include(cleanCppExtensions) + +# Creates options to turn on sanitizers, see cmake/sanitizers.cmake +# include(sanitizers) + +# Adds misc targets: format, cppcheck, tidy, see cmake/cleanCppExtensions.cmake +# addMiscTargets() diff --git a/ODIN_II/SRC/Hashtable.cpp b/ODIN_II/SRC/Hashtable.cpp index b5009ede6ff..d25f7ac2adc 100644 --- a/ODIN_II/SRC/Hashtable.cpp +++ b/ODIN_II/SRC/Hashtable.cpp @@ -30,16 +30,16 @@ OTHER DEALINGS IN THE SOFTWARE. void Hashtable::destroy_free_items() { - for(auto kv: my_map) + for(const auto& kv: my_map) vtr::free(kv.second); } -void Hashtable::add(std::string key, void *item) +void Hashtable::add(const std::string& key, void *item) { this->my_map.insert({key,item}); } -void* Hashtable::remove(std::string key) +void* Hashtable::remove(const std::string& key) { void *value = NULL; auto v = this->my_map.find(key); @@ -51,7 +51,7 @@ void* Hashtable::remove(std::string key) return value; } -void* Hashtable::get(std::string key) +void* Hashtable::get(const std::string& key) { void *value = NULL; auto v = this->my_map.find(key); diff --git a/ODIN_II/SRC/ast_util.cpp b/ODIN_II/SRC/ast_util.cpp index 438d1920f8a..6b979a5485f 100644 --- a/ODIN_II/SRC/ast_util.cpp +++ b/ODIN_II/SRC/ast_util.cpp @@ -29,6 +29,7 @@ OTHER DEALINGS IN THE SOFTWARE. #include #include #include +#include #include "odin_globals.h" #include "odin_types.h" @@ -523,7 +524,7 @@ void change_to_number_node(ast_node_t *node, VNumber number) node->type = NUMBERS; node->types.identifier = temp_ident; - node->types.vnumber = new VNumber(number); + node->types.vnumber = new VNumber(std::move(number)); } /*--------------------------------------------------------------------------------------------- diff --git a/ODIN_II/SRC/hierarchy_util.cpp b/ODIN_II/SRC/hierarchy_util.cpp index 05c11654fec..5e866255999 100644 --- a/ODIN_II/SRC/hierarchy_util.cpp +++ b/ODIN_II/SRC/hierarchy_util.cpp @@ -6,7 +6,7 @@ STRING_CACHE *copy_param_table_sc(STRING_CACHE *to_copy); ast_node_t *resolve_hierarchical_name_reference_by_path_search(sc_hierarchy *local_ref, std::string identifier); -ast_node_t *resolve_hierarchical_name_reference_by_upward_search(sc_hierarchy *local_ref, std::string identifier); +ast_node_t *resolve_hierarchical_name_reference_by_upward_search(sc_hierarchy *local_ref, const std::string& identifier); sc_hierarchy *init_sc_hierarchy() { @@ -326,7 +326,7 @@ ast_node_t *resolve_hierarchical_name_reference_by_path_search(sc_hierarchy *loc /*--------------------------------------------------------------------------- * (function: resolve_hierarchical_name_reference_by_upward_search) *-------------------------------------------------------------------------*/ -ast_node_t *resolve_hierarchical_name_reference_by_upward_search(sc_hierarchy *local_ref, std::string identifier) +ast_node_t *resolve_hierarchical_name_reference_by_upward_search(sc_hierarchy *local_ref, const std::string& identifier) { if (!identifier.empty()) { diff --git a/ODIN_II/SRC/implicit_memory.cpp b/ODIN_II/SRC/implicit_memory.cpp index b396525efe1..fa33fc803e8 100644 --- a/ODIN_II/SRC/implicit_memory.cpp +++ b/ODIN_II/SRC/implicit_memory.cpp @@ -211,7 +211,7 @@ void free_implicit_memory_index_and_finalize_memories() if (!implicit_memories.empty()) { - for (auto mem_it : implicit_memories) + for (const auto& mem_it : implicit_memories) { finalize_implicit_memory(mem_it.second); vtr::free(mem_it.second->name); diff --git a/ODIN_II/SRC/include/Hashtable.hpp b/ODIN_II/SRC/include/Hashtable.hpp index 228f41e39a1..86856f8fe82 100644 --- a/ODIN_II/SRC/include/Hashtable.hpp +++ b/ODIN_II/SRC/include/Hashtable.hpp @@ -35,11 +35,11 @@ class Hashtable public: // Adds an item to the hashtable. - void add (std::string key, void *item); + void add (const std::string& key, void *item); // Removes an item from the hashtable. If the item is not present, a null pointer is returned. - void* remove (std::string key); + void* remove (const std::string& key); // Gets an item from the hashtable without removing it. If the item is not present, a null pointer is returned. - void* get (std::string key); + void* get (const std::string& key); // Check to see if the hashtable is empty. bool is_empty (); // calls free on each item. diff --git a/ODIN_II/SRC/include/netlist_visualizer.h b/ODIN_II/SRC/include/netlist_visualizer.h index 590f9ea8e5c..64308a9933c 100644 --- a/ODIN_II/SRC/include/netlist_visualizer.h +++ b/ODIN_II/SRC/include/netlist_visualizer.h @@ -4,7 +4,7 @@ #include #include "odin_types.h" -void graphVizOutputNetlist(std::string path, const char* name, short marker_value, netlist_t *input_netlist); -void graphVizOutputCombinationalNet(std::string path, const char* name, short marker_value, nnode_t *current_node); +void graphVizOutputNetlist(const std::string& path, const char* name, short marker_value, netlist_t *input_netlist); +void graphVizOutputCombinationalNet(const std::string& path, const char* name, short marker_value, nnode_t *current_node); #endif diff --git a/ODIN_II/SRC/include/node_creation_library.h b/ODIN_II/SRC/include/node_creation_library.h index 4ce9631cde3..babd38a4920 100644 --- a/ODIN_II/SRC/include/node_creation_library.h +++ b/ODIN_II/SRC/include/node_creation_library.h @@ -23,7 +23,7 @@ char *node_name(nnode_t *node, char *instance_prefix_name); char *hard_node_name(nnode_t *node, char *instance_name_prefix, char *hb_name, char *hb_inst); nnode_t *make_mult_block(nnode_t *node, short mark); -edge_type_e edge_type_blif_enum(std::string edge_kind_str); +edge_type_e edge_type_blif_enum(const std::string& edge_kind_str); const char *edge_type_blif_str(nnode_t *node); #endif diff --git a/ODIN_II/SRC/include/odin_util.h b/ODIN_II/SRC/include/odin_util.h index 173cfea9bf1..f69fccbd8ea 100644 --- a/ODIN_II/SRC/include/odin_util.h +++ b/ODIN_II/SRC/include/odin_util.h @@ -9,9 +9,9 @@ long shift_left_value_with_overflow_check(long input_value, long shift_by); -std::string get_file_extension(std::string input_file); -void create_directory(std::string path); -void assert_supported_file_extension(std::string input_file, int line_number, int file_number); +std::string get_file_extension(const std::string& input_file); +void create_directory(const std::string& path); +void assert_supported_file_extension(const std::string& input_file, int line_number, int file_number); FILE *open_file(const char *file_name, const char *open_type); const char *name_based_on_op(operation_list op); @@ -66,7 +66,7 @@ double wall_time(); int print_progress_bar(double completion, int position, int length, double time); void trim_string(char* string, const char *chars); -bool only_one_is_true(std::vector tested); +bool only_one_is_true(const std::vector& tested); int odin_sprintf (char *s, const char *format, ...); void passed_verify_i_o_availabilty(nnode_t *node, int expected_input_size, int expected_output_size, const char *current_src, int line_src); diff --git a/ODIN_II/SRC/include/parse_making_ast.h b/ODIN_II/SRC/include/parse_making_ast.h index 8a08c51c17a..8ffc4e48cbc 100644 --- a/ODIN_II/SRC/include/parse_making_ast.h +++ b/ODIN_II/SRC/include/parse_making_ast.h @@ -97,7 +97,7 @@ ast_node_t *newDefparam(ids id, ast_node_t *val, int line_number); void next_parsed_verilog_file(ast_node_t *file_items_list); /* VISUALIZATION */ -void graphVizOutputAst(std::string path, ast_node_t *top); +void graphVizOutputAst(const std::string& path, ast_node_t *top); void graphVizOutputAst_traverse_node(FILE *fp, ast_node_t *node, ast_node_t *from, int from_num); #endif diff --git a/ODIN_II/SRC/multipliers.cpp b/ODIN_II/SRC/multipliers.cpp index 2c2dc4993d4..c4ac62d476a 100644 --- a/ODIN_II/SRC/multipliers.cpp +++ b/ODIN_II/SRC/multipliers.cpp @@ -399,7 +399,7 @@ void instantiate_hard_multiplier(nnode_t *node, short mark, netlist_t * /*netlis declare_hard_multiplier(node); - std::string node_name = ""; + std::string node_name; if( node->name ) { node_name = node->name; diff --git a/ODIN_II/SRC/netlist_create_from_ast.cpp b/ODIN_II/SRC/netlist_create_from_ast.cpp index fd57ac6017a..1ebb017d5ea 100644 --- a/ODIN_II/SRC/netlist_create_from_ast.cpp +++ b/ODIN_II/SRC/netlist_create_from_ast.cpp @@ -231,8 +231,8 @@ ast_node_t *find_top_module() /* check for which module wasn't marked as instantiated...this one will be the top */ - std::string module_name_list(""); - std::string desired_module(""); + std::string module_name_list; + std::string desired_module; bool found_desired_module = false; if ( global_args.top_level_module_name.provenance() == argparse::Provenance::SPECIFIED ) @@ -243,7 +243,7 @@ ast_node_t *find_top_module() for (i = 0; i < num_modules ; i++) { - std::string current_module = ""; + std::string current_module; if( ast_modules[i]->children[0]->types.identifier ) { @@ -3180,7 +3180,7 @@ signal_list_t *assignment_alias(ast_node_t* assignment, char *instance_name_pref if(address->count > right_memory->addr_width) { - std::string unused_pins_name = ""; + std::string unused_pins_name; for(long i = right_memory->addr_width; i < address->count; i++) { if (address->pins && address->pins[i] && address->pins[i]->name) @@ -3275,7 +3275,7 @@ signal_list_t *assignment_alias(ast_node_t* assignment, char *instance_name_pref { if(address->count > left_memory->addr_width) { - std::string unused_pins_name = ""; + std::string unused_pins_name; for(long i = left_memory->addr_width; i < address->count; i++) { if (address->pins && address->pins[i] && address->pins[i]->name) diff --git a/ODIN_II/SRC/netlist_visualizer.cpp b/ODIN_II/SRC/netlist_visualizer.cpp index 8fe2dd8e564..9b4e51ecee5 100644 --- a/ODIN_II/SRC/netlist_visualizer.cpp +++ b/ODIN_II/SRC/netlist_visualizer.cpp @@ -43,7 +43,7 @@ void backward_traversal_net_graph_display(FILE *out, short marker_value, nnode_t /*--------------------------------------------------------------------------------------------- * (function: graphVizOutputNetlist) *-------------------------------------------------------------------------------------------*/ -void graphVizOutputNetlist(std::string path, const char* name, short marker_value, netlist_t *netlist) +void graphVizOutputNetlist(const std::string& path, const char* name, short marker_value, netlist_t *netlist) { char path_and_file[4096]; FILE *fp; @@ -185,7 +185,7 @@ void depth_first_traverse_visualize(nnode_t *node, FILE *fp, short traverse_mark /*--------------------------------------------------------------------------------------------- * (function: graphVizOutputCobinationalNet) *-------------------------------------------------------------------------------------------*/ -void graphVizOutputCombinationalNet(std::string path, const char* name, short marker_value, nnode_t *current_node) +void graphVizOutputCombinationalNet(const std::string& path, const char* name, short marker_value, nnode_t *current_node) { char path_and_file[4096]; FILE *fp; diff --git a/ODIN_II/SRC/node_creation_library.cpp b/ODIN_II/SRC/node_creation_library.cpp index bcb3cf7c940..b9a521c68b7 100644 --- a/ODIN_II/SRC/node_creation_library.cpp +++ b/ODIN_II/SRC/node_creation_library.cpp @@ -261,7 +261,7 @@ const char *edge_type_blif_str(nnode_t *node) } } -edge_type_e edge_type_blif_enum(std::string edge_kind_str) +edge_type_e edge_type_blif_enum(const std::string& edge_kind_str) { if (edge_kind_str == "fe") return FALLING_EDGE_SENSITIVITY; diff --git a/ODIN_II/SRC/odin_error.cpp b/ODIN_II/SRC/odin_error.cpp index fc92433e2d8..c145a0849a5 100644 --- a/ODIN_II/SRC/odin_error.cpp +++ b/ODIN_II/SRC/odin_error.cpp @@ -48,7 +48,7 @@ static std::string make_marker_from_str(std::string str, int column) static void print_culprit_line(long column, long line_number, long file) { - std::string culprit_line = ""; + std::string culprit_line; if (file >= 0 && file < include_file_names.size() && line_number >= 0) { diff --git a/ODIN_II/SRC/odin_ii.cpp b/ODIN_II/SRC/odin_ii.cpp index 8500eb4921b..f6b5bed989f 100644 --- a/ODIN_II/SRC/odin_ii.cpp +++ b/ODIN_II/SRC/odin_ii.cpp @@ -336,7 +336,7 @@ int terminate_odin_ii(netlist_t *odin_netlist) } struct ParseInitRegState { - int from_str(std::string str) + int from_str(const std::string& str) { if (str == "0") return 0; else if (str == "1") return 1; diff --git a/ODIN_II/SRC/odin_util.cpp b/ODIN_II/SRC/odin_util.cpp index d3cb94dfb0e..2a939b07fd2 100644 --- a/ODIN_II/SRC/odin_util.cpp +++ b/ODIN_II/SRC/odin_util.cpp @@ -57,7 +57,7 @@ long shift_left_value_with_overflow_check(long input_value, long shift_by) return input_value << shift_by; } -std::string get_file_extension(std::string input_file) +std::string get_file_extension(const std::string& input_file) { auto dot_location = input_file.find_last_of('.'); if( dot_location != std::string::npos ) @@ -70,7 +70,7 @@ std::string get_file_extension(std::string input_file) } } -void create_directory(std::string path) +void create_directory(const std::string& path) { // CREATE OUTPUT DIRECTORY int error_code = 0; @@ -86,7 +86,7 @@ void create_directory(std::string path) } } -void assert_supported_file_extension(std::string input_file, int line_number, int file_number) +void assert_supported_file_extension(const std::string& input_file, int line_number, int file_number) { bool supported = false; std::string extension = get_file_extension(input_file); @@ -97,7 +97,7 @@ void assert_supported_file_extension(std::string input_file, int line_number, in if(! supported) { - std::string supported_extension_list = ""; + std::string supported_extension_list; for(int i=0; i tested) +bool only_one_is_true(const std::vector& tested) { bool previous_value = false; for(bool next_value: tested) diff --git a/ODIN_II/SRC/output_blif.cpp b/ODIN_II/SRC/output_blif.cpp index 7b64ace9a4a..d95e83f1c36 100644 --- a/ODIN_II/SRC/output_blif.cpp +++ b/ODIN_II/SRC/output_blif.cpp @@ -138,7 +138,7 @@ void output_blif(const char *file_name, netlist_t *netlist) /* open the file for output */ if (global_args.high_level_block.provenance() == argparse::Provenance::SPECIFIED ) { - std::string out_file = ""; + std::string out_file; out_file = out_file + file_name + "_" + global_args.high_level_block.value() + ".blif"; out = fopen(out_file.c_str(), "w+"); } diff --git a/ODIN_II/SRC/parse_making_ast.cpp b/ODIN_II/SRC/parse_making_ast.cpp index aacfef8588a..ddda99fdfc0 100644 --- a/ODIN_II/SRC/parse_making_ast.cpp +++ b/ODIN_II/SRC/parse_making_ast.cpp @@ -2069,7 +2069,7 @@ int unique_label_count; /*--------------------------------------------------------------------------- * (function: graphVizOutputAst) *-------------------------------------------------------------------------*/ -void graphVizOutputAst(std::string path, ast_node_t *top) +void graphVizOutputAst(const std::string& path, ast_node_t *top) { char path_and_file[4096]; FILE *fp; diff --git a/ODIN_II/SRC/read_blif.cpp b/ODIN_II/SRC/read_blif.cpp index 989d1fff894..5601f3e8b7a 100644 --- a/ODIN_II/SRC/read_blif.cpp +++ b/ODIN_II/SRC/read_blif.cpp @@ -321,7 +321,7 @@ void create_latch_node_and_driver(FILE *file, Hashtable *output_nets_hash) } else { - std::string line = ""; + std::string line; for(int i=0; i< input_token_count; i++) { line += names[i]; diff --git a/ODIN_II/SRC/simulate_blif.cpp b/ODIN_II/SRC/simulate_blif.cpp index e7f5113aa46..2fef53c452c 100644 --- a/ODIN_II/SRC/simulate_blif.cpp +++ b/ODIN_II/SRC/simulate_blif.cpp @@ -2170,7 +2170,7 @@ static void instantiate_memory(nnode_t *node, long data_width, long addr_width) } } -static int parse_mif_radix(std::string radix) +static int parse_mif_radix(const std::string& radix) { return (radix == "HEX") ? 16: (radix == "DEC") ? 10: @@ -2759,7 +2759,7 @@ static test_vector *parse_test_vector(char *buffer) * * If you want better randomness, call srand at some point. */ -static bool contains_a_substr_of_name(std::vector held, const char *name_in) +static bool contains_a_substr_of_name(const std::vector& held, const char *name_in) { if(!name_in) return false; diff --git a/README.md b/README.md index 3a3836a4752..3756b1f1638 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ # Verilog to Routing (VTR) +[![Gitpod Ready-to-Code](https://img.shields.io/badge/Gitpod-Ready--to--Code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/Loksu/vtr-verilog-to-routing) [![Build Status](https://travis-ci.com/verilog-to-routing/vtr-verilog-to-routing.svg?branch=master)](https://travis-ci.org/verilog-to-routing/vtr-verilog-to-routing) [![Documentation Status](https://readthedocs.org/projects/vtr/badge/?version=latest)](http://docs.verilogtorouting.org/en/latest/?badge=latest) ## Introduction diff --git a/abc/src/base/abci/abcTiming.c b/abc/src/base/abci/abcTiming.c index ae0e7f45dde..533e740a969 100644 --- a/abc/src/base/abci/abcTiming.c +++ b/abc/src/base/abci/abcTiming.c @@ -45,7 +45,7 @@ struct Abc_ManTime_t_ #define TOLERANCE 0.001 -static inline int Abc_FloatEqual( float x, float y ) { return fabs(x-y) < TOLERANCE; } +static inline int Abc_FloatEqual( float x, float y ) { return fabsf(x-y) < TOLERANCE; } // static functions static Abc_ManTime_t * Abc_ManTimeStart( Abc_Ntk_t * pNtk ); diff --git a/abc/src/map/scl/sclSize.c b/abc/src/map/scl/sclSize.c index ab3e3f3e62f..bb851514b6a 100644 --- a/abc/src/map/scl/sclSize.c +++ b/abc/src/map/scl/sclSize.c @@ -342,7 +342,7 @@ void Abc_SclTimeNode( SC_Man * p, Abc_Obj_t * pObj, int fDept ) if ( fDept ) { SC_Pair * pDepOut = Abc_SclObjDept( p, pObj ); - float EstDelta = p->EstLinear * log( Value ); + float EstDelta = p->EstLinear * logf( Value ); DeptRise = pDepOut->rise; DeptFall = pDepOut->fall; pDepOut->rise += EstDelta; @@ -374,7 +374,7 @@ void Abc_SclTimeNode( SC_Man * p, Abc_Obj_t * pObj, int fDept ) else { SC_Pair * pArrOut = Abc_SclObjTime( p, pObj ); - float EstDelta = p->EstLinear * log( Value ); + float EstDelta = p->EstLinear * logf( Value ); pArrOut->rise += EstDelta; pArrOut->fall += EstDelta; } @@ -864,7 +864,7 @@ void Abc_SclPrintBuffersOne( SC_Man * p, Abc_Obj_t * pObj, int nOffset ) printf( "L =%5.0f ff ", Abc_SclCountNonBufferLoad(p, pObj) ); printf( "Lx =%5.0f ff ", 100.0*Abc_SclCountNonBufferLoad(p, pObj)/p->EstLoadAve ); printf( "Dx =%5.0f ps ", Abc_SclCountNonBufferDelay(p, pObj)/Abc_SclCountNonBufferFanouts(pObj) - Abc_SclObjTimeOne(p, pObj, 1) ); - printf( "Cx =%5.0f ps", (Abc_SclCountNonBufferDelay(p, pObj)/Abc_SclCountNonBufferFanouts(pObj) - Abc_SclObjTimeOne(p, pObj, 1))/log(Abc_SclCountNonBufferLoad(p, pObj)/p->EstLoadAve) ); + printf( "Cx =%5.0f ps", (Abc_SclCountNonBufferDelay(p, pObj)/Abc_SclCountNonBufferFanouts(pObj) - Abc_SclObjTimeOne(p, pObj, 1))/logf(Abc_SclCountNonBufferLoad(p, pObj)/p->EstLoadAve) ); } printf( "\n" ); } diff --git a/blifexplorer/src/images/icon.png b/blifexplorer/src/images/icon.png index 93885d703f6..d3b1c06260a 100644 Binary files a/blifexplorer/src/images/icon.png and b/blifexplorer/src/images/icon.png differ diff --git a/blifexplorer/src/images/nodeTypes/ADDER_FUNC.png b/blifexplorer/src/images/nodeTypes/ADDER_FUNC.png index 77d381ec394..108822c6217 100644 Binary files a/blifexplorer/src/images/nodeTypes/ADDER_FUNC.png and b/blifexplorer/src/images/nodeTypes/ADDER_FUNC.png differ diff --git a/blifexplorer/src/images/nodeTypes/AND.png b/blifexplorer/src/images/nodeTypes/AND.png index cae73b50c1b..b485fc456a9 100644 Binary files a/blifexplorer/src/images/nodeTypes/AND.png and b/blifexplorer/src/images/nodeTypes/AND.png differ diff --git a/blifexplorer/src/images/nodeTypes/CARRY_FUNC.png b/blifexplorer/src/images/nodeTypes/CARRY_FUNC.png index 2c53eac8d36..d438751b7ff 100644 Binary files a/blifexplorer/src/images/nodeTypes/CARRY_FUNC.png and b/blifexplorer/src/images/nodeTypes/CARRY_FUNC.png differ diff --git a/blifexplorer/src/images/nodeTypes/Hadd.png b/blifexplorer/src/images/nodeTypes/Hadd.png index 93c0920bf3b..39f8f1c473b 100644 Binary files a/blifexplorer/src/images/nodeTypes/Hadd.png and b/blifexplorer/src/images/nodeTypes/Hadd.png differ diff --git a/blifexplorer/src/images/nodeTypes/Hmemory.png b/blifexplorer/src/images/nodeTypes/Hmemory.png index 85e312b1389..d94477e0f22 100644 Binary files a/blifexplorer/src/images/nodeTypes/Hmemory.png and b/blifexplorer/src/images/nodeTypes/Hmemory.png differ diff --git a/blifexplorer/src/images/nodeTypes/Hminus.png b/blifexplorer/src/images/nodeTypes/Hminus.png index f87f3ab1b22..adb90c5405f 100644 Binary files a/blifexplorer/src/images/nodeTypes/Hminus.png and b/blifexplorer/src/images/nodeTypes/Hminus.png differ diff --git a/blifexplorer/src/images/nodeTypes/Hmult.png b/blifexplorer/src/images/nodeTypes/Hmult.png index a1897ee73e6..f2252747b57 100644 Binary files a/blifexplorer/src/images/nodeTypes/Hmult.png and b/blifexplorer/src/images/nodeTypes/Hmult.png differ diff --git a/blifexplorer/src/images/nodeTypes/NAND.png b/blifexplorer/src/images/nodeTypes/NAND.png index 236109d9943..2928e389bd5 100644 Binary files a/blifexplorer/src/images/nodeTypes/NAND.png and b/blifexplorer/src/images/nodeTypes/NAND.png differ diff --git a/blifexplorer/src/images/nodeTypes/NOR.png b/blifexplorer/src/images/nodeTypes/NOR.png index f014480f3ce..5a8e9b33a72 100644 Binary files a/blifexplorer/src/images/nodeTypes/NOR.png and b/blifexplorer/src/images/nodeTypes/NOR.png differ diff --git a/blifexplorer/src/images/nodeTypes/OR.png b/blifexplorer/src/images/nodeTypes/OR.png index 618fa401e0a..6904d401c1e 100644 Binary files a/blifexplorer/src/images/nodeTypes/OR.png and b/blifexplorer/src/images/nodeTypes/OR.png differ diff --git a/blifexplorer/src/images/nodeTypes/XNOR.png b/blifexplorer/src/images/nodeTypes/XNOR.png index b0c5242bcdc..67f5e4507d3 100644 Binary files a/blifexplorer/src/images/nodeTypes/XNOR.png and b/blifexplorer/src/images/nodeTypes/XNOR.png differ diff --git a/blifexplorer/src/images/nodeTypes/XOR.png b/blifexplorer/src/images/nodeTypes/XOR.png index e90917b4969..d4bbee3214c 100644 Binary files a/blifexplorer/src/images/nodeTypes/XOR.png and b/blifexplorer/src/images/nodeTypes/XOR.png differ diff --git a/blifexplorer/src/images/nodeTypes/module.png b/blifexplorer/src/images/nodeTypes/module.png index b695c2b7e3e..473579bc853 100644 Binary files a/blifexplorer/src/images/nodeTypes/module.png and b/blifexplorer/src/images/nodeTypes/module.png differ diff --git a/cmake/modules/cleanCppExtensions.cmake b/cmake/modules/cleanCppExtensions.cmake new file mode 100644 index 00000000000..20ac5783d34 --- /dev/null +++ b/cmake/modules/cleanCppExtensions.cmake @@ -0,0 +1,190 @@ +# Helper macro for creating convenient targets +find_program(GDB_PATH gdb) + +# Adds -run and -dbg targets +macro(addRunAndDebugTargets TARGET) + add_custom_target(${TARGET}-run + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + USES_TERMINAL + DEPENDS ${TARGET} + COMMAND ./${TARGET}) + + # convenience run gdb target + if(GDB_PATH) + add_custom_target(${TARGET}-gdb + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + USES_TERMINAL + DEPENDS ${TARGET} + COMMAND ${GDB_PATH} ./${TARGET}) + endif() +endmacro() + +#------------------------------------------------------------------------------ +# Usefull for adding header only libraries +# Example usage: +# +# ExternalHeaderOnly_Add("Catch" +# "https://github.com/catchorg/Catch2.git" "master" "single_include/catch2") +# +# Use with: +# target_link_libraries(unittests Catch) +# This will add the INCLUDE_FOLDER_PATH to the `unittests` target. + +macro(ExternalHeaderOnly_Add LIBNAME REPOSITORY GIT_TAG INCLUDE_FOLDER_PATH) + ExternalProject_Add( + ${LIBNAME}_download + PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME} + GIT_REPOSITORY ${REPOSITORY} + # For shallow git clone (without downloading whole history) + # GIT_SHALLOW 1 + # For point at certain tag + GIT_TAG origin/${GIT_TAG} + #disables auto update on every build + UPDATE_DISCONNECTED 1 + #disable following + CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_DIR "" INSTALL_COMMAND "" + ) + # special target + add_custom_target(${LIBNAME}_update + COMMENT "Updated ${LIBNAME}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}/src/${LIBNAME}_download + COMMAND ${GIT_EXECUTABLE} fetch --recurse-submodules + COMMAND ${GIT_EXECUTABLE} reset --hard origin/${GIT_TAG} + COMMAND ${GIT_EXECUTABLE} submodule update --init --force --recursive --remote --merge + DEPENDS ${LIBNAME}_download) + + set(${LIBNAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}/src/${LIBNAME}_download/) + add_library(${LIBNAME} INTERFACE) + add_dependencies(${LIBNAME} ${LIBNAME}_download) + add_dependencies(update ${LIBNAME}_update) + target_include_directories(${LIBNAME} SYSTEM INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}/src/${LIBNAME}_download/${INCLUDE_FOLDER_PATH}) +endmacro() + +#------------------------------------------------------------------------------ +# This command will clone git repo during cmake setup phase, also adds +# ${LIBNAME}_update target into general update target. +# Example usage: +# +# ExternalDownloadNowGit(cpr https://github.com/finkandreas/cpr.git origin/master) +# add_subdirectory(${cpr_SOURCE_DIR}) +# + +macro(ExternalDownloadNowGit LIBNAME REPOSITORY GIT_TAG) + + set(${LIBNAME}_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}/src/${LIBNAME}_download/) + + # clone repository if not done + if(IS_DIRECTORY ${${LIBNAME}_SOURCE_DIR}) + message(STATUS "Already downloaded: ${REPOSITORY}") + else() + message(STATUS "Clonning: ${REPOSITORY}") + execute_process( + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMAND ${GIT_EXECUTABLE} clone --recursive ${REPOSITORY} ${LIBNAME}/src/${LIBNAME}_download + ) + # switch to target TAG and update submodules + execute_process( + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}/src/${LIBNAME}_download + COMMAND ${GIT_EXECUTABLE} reset --hard origin/${GIT_TAG} + COMMAND ${GIT_EXECUTABLE} submodule update --init --force --recursive --remote --merge + ) + endif() + + # special update target + add_custom_target(${LIBNAME}_update + COMMENT "Updated ${LIBNAME}" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/${LIBNAME}/src/${LIBNAME}_download + COMMAND ${GIT_EXECUTABLE} fetch --recurse-submodules + COMMAND ${GIT_EXECUTABLE} reset --hard origin/${GIT_TAG} + COMMAND ${GIT_EXECUTABLE} submodule update --init --force --recursive --remote --merge) + # Add this as dependency to the general update target + add_dependencies(update ${LIBNAME}_update) +endmacro() + +#------------------------------------------------------------------------------ +# Other MISC targets - formating, static analysis +# format, cppcheck, tidy +macro(addMiscTargets) + file(GLOB_RECURSE ALL_SOURCE_FILES *.cpp *.cc *.c) + file(GLOB_RECURSE ALL_HEADER_FILES *.h *.hpp) + + # Static analysis via clang-tidy target + # We check for program, since when it is not here, target makes no sense + find_program(TIDY_PATH clang-tidy PATHS /usr/local/Cellar/llvm/*/bin) + if(TIDY_PATH) + message(STATUS "clang-tidy - static analysis YES ") + add_custom_target(tidy + COMMAND ${TIDY_PATH} -header-filter=.* ${ALL_SOURCE_FILES} -p=./ ) + else() + message(STATUS "clang-tidy - static analysis NO ") + endif() + + # cpp check static analysis + find_program(CPPCHECK_PATH cppcheck) + if(CPPCHECK_PATH) + message(STATUS "cppcheck - static analysis YES ") + add_custom_target( + cppcheck + COMMAND ${CPPCHECK_PATH} + --enable=warning,performance,portability,information,missingInclude + --std=c++11 + --template=gcc + --verbose + --quiet + ${ALL_SOURCE_FILES} + ) + else() + message(STATUS "cppcheck - static analysis NO ") + endif() + + # run clang-format on all files + find_program(FORMAT_PATH clang-format) + if(FORMAT_PATH) + message(STATUS "clang-format - code formating YES ") + add_custom_target(format + COMMAND ${FORMAT_PATH} -i ${ALL_SOURCE_FILES} ${ALL_HEADER_FILES} ) + else() + message(STATUS "clang-format - code formating NO ") + endif() + + + # Does not work well, left here for future work, but it would still only + # provides same info as tidy, only in html form. + # + # Produces html analysis in *.plist dirs in build dir or build/source directory + # add_custom_target( + # analyze + # COMMAND rm -rf ../*.plist + # COMMAND rm -rf *.plist + # COMMAND clang-check -analyze -extra-arg -Xclang -extra-arg -analyzer-output=html + # ${ALL_SOURCE_FILES} + # -p=./ + # COMMAND echo "" + # ) +endmacro() + +#------------------------------------------------------------------------------ +# Force compilers, this was deprecated in CMake, but still comes handy sometimes +macro(FORCE_C_COMPILER compiler id) + set(CMAKE_C_COMPILER "${compiler}") + set(CMAKE_C_COMPILER_ID_RUN TRUE) + set(CMAKE_C_COMPILER_ID ${id}) + set(CMAKE_C_COMPILER_FORCED TRUE) + + # Set old compiler id variables. + if(CMAKE_C_COMPILER_ID MATCHES "GNU") + set(CMAKE_COMPILER_IS_GNUCC 1) + endif() +endmacro() + +macro(FORCE_CXX_COMPILER compiler id) + set(CMAKE_CXX_COMPILER "${compiler}") + set(CMAKE_CXX_COMPILER_ID_RUN TRUE) + set(CMAKE_CXX_COMPILER_ID ${id}) + set(CMAKE_CXX_COMPILER_FORCED TRUE) + + # Set old compiler id variables. + if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU") + set(CMAKE_COMPILER_IS_GNUCXX 1) + endif() +endmacro() diff --git a/cmake/modules/sanitizers.cmake b/cmake/modules/sanitizers.cmake new file mode 100644 index 00000000000..73d1d1ce35d --- /dev/null +++ b/cmake/modules/sanitizers.cmake @@ -0,0 +1,38 @@ + +#------------------------------------------------------------------------------ +# Clang and gcc sanitizers +if (CMAKE_CXX_COMPILER_ID MATCHES "Clang" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") + message(STATUS "Sanitizers:") + + option(ADDRESS_SANITIZER "description" OFF) + message(STATUS " + ADDRESS_SANITIZER ${ADDRESS_SANITIZER}") + if(ADDRESS_SANITIZER) + add_compile_options(-fsanitize=address -fno-omit-frame-pointer) + link_libraries(-fsanitize=address -fno-omit-frame-pointer) + endif() + + option(UB_SANITIZER "description" OFF) + message(STATUS " + UB_SANITIZER ${UB_SANITIZER}") + if(UB_SANITIZER) + add_compile_options(-fsanitize=undefined) + link_libraries(-fsanitize=undefined) + endif() + + option(THREAD_SANITIZER "description" OFF) + message(STATUS " + THREAD_SANITIZER ${THREAD_SANITIZER}") + if(THREAD_SANITIZER) + add_compile_options(-fsanitize=undefined) + link_libraries(-fsanitize=undefined) + endif() + + # Clang only + if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") + option(MEMORY_SANITIZER "description" OFF) + message(STATUS " + MEMORY_SANITIZER ${MEMORY_SANITIZER}") + if(MEMORY_SANITIZER) + add_compile_options(-fsanitize=memory -fno-omit-frame-pointer) + link_libraries(-fsanitize=memory -fno-omit-frame-pointer) + endif() + endif() +endif() + diff --git a/dev/odin2_helper/Makefile b/dev/odin2_helper/Makefile index 44951619c7c..2ad60a70c5e 100644 --- a/dev/odin2_helper/Makefile +++ b/dev/odin2_helper/Makefile @@ -9,7 +9,7 @@ default: $(EXE) run: Md5Core.vv $(EXE): $(EXE).c++ - g++ -Wall -Wextra -Werror -pedantic -std=c++11 $< -o $@ -ggdb -D_GLIBCXX_DEBUG + g++ -Wall -Wextra -Werror -pedantic -std=c++14 $< -o $@ -ggdb -D_GLIBCXX_DEBUG test: Md5Core.v less $< diff --git a/doc/src/arch/blank_fpga_grid.svg b/doc/src/arch/blank_fpga_grid.svg index 464580a0323..16f54f86b10 100644 --- a/doc/src/arch/blank_fpga_grid.svg +++ b/doc/src/arch/blank_fpga_grid.svg @@ -1,857 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/channel_distribution.png b/doc/src/arch/channel_distribution.png index be31b435dfa..5ab39f13654 100644 Binary files a/doc/src/arch/channel_distribution.png and b/doc/src/arch/channel_distribution.png differ diff --git a/doc/src/arch/col_fpga_grid.svg b/doc/src/arch/col_fpga_grid.svg index 8b782b5512e..b963c0a3c25 100644 --- a/doc/src/arch/col_fpga_grid.svg +++ b/doc/src/arch/col_fpga_grid.svg @@ -1,959 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - - - - - - - - - - - - - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/col_perim_fpga_grid.svg b/doc/src/arch/col_perim_fpga_grid.svg index 2c16b956465..cddf5010bdd 100644 --- a/doc/src/arch/col_perim_fpga_grid.svg +++ b/doc/src/arch/col_perim_fpga_grid.svg @@ -1,940 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - - - - - - - - - - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/complete_example.png b/doc/src/arch/complete_example.png index d833c5b57a5..a881431ef1f 100644 Binary files a/doc/src/arch/complete_example.png and b/doc/src/arch/complete_example.png differ diff --git a/doc/src/arch/corners_fpga_grid.svg b/doc/src/arch/corners_fpga_grid.svg index 76d40f6c6ad..43498a872c0 100644 --- a/doc/src/arch/corners_fpga_grid.svg +++ b/doc/src/arch/corners_fpga_grid.svg @@ -1,858 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/direct_example.png b/doc/src/arch/direct_example.png index bbab8df57fe..8bb9f6609d1 100644 Binary files a/doc/src/arch/direct_example.png and b/doc/src/arch/direct_example.png differ diff --git a/doc/src/arch/fill_fpga_grid.svg b/doc/src/arch/fill_fpga_grid.svg index aba8e0b093d..126feafeeb2 100644 --- a/doc/src/arch/fill_fpga_grid.svg +++ b/doc/src/arch/fill_fpga_grid.svg @@ -1,868 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/fpga_grid_example.svg b/doc/src/arch/fpga_grid_example.svg index 785c95d9bc2..06382d6bc0a 100644 --- a/doc/src/arch/fpga_grid_example.svg +++ b/doc/src/arch/fpga_grid_example.svg @@ -1,947 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - - - - - - - - - - - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/ipin_diagram.png b/doc/src/arch/ipin_diagram.png index 32ac26025cf..fe0742a84d1 100644 Binary files a/doc/src/arch/ipin_diagram.png and b/doc/src/arch/ipin_diagram.png differ diff --git a/doc/src/arch/mux_example.png b/doc/src/arch/mux_example.png index 041d0897d1f..ee8c6af59b1 100644 Binary files a/doc/src/arch/mux_example.png and b/doc/src/arch/mux_example.png differ diff --git a/doc/src/arch/pack_pattern_example.png b/doc/src/arch/pack_pattern_example.png index a2003cb7971..9548a6c6290 100644 Binary files a/doc/src/arch/pack_pattern_example.png and b/doc/src/arch/pack_pattern_example.png differ diff --git a/doc/src/arch/perimeter_fpga_grid.svg b/doc/src/arch/perimeter_fpga_grid.svg index 55a38a6d9d4..780486f5830 100644 --- a/doc/src/arch/perimeter_fpga_grid.svg +++ b/doc/src/arch/perimeter_fpga_grid.svg @@ -1,860 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - - - - - - - - - - - - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/region_incr_fpga_grid.svg b/doc/src/arch/region_incr_fpga_grid.svg index c9e3d9ea314..bee67a01cc1 100644 --- a/doc/src/arch/region_incr_fpga_grid.svg +++ b/doc/src/arch/region_incr_fpga_grid.svg @@ -1,896 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - - - - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/region_incr_mesh_fpga_grid.svg b/doc/src/arch/region_incr_mesh_fpga_grid.svg index 8e3cda07d80..98b6faaf0a0 100644 --- a/doc/src/arch/region_incr_mesh_fpga_grid.svg +++ b/doc/src/arch/region_incr_mesh_fpga_grid.svg @@ -1,917 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - - - - - - - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/region_repeat_fpga_grid.svg b/doc/src/arch/region_repeat_fpga_grid.svg index 2513b00bcf4..59b5463bffe 100644 --- a/doc/src/arch/region_repeat_fpga_grid.svg +++ b/doc/src/arch/region_repeat_fpga_grid.svg @@ -1,1022 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - - - - - - - - - - - - - - - - - - - - - - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/region_single_fpga_grid.svg b/doc/src/arch/region_single_fpga_grid.svg index ba73b2a411c..d328580c60e 100644 --- a/doc/src/arch/region_single_fpga_grid.svg +++ b/doc/src/arch/region_single_fpga_grid.svg @@ -1,924 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - - - - - - - - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/row_fpga_grid.svg b/doc/src/arch/row_fpga_grid.svg index 26e1fd50c91..64c33909de6 100644 --- a/doc/src/arch/row_fpga_grid.svg +++ b/doc/src/arch/row_fpga_grid.svg @@ -1,1024 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - - - - - - - - - - - - - - - - - - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/sb_locations.svg b/doc/src/arch/sb_locations.svg index 2a8fbd0bd54..7a3e1dd28ee 100644 --- a/doc/src/arch/sb_locations.svg +++ b/doc/src/arch/sb_locations.svg @@ -1,2043 +1 @@ - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - All - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - External - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Internal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - None - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - External FullInternal Straight - - - - +AllExternalInternalNoneExternal FullInternal Straight \ No newline at end of file diff --git a/doc/src/arch/sb_pattern.png b/doc/src/arch/sb_pattern.png index b25d40cb245..1cba0bb2a64 100644 Binary files a/doc/src/arch/sb_pattern.png and b/doc/src/arch/sb_pattern.png differ diff --git a/doc/src/arch/sb_types.svg b/doc/src/arch/sb_types.svg index 0d9369d035d..4c855283cb4 100644 --- a/doc/src/arch/sb_types.svg +++ b/doc/src/arch/sb_types.svg @@ -1,259 +1 @@ - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - Full - - - - - - - - Straight - - - - - - - - - - Turns - - - - None - - - +FullStraightTurnsNone \ No newline at end of file diff --git a/doc/src/arch/single_fpga_grid.svg b/doc/src/arch/single_fpga_grid.svg index 7db5c91a64f..23688a3b445 100644 --- a/doc/src/arch/single_fpga_grid.svg +++ b/doc/src/arch/single_fpga_grid.svg @@ -1,861 +1 @@ - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0 - W-1 - 0 - H-1 - - - +0W-10H-1 \ No newline at end of file diff --git a/doc/src/arch/switch_point_diagram.png b/doc/src/arch/switch_point_diagram.png index 2827a8b63b9..0016b03fd19 100644 Binary files a/doc/src/arch/switch_point_diagram.png and b/doc/src/arch/switch_point_diagram.png differ diff --git a/doc/src/arch/wireconn_num_conns_type_from.svg b/doc/src/arch/wireconn_num_conns_type_from.svg index 673fd2bb208..11120b78f8e 100644 --- a/doc/src/arch/wireconn_num_conns_type_from.svg +++ b/doc/src/arch/wireconn_num_conns_type_from.svg @@ -1,924 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - - - from - - - - to - - - - from - - - - to - - - - +fromtofromto \ No newline at end of file diff --git a/doc/src/arch/wireconn_num_conns_type_max.svg b/doc/src/arch/wireconn_num_conns_type_max.svg index 6d298687ca0..e27ec129913 100644 --- a/doc/src/arch/wireconn_num_conns_type_max.svg +++ b/doc/src/arch/wireconn_num_conns_type_max.svg @@ -1,1026 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - from - - - - to - - - - from - - - - to - - - - - - - - - - - - +fromtofromto \ No newline at end of file diff --git a/doc/src/arch/wireconn_num_conns_type_min.svg b/doc/src/arch/wireconn_num_conns_type_min.svg index e26bd3c6804..977d0e52c5a 100644 --- a/doc/src/arch/wireconn_num_conns_type_min.svg +++ b/doc/src/arch/wireconn_num_conns_type_min.svg @@ -1,920 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - from - - - - to - - - - from - - - - to - - - - +fromtofromto \ No newline at end of file diff --git a/doc/src/arch/wireconn_num_conns_type_to.svg b/doc/src/arch/wireconn_num_conns_type_to.svg index 4c31bbc8543..9218a0ac1e5 100644 --- a/doc/src/arch/wireconn_num_conns_type_to.svg +++ b/doc/src/arch/wireconn_num_conns_type_to.svg @@ -1,938 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - from - - - - to - - - - from - - - - to - - - - - - - +fromtofromto \ No newline at end of file diff --git a/doc/src/tutorials/arch/classic_ble.jpg b/doc/src/tutorials/arch/classic_ble.jpg index afa948c512c..8f7ac095f63 100644 Binary files a/doc/src/tutorials/arch/classic_ble.jpg and b/doc/src/tutorials/arch/classic_ble.jpg differ diff --git a/doc/src/tutorials/arch/configurable_block_ram_routing.jpg b/doc/src/tutorials/arch/configurable_block_ram_routing.jpg index 93d952d5c28..c4c2c19a59f 100644 Binary files a/doc/src/tutorials/arch/configurable_block_ram_routing.jpg and b/doc/src/tutorials/arch/configurable_block_ram_routing.jpg differ diff --git a/doc/src/tutorials/arch/configurable_memory.jpg b/doc/src/tutorials/arch/configurable_memory.jpg index d7d60f63b7a..67964e48b71 100644 Binary files a/doc/src/tutorials/arch/configurable_memory.jpg and b/doc/src/tutorials/arch/configurable_memory.jpg differ diff --git a/doc/src/tutorials/arch/configurable_memory_modes.jpg b/doc/src/tutorials/arch/configurable_memory_modes.jpg index 55440d4cb10..aac4a9f6a4e 100644 Binary files a/doc/src/tutorials/arch/configurable_memory_modes.jpg and b/doc/src/tutorials/arch/configurable_memory_modes.jpg differ diff --git a/doc/src/tutorials/arch/fracturable_multiplier.jpg b/doc/src/tutorials/arch/fracturable_multiplier.jpg index a206f5ac820..75857ae5a9f 100644 Binary files a/doc/src/tutorials/arch/fracturable_multiplier.jpg and b/doc/src/tutorials/arch/fracturable_multiplier.jpg differ diff --git a/doc/src/tutorials/arch/fracturable_multiplier_cluster.jpg b/doc/src/tutorials/arch/fracturable_multiplier_cluster.jpg index fd008b43e6a..d675c1907f1 100644 Binary files a/doc/src/tutorials/arch/fracturable_multiplier_cluster.jpg and b/doc/src/tutorials/arch/fracturable_multiplier_cluster.jpg differ diff --git a/doc/src/tutorials/arch/fracturable_multiplier_slice.jpg b/doc/src/tutorials/arch/fracturable_multiplier_slice.jpg index 930179b70b8..0e7ec7981a5 100644 Binary files a/doc/src/tutorials/arch/fracturable_multiplier_slice.jpg and b/doc/src/tutorials/arch/fracturable_multiplier_slice.jpg differ diff --git a/doc/src/tutorials/arch/soft_logic_cluster.jpg b/doc/src/tutorials/arch/soft_logic_cluster.jpg index 55c1d7ac827..968e44b51a7 100644 Binary files a/doc/src/tutorials/arch/soft_logic_cluster.jpg and b/doc/src/tutorials/arch/soft_logic_cluster.jpg differ diff --git a/doc/src/tutorials/arch/timing_modeling/dff.svg b/doc/src/tutorials/arch/timing_modeling/dff.svg index f7bea2e1ac8..4dbba52f0af 100644 --- a/doc/src/tutorials/arch/timing_modeling/dff.svg +++ b/doc/src/tutorials/arch/timing_modeling/dff.svg @@ -1,727 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - D - - - Q - clk - Tsu - Tcq - - +DQclkTsuTcq \ No newline at end of file diff --git a/doc/src/tutorials/arch/timing_modeling/fa.svg b/doc/src/tutorials/arch/timing_modeling/fa.svg index 9c728670dc0..ed190e673f3 100644 --- a/doc/src/tutorials/arch/timing_modeling/fa.svg +++ b/doc/src/tutorials/arch/timing_modeling/fa.svg @@ -1,751 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - sum - - - - cin - - - b - - - - a - - - - - cout - - - - - - - +sumcinbacout \ No newline at end of file diff --git a/doc/src/tutorials/arch/timing_modeling/mixed_sp_ram.svg b/doc/src/tutorials/arch/timing_modeling/mixed_sp_ram.svg index be063385ef2..98a6aaa4905 100644 --- a/doc/src/tutorials/arch/timing_modeling/mixed_sp_ram.svg +++ b/doc/src/tutorials/arch/timing_modeling/mixed_sp_ram.svg @@ -1,837 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - data - - clk - - - - - - - - - - addr - - - - - - - - - - - - we - - - - out - - +dataclkaddrweout \ No newline at end of file diff --git a/doc/src/tutorials/arch/timing_modeling/multiclock_dp_ram.svg b/doc/src/tutorials/arch/timing_modeling/multiclock_dp_ram.svg index e8901f51cbe..18859773e6e 100644 --- a/doc/src/tutorials/arch/timing_modeling/multiclock_dp_ram.svg +++ b/doc/src/tutorials/arch/timing_modeling/multiclock_dp_ram.svg @@ -1,932 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - clk2 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - data2 - - - - - - - - - - - - - - - - - - data1 - clk1 - addr1 - - we1 - - addr2 - - - - +clk2data2data1clk1addr1we1addr2 \ No newline at end of file diff --git a/doc/src/tutorials/arch/timing_modeling/seq_comb_sp_ram.svg b/doc/src/tutorials/arch/timing_modeling/seq_comb_sp_ram.svg index 414998425ce..ff6748b399f 100644 --- a/doc/src/tutorials/arch/timing_modeling/seq_comb_sp_ram.svg +++ b/doc/src/tutorials/arch/timing_modeling/seq_comb_sp_ram.svg @@ -1,838 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - data - - clk - - - - - - - - - - addr - - - we - - - out - - - - - - - - - - - +dataclkaddrweout \ No newline at end of file diff --git a/doc/src/tutorials/arch/timing_modeling/seq_sp_ram.svg b/doc/src/tutorials/arch/timing_modeling/seq_sp_ram.svg index 0c044ad1988..46d353845b2 100644 --- a/doc/src/tutorials/arch/timing_modeling/seq_sp_ram.svg +++ b/doc/src/tutorials/arch/timing_modeling/seq_sp_ram.svg @@ -1,868 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - image/svg+xml - - - - - - - - - - - - - - - - - - - - - - - - - - - data - - clk - - - - - - - - - - addr - - - - - - - - - - - - we - - - - out - - - - - - - - - - - +dataclkaddrweout \ No newline at end of file diff --git a/doc/src/tutorials/arch/v6_logic_slice.jpg b/doc/src/tutorials/arch/v6_logic_slice.jpg index 75c7069f3af..4e8ec6b646f 100644 Binary files a/doc/src/tutorials/arch/v6_logic_slice.jpg and b/doc/src/tutorials/arch/v6_logic_slice.jpg differ diff --git a/doc/src/tutorials/timing_simulation/timing_simulation.png b/doc/src/tutorials/timing_simulation/timing_simulation.png index cee7d7d4fa4..5f4d65e9963 100644 Binary files a/doc/src/tutorials/timing_simulation/timing_simulation.png and b/doc/src/tutorials/timing_simulation/timing_simulation.png differ diff --git a/doc/src/vpr/fpga_coordinate_system.png b/doc/src/vpr/fpga_coordinate_system.png index b38adfa5ead..942617a03dd 100644 Binary files a/doc/src/vpr/fpga_coordinate_system.png and b/doc/src/vpr/fpga_coordinate_system.png differ diff --git a/doc/src/vpr/path_2.png b/doc/src/vpr/path_2.png index 16ef078b5d5..a0058a58016 100644 Binary files a/doc/src/vpr/path_2.png and b/doc/src/vpr/path_2.png differ diff --git a/doc/src/vtr/power_estimation/power_cb.svg b/doc/src/vtr/power_estimation/power_cb.svg index 29c83dbc05b..591c235cfd4 100644 --- a/doc/src/vtr/power_estimation/power_cb.svg +++ b/doc/src/vtr/power_estimation/power_cb.svg @@ -1,287 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/doc/src/vtr/power_estimation/power_clock_network.svg b/doc/src/vtr/power_estimation/power_clock_network.svg index 61bd860f141..e9634ea9d79 100644 --- a/doc/src/vtr/power_estimation/power_clock_network.svg +++ b/doc/src/vtr/power_estimation/power_clock_network.svg @@ -1,243 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/doc/src/vtr/power_estimation/power_flow.svg b/doc/src/vtr/power_estimation/power_flow.svg index 6f7d482242f..639c174d081 100644 --- a/doc/src/vtr/power_estimation/power_flow.svg +++ b/doc/src/vtr/power_estimation/power_flow.svg @@ -1,1965 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/doc/src/vtr/power_estimation/power_local_interconnect.svg b/doc/src/vtr/power_estimation/power_local_interconnect.svg index d6717296b81..be03d919fac 100644 --- a/doc/src/vtr/power_estimation/power_local_interconnect.svg +++ b/doc/src/vtr/power_estimation/power_local_interconnect.svg @@ -1,813 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/doc/src/vtr/power_estimation/power_local_interconnect_wirelength.svg b/doc/src/vtr/power_estimation/power_local_interconnect_wirelength.svg index ff7feae6daf..0df200bae00 100644 --- a/doc/src/vtr/power_estimation/power_local_interconnect_wirelength.svg +++ b/doc/src/vtr/power_estimation/power_local_interconnect_wirelength.svg @@ -1,215 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/doc/src/vtr/power_estimation/power_sample_clb.svg b/doc/src/vtr/power_estimation/power_sample_clb.svg index e332b5b142a..236dbc1cecc 100644 --- a/doc/src/vtr/power_estimation/power_sample_clb.svg +++ b/doc/src/vtr/power_estimation/power_sample_clb.svg @@ -1,154 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/doc/src/vtr/power_estimation/power_sb.svg b/doc/src/vtr/power_estimation/power_sb.svg index c113d8ee277..97c20b631d5 100644 --- a/doc/src/vtr/power_estimation/power_sb.svg +++ b/doc/src/vtr/power_estimation/power_sb.svg @@ -1,209 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/doc/src/vtr/vtr_flow_fig.svg b/doc/src/vtr/vtr_flow_fig.svg index c619d9f4807..6fd2b794e41 100644 --- a/doc/src/vtr/vtr_flow_fig.svg +++ b/doc/src/vtr/vtr_flow_fig.svg @@ -1,3199 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/doc/src/vtr/vtr_task_fig.svg b/doc/src/vtr/vtr_task_fig.svg index 681fd51cb34..4b46a292cd5 100644 --- a/doc/src/vtr/vtr_task_fig.svg +++ b/doc/src/vtr/vtr_task_fig.svg @@ -1,2553 +1 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/libs/EXTERNAL/capnproto/c++/src/capnp/compat/json.c++ b/libs/EXTERNAL/capnproto/c++/src/capnp/compat/json.c++ index e30ade44c94..37603cc1ce1 100644 --- a/libs/EXTERNAL/capnproto/c++/src/capnp/compat/json.c++ +++ b/libs/EXTERNAL/capnproto/c++/src/capnp/compat/json.c++ @@ -31,6 +31,8 @@ #include #include +#include + namespace capnp { struct JsonCodec::Impl { @@ -189,7 +191,7 @@ void JsonCodec::setHasMode(HasMode mode) { impl->hasMode = mode; } kj::String JsonCodec::encode(DynamicValue::Reader value, Type type) const { MallocMessageBuilder message; auto json = message.getRoot(); - encode(value, type, json); + encode(std::move(value), type, json); return encodeRaw(json); } @@ -213,7 +215,7 @@ kj::String JsonCodec::encodeRaw(JsonValue::Reader value) const { return impl->encodeRaw(value, 0, multiline, false).flatten(); } -void JsonCodec::encode(DynamicValue::Reader input, Type type, JsonValue::Builder output) const { +void JsonCodec::encode(const DynamicValue::Reader& input, Type type, JsonValue::Builder output) const { // TODO(someday): For interfaces, check for handlers on superclasses, per documentation... // TODO(someday): For branded types, should we check for handlers on the generic? // TODO(someday): Allow registering handlers for "all structs", "all lists", etc? @@ -362,7 +364,7 @@ void JsonCodec::encode(DynamicValue::Reader input, Type type, JsonValue::Builder } } -void JsonCodec::encodeField(StructSchema::Field field, DynamicValue::Reader input, +void JsonCodec::encodeField(StructSchema::Field field, const DynamicValue::Reader& input, JsonValue::Builder output) const { KJ_IF_MAYBE(handler, impl->fieldHandlers.find(field)) { (*handler)->encodeBase(*this, input, output); @@ -1210,10 +1212,10 @@ private: kj::OneOf type, DynamicValue::Reader value) : ownName(prefix.size() > 0 ? kj::str(prefix, name) : nullptr), name(prefix.size() > 0 ? ownName : name), - type(type), value(value) {} + type(type), value(std::move(value)) {} }; - void gatherForEncode(const JsonCodec& codec, DynamicValue::Reader input, + void gatherForEncode(const JsonCodec& codec, const DynamicValue::Reader& input, kj::StringPtr prefix, kj::StringPtr morePrefix, kj::Vector& flattenedFields) const { kj::String ownPrefix; diff --git a/libs/EXTERNAL/capnproto/c++/src/capnp/compat/json.h b/libs/EXTERNAL/capnproto/c++/src/capnp/compat/json.h index dd0c7465bc4..dae653da08b 100644 --- a/libs/EXTERNAL/capnproto/c++/src/capnp/compat/json.h +++ b/libs/EXTERNAL/capnproto/c++/src/capnp/compat/json.h @@ -137,7 +137,7 @@ class JsonCodec { template void encode(T&& value, JsonValue::Builder output) const; - void encode(DynamicValue::Reader input, Type type, JsonValue::Builder output) const; + void encode(const DynamicValue::Reader& input, Type type, JsonValue::Builder output) const; void decode(JsonValue::Reader input, DynamicStruct::Builder output) const; template Orphan decode(JsonValue::Reader input, Orphanage orphanage) const; @@ -238,7 +238,7 @@ class JsonCodec { kj::Own impl; - void encodeField(StructSchema::Field field, DynamicValue::Reader input, + void encodeField(StructSchema::Field field, const DynamicValue::Reader& input, JsonValue::Builder output) const; Orphan decodeArray(List::Reader input, ListSchema type, Orphanage orphanage) const; void decodeObject(JsonValue::Reader input, StructSchema type, Orphanage orphanage, DynamicStruct::Builder output) const; diff --git a/libs/EXTERNAL/capnproto/c++/src/capnp/compiler/parser.c++ b/libs/EXTERNAL/capnproto/c++/src/capnp/compiler/parser.c++ index b6f069f25bd..07073c43628 100644 --- a/libs/EXTERNAL/capnproto/c++/src/capnp/compiler/parser.c++ +++ b/libs/EXTERNAL/capnproto/c++/src/capnp/compiler/parser.c++ @@ -709,8 +709,8 @@ CapnpParser::CapnpParser(Orphanage orphanageParam, ErrorReporter& errorReporterP auto& ordinalOrColon = arena.copy(p::oneOf( p::transform(p::sequence(parsers.ordinal, p::optional(op("!")), p::optional(op(":"))), [](Orphan&& ordinal, - kj::Maybe> exclamation, - kj::Maybe> colon) + const kj::Maybe>& exclamation, + const kj::Maybe>& colon) -> kj::Tuple>, bool, bool> { return kj::tuple(kj::mv(ordinal), exclamation == nullptr, colon == nullptr); }), diff --git a/libs/EXTERNAL/capnproto/c++/src/capnp/dynamic.c++ b/libs/EXTERNAL/capnproto/c++/src/capnp/dynamic.c++ index a35dca5e1c9..9d429faa3ca 100644 --- a/libs/EXTERNAL/capnproto/c++/src/capnp/dynamic.c++ +++ b/libs/EXTERNAL/capnproto/c++/src/capnp/dynamic.c++ @@ -1014,7 +1014,7 @@ void DynamicStruct::Builder::set(kj::StringPtr name, std::initializer_list value) { auto list = init(name, value.size()).as(); uint i = 0; - for (auto element: value) { + for (const auto& element: value) { list.set(i++, element); } } @@ -1416,7 +1416,7 @@ Orphan DynamicList::Builder::disown(uint index) { void DynamicList::Builder::copyFrom(std::initializer_list value) { KJ_REQUIRE(value.size() == size(), "DynamicList::copyFrom() argument had different size."); uint i = 0; - for (auto element: value) { + for (const auto& element: value) { set(i++, element); } } diff --git a/libs/EXTERNAL/capnproto/c++/src/capnp/stringify.c++ b/libs/EXTERNAL/capnproto/c++/src/capnp/stringify.c++ index ad00b6785f5..5a2b8f8f461 100644 --- a/libs/EXTERNAL/capnproto/c++/src/capnp/stringify.c++ +++ b/libs/EXTERNAL/capnproto/c++/src/capnp/stringify.c++ @@ -227,7 +227,7 @@ static kj::StringTree print(const DynamicValue::Reader& value, KJ_UNREACHABLE; } -kj::StringTree stringify(DynamicValue::Reader value) { +kj::StringTree stringify(const DynamicValue::Reader& value) { return print(value, schema::Type::STRUCT, Indent(false), BARE); } diff --git a/libs/EXTERNAL/capnproto/c++/src/kj/filesystem.c++ b/libs/EXTERNAL/capnproto/c++/src/kj/filesystem.c++ index 01bab169d86..bbaf5d9bd45 100644 --- a/libs/EXTERNAL/capnproto/c++/src/kj/filesystem.c++ +++ b/libs/EXTERNAL/capnproto/c++/src/kj/filesystem.c++ @@ -1499,8 +1499,8 @@ private: lastModified = clock.now(); } - bool tryTransferChild(EntryImpl& entry, const FsNode::Type type, kj::Maybe lastModified, - kj::Maybe size, const Directory& fromDirectory, + bool tryTransferChild(EntryImpl& entry, const FsNode::Type type, const kj::Maybe& lastModified, + const kj::Maybe& size, const Directory& fromDirectory, PathPtr fromPath, TransferMode mode) { switch (type) { case FsNode::Type::FILE: diff --git a/libs/EXTERNAL/capnproto/doc/images/bg_hr.png b/libs/EXTERNAL/capnproto/doc/images/bg_hr.png index 7973bd69888..b61d2658c7d 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/bg_hr.png and b/libs/EXTERNAL/capnproto/doc/images/bg_hr.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/blacktocat.png b/libs/EXTERNAL/capnproto/doc/images/blacktocat.png index 6e264fe57a2..dd3774b7f4b 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/blacktocat.png and b/libs/EXTERNAL/capnproto/doc/images/blacktocat.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/capnp-vs-ice.png b/libs/EXTERNAL/capnproto/doc/images/capnp-vs-ice.png index d27c5738148..96b6111c252 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/capnp-vs-ice.png and b/libs/EXTERNAL/capnproto/doc/images/capnp-vs-ice.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/capnp-vs-thrift-vs-ice.png b/libs/EXTERNAL/capnproto/doc/images/capnp-vs-thrift-vs-ice.png index e62df5215b5..a7d673df54f 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/capnp-vs-thrift-vs-ice.png and b/libs/EXTERNAL/capnproto/doc/images/capnp-vs-thrift-vs-ice.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/gittip15.png b/libs/EXTERNAL/capnproto/doc/images/gittip15.png index ae2a88ba583..349aa167dd5 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/gittip15.png and b/libs/EXTERNAL/capnproto/doc/images/gittip15.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/icon_download.png b/libs/EXTERNAL/capnproto/doc/images/icon_download.png index a2a287f642a..25f7440924c 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/icon_download.png and b/libs/EXTERNAL/capnproto/doc/images/icon_download.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/infinitely_faster.png b/libs/EXTERNAL/capnproto/doc/images/infinitely_faster.png index 7ad282f73aa..847778e43f4 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/infinitely_faster.png and b/libs/EXTERNAL/capnproto/doc/images/infinitely_faster.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/infinity-times-faster.png b/libs/EXTERNAL/capnproto/doc/images/infinity-times-faster.png index f1610ab12a6..100c5b0bd79 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/infinity-times-faster.png and b/libs/EXTERNAL/capnproto/doc/images/infinity-times-faster.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/logo.png b/libs/EXTERNAL/capnproto/doc/images/logo.png index 8de5275132b..de4bdf95cf9 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/logo.png and b/libs/EXTERNAL/capnproto/doc/images/logo.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/sprite_download.png b/libs/EXTERNAL/capnproto/doc/images/sprite_download.png index f2babd575dc..7537b8025fc 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/sprite_download.png and b/libs/EXTERNAL/capnproto/doc/images/sprite_download.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/time-travel.png b/libs/EXTERNAL/capnproto/doc/images/time-travel.png index 1aca28be99a..505997849cf 100644 Binary files a/libs/EXTERNAL/capnproto/doc/images/time-travel.png and b/libs/EXTERNAL/capnproto/doc/images/time-travel.png differ diff --git a/libs/EXTERNAL/capnproto/doc/images/twitter.svg b/libs/EXTERNAL/capnproto/doc/images/twitter.svg index aa43ca70a7e..f57c67ceac9 100644 --- a/libs/EXTERNAL/capnproto/doc/images/twitter.svg +++ b/libs/EXTERNAL/capnproto/doc/images/twitter.svg @@ -1,51 +1 @@ - - -image/svg+xml - + \ No newline at end of file diff --git a/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-0rt.png b/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-0rt.png index dbdceb6e8f4..cab088cd62a 100644 Binary files a/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-0rt.png and b/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-0rt.png differ diff --git a/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-proxy.png b/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-proxy.png index 30ac5636e68..1e1e236615a 100644 Binary files a/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-proxy.png and b/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-proxy.png differ diff --git a/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-redirect.png b/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-redirect.png index cbfb7b1e5c4..a43f6194409 100644 Binary files a/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-redirect.png and b/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph-redirect.png differ diff --git a/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph.png b/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph.png index db38fd3c790..5ac61095a60 100644 Binary files a/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph.png and b/libs/EXTERNAL/capnproto/doc/slides-2017.05.18/3ph.png differ diff --git a/libs/EXTERNAL/libargparse/src/argparse.cpp b/libs/EXTERNAL/libargparse/src/argparse.cpp index 72071f1fc62..94457e2690f 100644 --- a/libs/EXTERNAL/libargparse/src/argparse.cpp +++ b/libs/EXTERNAL/libargparse/src/argparse.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "argparse.hpp" #include "argparse_util.hpp" @@ -16,15 +17,15 @@ namespace argparse { */ ArgumentParser::ArgumentParser(std::string prog_name, std::string description_str, std::ostream& os) - : description_(description_str) + : description_(std::move(description_str)) , formatter_(new DefaultFormatter()) , os_(os) { - prog(prog_name); + prog(std::move(prog_name)); argument_groups_.push_back(ArgumentGroup("arguments")); } - ArgumentParser& ArgumentParser::prog(std::string prog_name, bool basename_only) { + ArgumentParser& ArgumentParser::prog(const std::string& prog_name, bool basename_only) { if (basename_only) { prog_ = basename(prog_name); } else { @@ -34,17 +35,17 @@ namespace argparse { } ArgumentParser& ArgumentParser::version(std::string version_str) { - version_ = version_str; + version_ = std::move(version_str); return *this; } ArgumentParser& ArgumentParser::epilog(std::string epilog_str) { - epilog_ = epilog_str; + epilog_ = std::move(epilog_str); return *this; } ArgumentGroup& ArgumentParser::add_argument_group(std::string description_str) { - argument_groups_.push_back(ArgumentGroup(description_str)); + argument_groups_.push_back(ArgumentGroup(std::move(description_str))); return argument_groups_[argument_groups_.size() - 1]; } @@ -211,7 +212,7 @@ namespace argparse { } assert (nargs_read <= max_values_to_read); - for (auto val : values) { + for (const auto& val : values) { if (!is_valid_choice(val, arg->choices())) { std::stringstream msg; msg << "Unexpected option value '" << values[0] << "' (expected one of: " << join(arg->choices(), ", "); @@ -243,7 +244,7 @@ namespace argparse { assert(values.size() >= 1); } - for (auto value : values) { + for (const auto& value : values) { try { arg->add_value_to_dest(value); } catch (const ArgParseConversionError& e) { @@ -375,7 +376,7 @@ namespace argparse { ArgumentParser::ShortArgInfo ArgumentParser::no_space_short_arg(std::string str, const std::map>& str_to_option_arg) const { ShortArgInfo short_arg_info; - for(auto kv : str_to_option_arg) { + for(const auto& kv : str_to_option_arg) { if (kv.first.size() == 2) { //Is a short arg @@ -409,11 +410,11 @@ namespace argparse { * ArgumentGroup */ ArgumentGroup::ArgumentGroup(std::string name_str) - : name_(name_str) + : name_(std::move(name_str)) {} ArgumentGroup& ArgumentGroup::epilog(std::string str) { - epilog_ = str; + epilog_ = std::move(str); return *this; } std::string ArgumentGroup::name() const { return name_; } @@ -424,8 +425,8 @@ namespace argparse { * Argument */ Argument::Argument(std::string long_opt, std::string short_opt) - : long_opt_(long_opt) - , short_opt_(short_opt) { + : long_opt_(std::move(long_opt)) + , short_opt_(std::move(short_opt)) { if (long_opt_.size() < 1) { throw ArgParseError("Argument must be at least one character long"); @@ -444,7 +445,7 @@ namespace argparse { } Argument& Argument::help(std::string help_str) { - help_ = help_str; + help_ = std::move(help_str); return *this; } @@ -475,12 +476,12 @@ namespace argparse { } Argument& Argument::metavar(std::string metavar_str) { - metavar_ = metavar_str; + metavar_ = std::move(metavar_str); return *this; } Argument& Argument::choices(std::vector choice_values) { - choices_ = choice_values; + choices_ = std::move(choice_values); return *this; } @@ -535,7 +536,7 @@ namespace argparse { } Argument& Argument::group_name(std::string grp) { - group_name_ = grp; + group_name_ = std::move(grp); return *this; } diff --git a/libs/EXTERNAL/libargparse/src/argparse.hpp b/libs/EXTERNAL/libargparse/src/argparse.hpp index 652ccdb3843..d7e3a876b78 100644 --- a/libs/EXTERNAL/libargparse/src/argparse.hpp +++ b/libs/EXTERNAL/libargparse/src/argparse.hpp @@ -37,7 +37,7 @@ namespace argparse { ArgumentParser(std::string prog_name, std::string description_str=std::string(), std::ostream& os=std::cout); //Overrides the program name - ArgumentParser& prog(std::string prog, bool basename_only=true); + ArgumentParser& prog(const std::string& prog, bool basename_only=true); //Sets the program version ArgumentParser& version(std::string version); @@ -294,7 +294,7 @@ namespace argparse { template class SingleValueArgument : public Argument { public: //Constructors - SingleValueArgument(ArgValue& dest, std::string long_opt, std::string short_opt) + SingleValueArgument(ArgValue& dest, const std::string& long_opt, const std::string& short_opt) : Argument(long_opt, short_opt) , dest_(dest) {} @@ -364,7 +364,7 @@ namespace argparse { template class SingleValueArgument : public Argument { public: //Constructors - SingleValueArgument(ArgValue& dest, std::string long_opt, std::string short_opt) + SingleValueArgument(ArgValue& dest, const std::string& long_opt, const std::string& short_opt) : Argument(long_opt, short_opt) , dest_(dest) {} @@ -432,7 +432,7 @@ namespace argparse { template class MultiValueArgument : public Argument { public: //Constructors - MultiValueArgument(ArgValue& dest, std::string long_opt, std::string short_opt) + MultiValueArgument(ArgValue& dest, const std::string& long_opt, const std::string& short_opt) : Argument(long_opt, short_opt) , dest_(dest) {} @@ -440,7 +440,7 @@ namespace argparse { public: //Mutators void set_dest_to_default() override { auto& target = dest_.mutable_value(Provenance::DEFAULT); - for (auto default_str : default_value_) { + for (const auto& default_str : default_value_) { auto val = Converter().from_str(default_str); target.insert(std::end(target), val.value()); } diff --git a/libs/EXTERNAL/libargparse/src/argparse_default_converter.hpp b/libs/EXTERNAL/libargparse/src/argparse_default_converter.hpp index 372a13ef938..8e90943865d 100644 --- a/libs/EXTERNAL/libargparse/src/argparse_default_converter.hpp +++ b/libs/EXTERNAL/libargparse/src/argparse_default_converter.hpp @@ -1,6 +1,7 @@ #ifndef ARGPARSE_DEFAULT_CONVERTER_HPP #define ARGPARSE_DEFAULT_CONVERTER_HPP #include +#include #include #include #include "argparse_error.hpp" @@ -38,7 +39,7 @@ arg_type() { return ""; } //Empty template class DefaultConverter { public: - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { std::stringstream ss(str); T val = T(); @@ -124,12 +125,12 @@ class DefaultConverter { public: ConvertedValue from_str(std::string str) { ConvertedValue converted_value; - converted_value.set_value(str); + converted_value.set_value(std::move(str)); return converted_value; } ConvertedValue to_str(std::string val) { ConvertedValue converted_value; - converted_value.set_value(val); + converted_value.set_value(std::move(val)); return converted_value; } std::vector default_choices() { return {}; } @@ -140,7 +141,7 @@ class DefaultConverter { template<> class DefaultConverter { public: - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue val; val.set_value(strdup(str.c_str())); return val; @@ -158,7 +159,7 @@ class DefaultConverter { template<> class DefaultConverter { public: - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue val; val.set_value(strdup(str.c_str())); return val; diff --git a/libs/EXTERNAL/libargparse/src/argparse_formatter.cpp b/libs/EXTERNAL/libargparse/src/argparse_formatter.cpp index 0d5ef3ea989..b2b20f93620 100644 --- a/libs/EXTERNAL/libargparse/src/argparse_formatter.cpp +++ b/libs/EXTERNAL/libargparse/src/argparse_formatter.cpp @@ -216,7 +216,7 @@ namespace argparse { std::stringstream choices_ss; choices_ss << "{"; bool first = true; - for(auto choice : arg.choices()) { + for(const auto& choice : arg.choices()) { if (!first) { choices_ss << ", "; } diff --git a/libs/EXTERNAL/libargparse/src/argparse_util.cpp b/libs/EXTERNAL/libargparse/src/argparse_util.cpp index 7208fe563ed..4d2b0ba57fb 100644 --- a/libs/EXTERNAL/libargparse/src/argparse_util.cpp +++ b/libs/EXTERNAL/libargparse/src/argparse_util.cpp @@ -39,7 +39,7 @@ namespace argparse { return false; } - bool is_valid_choice(std::string str, const std::vector& choices) { + bool is_valid_choice(const std::string& str, const std::vector& choices) { if (choices.empty()) return true; auto find_iter = std::find(choices.begin(), choices.end(), str); @@ -74,7 +74,7 @@ namespace argparse { return res; } - std::vector wrap_width(std::string str, size_t width, std::vector break_strs) { + std::vector wrap_width(std::string str, size_t width, const std::vector& break_strs) { std::vector wrapped_lines; size_t start = 0; @@ -114,13 +114,13 @@ namespace argparse { return wrapped_lines; } - std::string basename(std::string filepath) { + std::string basename(const std::string& filepath) { #ifdef _WIN32 //Windows uses back-slash as directory divider auto pos = filepath.rfind("\\"); #else //*nix-like uses forward-slash as directory divider - auto pos = filepath.rfind("/"); + auto pos = filepath.rfind('/'); #endif if (pos == std::string::npos) { pos = 0; diff --git a/libs/EXTERNAL/libargparse/src/argparse_util.hpp b/libs/EXTERNAL/libargparse/src/argparse_util.hpp index dbd5802c614..f65060bf152 100644 --- a/libs/EXTERNAL/libargparse/src/argparse_util.hpp +++ b/libs/EXTERNAL/libargparse/src/argparse_util.hpp @@ -24,21 +24,21 @@ namespace argparse { bool is_argument(std::string str, const std::map>& arg_map); //Returns true if str is in choices, or choices is empty - bool is_valid_choice(std::string str, const std::vector& choices); + bool is_valid_choice(const std::string& str, const std::vector& choices); //Returns 'str' interpreted as type T // Throws an exception if conversion fails template - T as(std::string str); + T as(const std::string& str); template - std::string join(Container container, std::string join_str); + std::string join(Container container, const std::string& join_str); char* strdup(const char* str); - std::vector wrap_width(std::string str, size_t width, std::vector split_str={" ", "/"}); + std::vector wrap_width(std::string str, size_t width, const std::vector& split_str={" ", "/"}); - std::string basename(std::string filepath); + std::string basename(const std::string& filepath); } //namespace #include "argparse_util.tpp" diff --git a/libs/EXTERNAL/libargparse/src/argparse_util.tpp b/libs/EXTERNAL/libargparse/src/argparse_util.tpp index efdfef556d4..1842a471877 100644 --- a/libs/EXTERNAL/libargparse/src/argparse_util.tpp +++ b/libs/EXTERNAL/libargparse/src/argparse_util.tpp @@ -4,7 +4,7 @@ namespace argparse { template - T as(std::string str) { + T as(const std::string& str) { std::stringstream ss(str); @@ -19,7 +19,7 @@ namespace argparse { } template - std::string join(Container container, std::string join_str) { + std::string join(Container container, const std::string& join_str) { std::stringstream ss; bool first = true; diff --git a/libs/EXTERNAL/libargparse/src/argparse_value.hpp b/libs/EXTERNAL/libargparse/src/argparse_value.hpp index 7ad3b121e50..39d7dc93df8 100644 --- a/libs/EXTERNAL/libargparse/src/argparse_value.hpp +++ b/libs/EXTERNAL/libargparse/src/argparse_value.hpp @@ -11,7 +11,7 @@ namespace argparse { typedef T value_type; public: void set_value(T val) { errored_ = false; value_ = val; } - void set_error(std::string msg) { errored_ = true; error_msg_ = msg; } + void set_error(const std::string& msg) { errored_ = true; error_msg_ = msg; } T value() const { return value_; } std::string error() const { return error_msg_; } @@ -81,11 +81,11 @@ namespace argparse { return value_; } - void set_argument_group(std::string grp) { + void set_argument_group(const std::string& grp) { argument_group_ = grp; } - void set_argument_name(std::string name_str) { + void set_argument_name(const std::string& name_str) { argument_name_ = name_str; } private: diff --git a/libs/EXTERNAL/libblifparse/src/blifparse.cpp b/libs/EXTERNAL/libblifparse/src/blifparse.cpp index 1eeaf806035..353e5ac023a 100644 --- a/libs/EXTERNAL/libblifparse/src/blifparse.cpp +++ b/libs/EXTERNAL/libblifparse/src/blifparse.cpp @@ -35,7 +35,7 @@ void Callback::param(std::string /*name*/, std::string /*value*/) { * the blif commands. See blif.h for data structure * detials. */ -void blif_parse_filename(std::string filename, Callback& callback) { +void blif_parse_filename(const std::string& filename, Callback& callback) { blif_parse_filename(filename.c_str(), callback); } diff --git a/libs/EXTERNAL/libblifparse/src/blifparse.hpp b/libs/EXTERNAL/libblifparse/src/blifparse.hpp index 1206a18d67b..8d5a56b0458 100644 --- a/libs/EXTERNAL/libblifparse/src/blifparse.hpp +++ b/libs/EXTERNAL/libblifparse/src/blifparse.hpp @@ -95,7 +95,7 @@ class Callback { /* * External functions for loading an SDC file */ -void blif_parse_filename(std::string filename, Callback& callback); +void blif_parse_filename(const std::string& filename, Callback& callback); void blif_parse_filename(const char* filename, Callback& callback); //Loads from 'blif'. 'filename' only used to pass a filename to callback and can be left unspecified diff --git a/libs/EXTERNAL/libsdcparse/src/sdc_common.cpp b/libs/EXTERNAL/libsdcparse/src/sdc_common.cpp index 4080d4bd81c..5769a056b18 100644 --- a/libs/EXTERNAL/libsdcparse/src/sdc_common.cpp +++ b/libs/EXTERNAL/libsdcparse/src/sdc_common.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "sdc_common.hpp" #include "sdc_error.hpp" @@ -47,7 +48,7 @@ void sdc_create_clock_add_targets(Callback& callback, const Lexer& lexer, Create "If you want to define multiple targets specify them as a list (e.g. \"{target1 target2}\").\n"); } - sdc_create_clock.targets = target_group; + sdc_create_clock.targets = std::move(target_group); } void add_sdc_create_clock(Callback& callback, const Lexer& lexer, CreateClock& sdc_create_clock) { @@ -140,7 +141,7 @@ void sdc_set_io_delay_set_ports(Callback& callback, const Lexer& lexer, SetIoDel sdc_error_wrap(callback, lexer.lineno(), lexer.text(), "Currently only a single get_ports command is supported.\n"); } - sdc_set_io_delay.target_ports = ports; + sdc_set_io_delay.target_ports = std::move(ports); } void add_sdc_set_io_delay(Callback& callback, const Lexer& lexer, SetIoDelay& sdc_set_io_delay) { @@ -176,7 +177,7 @@ void sdc_set_clock_groups_set_type(Callback& callback, const Lexer& lexer, SetCl sdc_set_clock_groups.type = type; } -void sdc_set_clock_groups_add_group(Callback& /*callback*/, const Lexer& /*lexer*/, SetClockGroups& sdc_set_clock_groups, StringGroup clock_group) { +void sdc_set_clock_groups_add_group(Callback& /*callback*/, const Lexer& /*lexer*/, SetClockGroups& sdc_set_clock_groups, const StringGroup& clock_group) { assert(clock_group.type == StringGroupType::CLOCK || clock_group.type == StringGroupType::STRING); //Duplicate and insert the clock group @@ -206,7 +207,7 @@ void add_sdc_set_clock_groups(Callback& callback, const Lexer& lexer, SetClockGr */ void sdc_set_false_path_add_to_from_group(Callback& callback, const Lexer& lexer, SetFalsePath& sdc_set_false_path, - StringGroup group, + const StringGroup& group, FromToType to_from_dir) { assert(group.type == StringGroupType::CLOCK || group.type == StringGroupType::STRING); @@ -255,7 +256,7 @@ void sdc_set_min_max_delay_set_value(Callback& callback, const Lexer& lexer, Set sdc_set_min_max_delay.value = min_max_delay; } -void sdc_set_min_max_delay_add_to_from_group(Callback& callback, const Lexer& lexer, SetMinMaxDelay& sdc_set_min_max_delay, StringGroup group, FromToType to_from_dir) { +void sdc_set_min_max_delay_add_to_from_group(Callback& callback, const Lexer& lexer, SetMinMaxDelay& sdc_set_min_max_delay, const StringGroup& group, FromToType to_from_dir) { assert(group.type == StringGroupType::CLOCK || group.type == StringGroupType::STRING); //Error checking @@ -321,7 +322,7 @@ void sdc_set_multicycle_path_set_mcp_value(Callback& callback, const Lexer& lexe } void sdc_set_multicycle_path_add_to_from_group(Callback& callback, const Lexer& lexer, SetMulticyclePath& sdc_set_multicycle_path, - StringGroup group, + const StringGroup& group, FromToType to_from_dir) { assert(group.type == StringGroupType::CLOCK || group.type == StringGroupType::STRING || group.type == StringGroupType::PIN); @@ -388,7 +389,7 @@ void sdc_set_clock_uncertainty_set_value(Callback& callback, const Lexer& lexer, } void sdc_set_clock_uncertainty_add_to_from_group(Callback& callback, const Lexer& lexer, SetClockUncertainty& sdc_set_clock_uncertainty, - StringGroup group, + const StringGroup& group, FromToType to_from_dir) { assert(group.type == StringGroupType::CLOCK || group.type == StringGroupType::STRING); @@ -468,7 +469,7 @@ void sdc_set_clock_latency_set_value(Callback& callback, const Lexer& lexer, Set sdc_set_clock_latency.value = value; } -void sdc_set_clock_latency_set_clocks(Callback& callback, const Lexer& lexer, SetClockLatency& sdc_set_clock_latency, StringGroup target_clocks) { +void sdc_set_clock_latency_set_clocks(Callback& callback, const Lexer& lexer, SetClockLatency& sdc_set_clock_latency, const StringGroup& target_clocks) { if(target_clocks.type != StringGroupType::CLOCK) { sdc_error_wrap(callback, lexer.lineno(), lexer.text(), "Target clocks must be specified with 'get_clocks'.\n"); } @@ -503,7 +504,7 @@ void add_sdc_set_clock_latency(Callback& callback, const Lexer& lexer, SetClockL */ void sdc_set_disable_timing_add_to_from_group(Callback& callback, const Lexer& lexer, SetDisableTiming& sdc_set_disable_timing, - StringGroup group, + const StringGroup& group, FromToType to_from_dir) { //Error checking @@ -591,7 +592,7 @@ void sdc_set_timing_derate_value(Callback& callback, const Lexer& lexer, SetTimi sdc_set_timing_derate.value = value; } -void sdc_set_timing_derate_targets(Callback& callback, const Lexer& lexer, SetTimingDerate& sdc_set_timing_derate, StringGroup targets) { +void sdc_set_timing_derate_targets(Callback& callback, const Lexer& lexer, SetTimingDerate& sdc_set_timing_derate, const StringGroup& targets) { if(targets.type != StringGroupType::CELL) { sdc_error_wrap(callback, lexer.lineno(), lexer.text(), "Only get_cells is supported with set_timing_derate.\n"); } diff --git a/libs/EXTERNAL/libsdcparse/src/sdc_common.hpp b/libs/EXTERNAL/libsdcparse/src/sdc_common.hpp index f9f23614488..9d4c4e3a1a0 100644 --- a/libs/EXTERNAL/libsdcparse/src/sdc_common.hpp +++ b/libs/EXTERNAL/libsdcparse/src/sdc_common.hpp @@ -32,31 +32,31 @@ void add_sdc_set_io_delay(Callback& callback, const Lexer& lexer, SetIoDelay& sd //set_clock_groups void sdc_set_clock_groups_set_type(Callback& callback, const Lexer& lexer, SetClockGroups& sdc_set_clock_groups, ClockGroupsType type); -void sdc_set_clock_groups_add_group(Callback& callback, const Lexer& lexer, SetClockGroups& sdc_set_clock_groups, StringGroup clock_group); +void sdc_set_clock_groups_add_group(Callback& callback, const Lexer& lexer, SetClockGroups& sdc_set_clock_groups, const StringGroup& clock_group); void add_sdc_set_clock_groups(Callback& callback, const Lexer& lexer, SetClockGroups& sdc_set_clock_groups); //set_false_path -void sdc_set_false_path_add_to_from_group(Callback& callback, const Lexer& lexer, SetFalsePath& sdc_set_false_path, StringGroup group, FromToType to_from_dir); +void sdc_set_false_path_add_to_from_group(Callback& callback, const Lexer& lexer, SetFalsePath& sdc_set_false_path, const StringGroup& group, FromToType to_from_dir); void add_sdc_set_false_path(Callback& callback, const Lexer& lexer, SetFalsePath& sdc_set_false_path); //set_max_delay void sdc_set_min_max_delay_set_type(Callback& callback, const Lexer& lexer, SetMinMaxDelay& sdc_set_max_delay, MinMaxType type); void sdc_set_min_max_delay_set_value(Callback& callback, const Lexer& lexer, SetMinMaxDelay& sdc_set_max_delay, double max_delay); -void sdc_set_min_max_delay_add_to_from_group(Callback& callback, const Lexer& lexer, SetMinMaxDelay& sdc_set_max_delay, StringGroup group, FromToType to_from_dir); +void sdc_set_min_max_delay_add_to_from_group(Callback& callback, const Lexer& lexer, SetMinMaxDelay& sdc_set_max_delay, const StringGroup& group, FromToType to_from_dir); void add_sdc_set_min_max_delay(Callback& callback, const Lexer& lexer, SetMinMaxDelay& sdc_set_max_delay); //set_multicycle_path void sdc_set_multicycle_path_set_setup(Callback& callback, const Lexer& lexer, SetMulticyclePath& sdc_set_multicycle_path); void sdc_set_multicycle_path_set_hold(Callback& callback, const Lexer& lexer, SetMulticyclePath& sdc_set_multicycle_path); void sdc_set_multicycle_path_set_mcp_value(Callback& callback, const Lexer& lexer, SetMulticyclePath& sdc_set_multicycle_path, int mcp_value); -void sdc_set_multicycle_path_add_to_from_group(Callback& callback, const Lexer& lexer, SetMulticyclePath& sdc_set_multicycle_path, StringGroup group, FromToType to_from_dir); +void sdc_set_multicycle_path_add_to_from_group(Callback& callback, const Lexer& lexer, SetMulticyclePath& sdc_set_multicycle_path, const StringGroup& group, FromToType to_from_dir); void add_sdc_set_multicycle_path(Callback& callback, const Lexer& lexer, SetMulticyclePath& sdc_set_multicycle_path); //set_clock_uncertainty void sdc_set_clock_uncertainty_set_setup(Callback& callback, const Lexer& lexer, SetClockUncertainty& sdc_set_clock_uncertainty); void sdc_set_clock_uncertainty_set_hold(Callback& callback, const Lexer& lexer, SetClockUncertainty& sdc_set_clock_uncertainty); void sdc_set_clock_uncertainty_set_value(Callback& callback, const Lexer& lexer, SetClockUncertainty& sdc_set_clock_uncertainty, float value); -void sdc_set_clock_uncertainty_add_to_from_group(Callback& callback, const Lexer& lexer, SetClockUncertainty& sdc_set_clock_uncertainty, StringGroup group, FromToType to_from_dir); +void sdc_set_clock_uncertainty_add_to_from_group(Callback& callback, const Lexer& lexer, SetClockUncertainty& sdc_set_clock_uncertainty, const StringGroup& group, FromToType to_from_dir); void add_sdc_set_clock_uncertainty(Callback& callback, const Lexer& lexer, SetClockUncertainty& sdc_set_clock_uncertainty); //set_clock_latency @@ -64,11 +64,11 @@ void sdc_set_clock_latency_set_type(Callback& callback, const Lexer& lexer, SetC void sdc_set_clock_latency_early(Callback& callback, const Lexer& lexer, SetClockLatency& sdc_set_clock_latency); void sdc_set_clock_latency_late(Callback& callback, const Lexer& lexer, SetClockLatency& sdc_set_clock_latency); void sdc_set_clock_latency_set_value(Callback& callback, const Lexer& lexer, SetClockLatency& sdc_set_clock_latency, float value); -void sdc_set_clock_latency_set_clocks(Callback& callback, const Lexer& lexer, SetClockLatency& sdc_set_clock_latency, StringGroup clock_targets); +void sdc_set_clock_latency_set_clocks(Callback& callback, const Lexer& lexer, SetClockLatency& sdc_set_clock_latency, const StringGroup& clock_targets); void add_sdc_set_clock_latency(Callback& callback, const Lexer& lexer, SetClockLatency& sdc_set_clock_latency); //set_disable_timing -void sdc_set_disable_timing_add_to_from_group(Callback& callback, const Lexer& lexer, SetDisableTiming& sdc_set_disable_timing, StringGroup group, FromToType to_from_dir); +void sdc_set_disable_timing_add_to_from_group(Callback& callback, const Lexer& lexer, SetDisableTiming& sdc_set_disable_timing, const StringGroup& group, FromToType to_from_dir); void add_sdc_set_disable_timing(Callback& callback, const Lexer& lexer, SetDisableTiming& sdc_set_disable_timing); //set_timing_derate @@ -76,7 +76,7 @@ void sdc_set_timing_derate_early(Callback& callback, const Lexer& lexer, SetTimi void sdc_set_timing_derate_late(Callback& callback, const Lexer& lexer, SetTimingDerate& sdc_set_timing_derate); void sdc_set_timing_derate_target_type(Callback& callback, const Lexer& lexer, SetTimingDerate& sdc_set_timing_derate, TimingDerateTargetType target_type); void sdc_set_timing_derate_value(Callback& callback, const Lexer& lexer, SetTimingDerate& sdc_set_timing_derate, float value); -void sdc_set_timing_derate_targets(Callback& callback, const Lexer& lexer, SetTimingDerate& sdc_set_timing_derate, StringGroup targets); +void sdc_set_timing_derate_targets(Callback& callback, const Lexer& lexer, SetTimingDerate& sdc_set_timing_derate, const StringGroup& targets); void add_sdc_set_timing_derate(Callback& callback, const Lexer& lexer, SetTimingDerate& sdc_set_multicycle_path); //string_group diff --git a/libs/EXTERNAL/libsdcparse/src/sdcparse.cpp b/libs/EXTERNAL/libsdcparse/src/sdcparse.cpp index 73a83220f77..93d1f59d94f 100644 --- a/libs/EXTERNAL/libsdcparse/src/sdcparse.cpp +++ b/libs/EXTERNAL/libsdcparse/src/sdcparse.cpp @@ -8,7 +8,7 @@ namespace sdcparse { -void sdc_parse_filename(std::string filename, Callback& callback) { +void sdc_parse_filename(const std::string& filename, Callback& callback) { sdc_parse_filename(filename.c_str(), callback); } diff --git a/libs/EXTERNAL/libsdcparse/src/sdcparse.hpp b/libs/EXTERNAL/libsdcparse/src/sdcparse.hpp index c9333241cd5..32e1b52badc 100644 --- a/libs/EXTERNAL/libsdcparse/src/sdcparse.hpp +++ b/libs/EXTERNAL/libsdcparse/src/sdcparse.hpp @@ -132,7 +132,7 @@ class Callback { /* * External functions for loading an SDC file */ -void sdc_parse_filename(std::string filename, Callback& callback); +void sdc_parse_filename(const std::string& filename, Callback& callback); void sdc_parse_filename(const char* filename, Callback& callback); //Loads from 'sdc'. 'filename' only used to pass a filename to callback and can be left unspecified diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingConstraints.cpp b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingConstraints.cpp index 510fadd9e51..fb29bdfcde9 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingConstraints.cpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingConstraints.cpp @@ -286,7 +286,7 @@ TimingConstraints::source_latency_range TimingConstraints::source_latencies(Arri } } -DomainId TimingConstraints::create_clock_domain(const std::string name) { +DomainId TimingConstraints::create_clock_domain(const std::string& name) { DomainId id = find_clock_domain(name); if(!id) { //Create it diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingConstraints.hpp b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingConstraints.hpp index 07288ed08ba..38e0ea60803 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingConstraints.hpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingConstraints.hpp @@ -122,7 +122,7 @@ class TimingConstraints { void print_constraints() const; public: //Mutators ///\returns The DomainId of the clock with the specified name (will be created if it doesn not exist) - DomainId create_clock_domain(const std::string name); + DomainId create_clock_domain(const std::string& name); ///Sets the setup constraint between src_domain and sink_domain with value constraint void set_setup_constraint(const DomainId src_domain, const DomainId sink_domain, const Time constraint); diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.cpp b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.cpp index ab46e91ab8e..6d790139ace 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.cpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.cpp @@ -830,7 +830,7 @@ std::vector> identify_combinational_loops(const TimingGraph& } std::vector find_transitively_connected_nodes(const TimingGraph& tg, - const std::vector through_nodes, + const std::vector& through_nodes, size_t max_depth) { std::vector nodes; @@ -846,7 +846,7 @@ std::vector find_transitively_connected_nodes(const TimingGraph& tg, } std::vector find_transitive_fanin_nodes(const TimingGraph& tg, - const std::vector sinks, + const std::vector& sinks, size_t max_depth) { std::vector nodes; @@ -861,7 +861,7 @@ std::vector find_transitive_fanin_nodes(const TimingGraph& tg, } std::vector find_transitive_fanout_nodes(const TimingGraph& tg, - const std::vector sources, + const std::vector& sources, size_t max_depth) { std::vector nodes; diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.hpp b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.hpp index 77d11ab0c44..716f9d6533a 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.hpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingGraph.hpp @@ -53,6 +53,7 @@ * support is added), it may be a good idea apply these modifications automatically as needed. * */ +#include #include #include #include @@ -305,17 +306,17 @@ std::vector> identify_combinational_loops(const TimingGraph& //Returns the set of nodes transitively connected (either fanin or fanout) to nodes in through_nodes //up to max_depth (default infinite) hops away std::vector find_transitively_connected_nodes(const TimingGraph& tg, - const std::vector through_nodes, + const std::vector& through_nodes, size_t max_depth=std::numeric_limits::max()); //Returns the set of nodes in the transitive fanin of nodes in sinks up to max_depth (default infinite) hops away std::vector find_transitive_fanin_nodes(const TimingGraph& tg, - const std::vector sinks, + const std::vector& sinks, size_t max_depth=std::numeric_limits::max()); //Returns the set of nodes in the transitive fanout of nodes in sources up to max_depth (default infinite) hops away std::vector find_transitive_fanout_nodes(const TimingGraph& tg, - const std::vector sources, + const std::vector& sources, size_t max_depth=std::numeric_limits::max()); EdgeType infer_edge_type(const TimingGraph& tg, EdgeId edge); @@ -324,7 +325,7 @@ EdgeType infer_edge_type(const TimingGraph& tg, EdgeId edge); struct GraphIdMaps { GraphIdMaps(tatum::util::linear_map node_map, tatum::util::linear_map edge_map) - : node_id_map(node_map), edge_id_map(edge_map) {} + : node_id_map(std::move(node_map)), edge_id_map(std::move(edge_map)) {} tatum::util::linear_map node_id_map; tatum::util::linear_map edge_id_map; }; diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.cpp b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.cpp index 609b0c0b03e..17bc337e3ca 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.cpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include "tatum/util/tatum_math.hpp" @@ -29,13 +30,13 @@ void ReportTimingPathHelper::update_print_path(std::ostream& os, std::string poi tatum::Time incr = path - prev_path_; - print_path_line(os, point, to_printable_string(incr, unit_scale_, precision_), to_printable_string(path, unit_scale_, precision_)); + print_path_line(os, std::move(point), to_printable_string(incr, unit_scale_, precision_), to_printable_string(path, unit_scale_, precision_)); prev_path_ = path; } void ReportTimingPathHelper::update_print_path_no_incr(std::ostream& os, std::string point, tatum::Time path) { - print_path_line(os, point, "", to_printable_string(path, unit_scale_, precision_)); + print_path_line(os, std::move(point), "", to_printable_string(path, unit_scale_, precision_)); prev_path_ = path; } @@ -45,10 +46,10 @@ void ReportTimingPathHelper::reset_path() { } void ReportTimingPathHelper::print_path_line_no_incr(std::ostream& os, std::string point, tatum::Time path) const { - print_path_line(os, point, "", to_printable_string(path, unit_scale_, precision_)); + print_path_line(os, std::move(point), "", to_printable_string(path, unit_scale_, precision_)); } -void ReportTimingPathHelper::print_path_line(std::ostream& os, std::string point, std::string incr, std::string path) const { +void ReportTimingPathHelper::print_path_line(std::ostream& os, const std::string& point, const std::string& incr, const std::string& path) const { os << std::setw(point_width_) << std::left << point; os << std::setw(incr_width_) << std::right << incr; os << std::setw(path_width_) << std::right << path; @@ -84,7 +85,7 @@ TimingReporter::TimingReporter(const TimingGraphNameResolver& name_resolver, //pass } -void TimingReporter::report_timing_setup(std::string filename, +void TimingReporter::report_timing_setup(const std::string& filename, const SetupTimingAnalyzer& setup_analyzer, size_t npaths) const { std::ofstream os(filename); @@ -99,7 +100,7 @@ void TimingReporter::report_timing_setup(std::ostream& os, report_timing(os, paths); } -void TimingReporter::report_timing_hold(std::string filename, +void TimingReporter::report_timing_hold(const std::string& filename, const HoldTimingAnalyzer& hold_analyzer, size_t npaths) const { std::ofstream os(filename); @@ -114,7 +115,7 @@ void TimingReporter::report_timing_hold(std::ostream& os, report_timing(os, paths); } -void TimingReporter::report_skew_setup(std::string filename, +void TimingReporter::report_skew_setup(const std::string& filename, const SetupTimingAnalyzer& setup_analyzer, size_t nworst) const { std::ofstream os(filename); @@ -132,7 +133,7 @@ void TimingReporter::report_skew_setup(std::ostream& os, os << "#End of clock skew for setup timing startpoint/endpoint report\n"; } -void TimingReporter::report_skew_hold(std::string filename, +void TimingReporter::report_skew_hold(const std::string& filename, const HoldTimingAnalyzer& hold_analyzer, size_t nworst) const { std::ofstream os(filename); @@ -150,7 +151,7 @@ void TimingReporter::report_skew_hold(std::ostream& os, os << "#End of clock skew for hold timing startpoint/endpoint report\n"; } -void TimingReporter::report_unconstrained_setup(std::string filename, +void TimingReporter::report_unconstrained_setup(const std::string& filename, const tatum::SetupTimingAnalyzer& setup_analyzer) const { std::ofstream os(filename); report_unconstrained_setup(os, setup_analyzer); @@ -170,7 +171,7 @@ void TimingReporter::report_unconstrained_setup(std::ostream& os, os << "#End of unconstrained setup startpoint/endpoint report\n"; } -void TimingReporter::report_unconstrained_hold(std::string filename, +void TimingReporter::report_unconstrained_hold(const std::string& filename, const tatum::HoldTimingAnalyzer& hold_analyzer) const { std::ofstream os(filename); report_unconstrained_hold(os, hold_analyzer); @@ -694,7 +695,7 @@ bool TimingReporter::nearly_equal(const Time& lhs, const Time& rhs) const { size_t TimingReporter::estimate_point_print_width(const TimingPath& path) const { size_t width = 60; //default - for(auto subpath : {path.clock_launch_path(), path.data_arrival_path(), path.clock_capture_path()}) { + for(const auto& subpath : {path.clock_launch_path(), path.data_arrival_path(), path.clock_capture_path()}) { for(auto elem : subpath.elements()) { //Take the longest typical point name std::string point = name_resolver_.node_name(elem.node()) + " (" + name_resolver_.node_type_name(elem.node()) + ")"; diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.hpp b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.hpp index 1569aa6d704..29ffaa92783 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.hpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/TimingReporter.hpp @@ -33,7 +33,7 @@ namespace tatum { namespace detail { void print_path_line_no_incr(std::ostream& os, std::string point, tatum::Time path) const; - void print_path_line(std::ostream& os, std::string point, std::string incr, std::string path) const; + void print_path_line(std::ostream& os, const std::string& point, const std::string& incr, const std::string& path) const; void print_divider(std::ostream& os) const; @@ -62,22 +62,22 @@ class TimingReporter { float unit_scale=1e-9, size_t precision=3); 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(const 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_hold(std::string filename, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t npaths=REPORT_TIMING_DEFAULT_NPATHS) const; + void report_timing_hold(const 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_skew_setup(std::string filename, const tatum::SetupTimingAnalyzer& setup_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const; + void report_skew_setup(const 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; - void report_skew_hold(std::string filename, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const; + void report_skew_hold(const std::string& filename, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const; void report_skew_hold(std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer, size_t nworst=REPORT_TIMING_DEFAULT_NPATHS) const; - void report_unconstrained_setup(std::string filename, const tatum::SetupTimingAnalyzer& setup_analyzer) const; + void report_unconstrained_setup(const std::string& filename, const tatum::SetupTimingAnalyzer& setup_analyzer) const; void report_unconstrained_setup(std::ostream& os, const tatum::SetupTimingAnalyzer& setup_analyzer) const; - void report_unconstrained_hold(std::string filename, const tatum::HoldTimingAnalyzer& hold_analyzer) const; + void report_unconstrained_hold(const std::string& filename, const tatum::HoldTimingAnalyzer& hold_analyzer) const; void report_unconstrained_hold(std::ostream& os, const tatum::HoldTimingAnalyzer& hold_analyzer) const; private: diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/analyzers/TimingAnalyzer.hpp b/libs/EXTERNAL/libtatum/libtatum/tatum/analyzers/TimingAnalyzer.hpp index 004402f07b5..7ddadacbe2c 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/analyzers/TimingAnalyzer.hpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/analyzers/TimingAnalyzer.hpp @@ -1,5 +1,6 @@ #pragma once #include +#include namespace tatum { @@ -28,7 +29,7 @@ class TimingAnalyzer { ///Perform timing analysis to update timing information (i.e. arrival & required times) void update_timing() { update_timing_impl(); } - double get_profiling_data(std::string key) const { return get_profiling_data_impl(key); } + double get_profiling_data(std::string key) const { return get_profiling_data_impl(std::move(key)); } virtual size_t num_unconstrained_startpoints() const { return num_unconstrained_startpoints_impl(); } virtual size_t num_unconstrained_endpoints() const { return num_unconstrained_endpoints_impl(); } diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/base/sta_util.cpp b/libs/EXTERNAL/libtatum/libtatum/tatum/base/sta_util.cpp index 931a4ccc286..c284d0c272e 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/base/sta_util.cpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/base/sta_util.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -25,7 +26,7 @@ float time_sec(struct timespec start, struct timespec end) { void print_histogram(const std::vector& values, int nbuckets) { nbuckets = std::min(values.size(), (size_t) nbuckets); - int values_per_bucket = ceil((float) values.size() / nbuckets); + int values_per_bucket = std::ceil((float) values.size() / nbuckets); std::vector buckets(nbuckets); @@ -105,7 +106,7 @@ void print_node_fanout_histogram(const TimingGraph& tg, int nbuckets) { } -void print_timing_graph(std::shared_ptr tg) { +void print_timing_graph(const std::shared_ptr& tg) { for(const NodeId node_id : tg->nodes()) { cout << "Node: " << node_id; cout << " Type: " << tg->node_type(node_id); @@ -121,7 +122,7 @@ void print_timing_graph(std::shared_ptr tg) { } } -void print_levelization(std::shared_ptr tg) { +void print_levelization(const std::shared_ptr& tg) { cout << "Num Levels: " << tg->levels().size() << "\n"; for(const LevelId level_id : tg->levels()) { const auto& level = tg->level_nodes(level_id); @@ -302,7 +303,7 @@ void print_hold_tags(const TimingGraph& tg, const HoldTimingAnalyzer& analyzer) } -void dump_level_times(std::string fname, const TimingGraph& timing_graph, std::map serial_prof_data, std::map parallel_prof_data) { +void dump_level_times(const std::string& fname, const TimingGraph& timing_graph, std::map serial_prof_data, std::map parallel_prof_data) { //Per-level speed-up //cout << "Level Speed-Ups by width:" << endl; std::map,std::greater> widths_to_levels; @@ -313,7 +314,7 @@ void dump_level_times(std::string fname, const TimingGraph& timing_graph, std::m std::ofstream of(fname); of << "Width,Level,serial_fwd,serial_bck,parallel_fwd,parallel_bck"<< endl; - for(auto kv : widths_to_levels) { + for(const auto& kv : widths_to_levels) { int width = kv.first; for(const auto ilevel : kv.second) { std::stringstream key_fwd; diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/base/sta_util.hpp b/libs/EXTERNAL/libtatum/libtatum/tatum/base/sta_util.hpp index 0d6f93811ea..54ddc878423 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/base/sta_util.hpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/base/sta_util.hpp @@ -23,10 +23,10 @@ void print_level_histogram(const TimingGraph& tg, int nbuckets); void print_node_fanin_histogram(const TimingGraph& tg, int nbuckets); void print_node_fanout_histogram(const TimingGraph& tg, int nbuckets); -void print_timing_graph(std::shared_ptr tg); -void print_levelization(std::shared_ptr tg); +void print_timing_graph(const std::shared_ptr& tg); +void print_levelization(const std::shared_ptr& tg); -void dump_level_times(std::string fname, const TimingGraph& timing_graph, std::map serial_prof_data, std::map parallel_prof_data); +void dump_level_times(const std::string& fname, const TimingGraph& timing_graph, std::map serial_prof_data, std::map parallel_prof_data); diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/echo_writer.cpp b/libs/EXTERNAL/libtatum/libtatum/tatum/echo_writer.cpp index fc2bc624048..08c543970f6 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/echo_writer.cpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/echo_writer.cpp @@ -14,17 +14,17 @@ namespace tatum { -void write_tags(std::ostream& os, const std::string& type, const TimingTags::tag_range tags, const NodeId node_id); -void write_slacks(std::ostream& os, const std::string& type, const TimingTags::tag_range tags, const EdgeId edge); -void write_slacks(std::ostream& os, const std::string& type, const TimingTags::tag_range tags, const NodeId edge); +void write_tags(std::ostream& os, const std::string& type, const TimingTags::tag_range& tags, const NodeId node_id); +void write_slacks(std::ostream& os, const std::string& type, const TimingTags::tag_range& tags, const EdgeId edge); +void write_slacks(std::ostream& os, const std::string& type, const TimingTags::tag_range& tags, const NodeId edge); -void write_echo(std::string filename, const TimingGraph& tg, const TimingConstraints& tc, const DelayCalculator& dc, const std::shared_ptr analyzer) { +void write_echo(const std::string& filename, const TimingGraph& tg, const TimingConstraints& tc, const DelayCalculator& dc, const std::shared_ptr& analyzer) { std::ofstream os(filename); write_echo(os, tg, tc, dc, analyzer); } -void write_echo(std::ostream& os, const TimingGraph& tg, const TimingConstraints& tc, const DelayCalculator& dc, const std::shared_ptr analyzer) { +void write_echo(std::ostream& os, const TimingGraph& tg, const TimingConstraints& tc, const DelayCalculator& dc, const std::shared_ptr& analyzer) { write_timing_graph(os, tg); write_timing_constraints(os, tc); write_delay_model(os, tg, dc); @@ -227,7 +227,7 @@ void write_timing_constraints(std::ostream& os, const TimingConstraints& tc) { os << "\n"; } -void write_analysis_result(std::ostream& os, const TimingGraph& tg, const std::shared_ptr analyzer) { +void write_analysis_result(std::ostream& os, const TimingGraph& tg, const std::shared_ptr& analyzer) { os << "analysis_result:\n"; auto setup_analyzer = std::dynamic_pointer_cast(analyzer); @@ -287,7 +287,7 @@ void write_analysis_result(std::ostream& os, const TimingGraph& tg, const std::s os << "\n"; } -void write_tags(std::ostream& os, const std::string& type, const TimingTags::tag_range tags, const NodeId node_id) { +void write_tags(std::ostream& os, const std::string& type, const TimingTags::tag_range& tags, const NodeId node_id) { for(const auto& tag : tags) { TATUM_ASSERT(tag.type() != TagType::SLACK); @@ -314,7 +314,7 @@ void write_tags(std::ostream& os, const std::string& type, const TimingTags::tag } } -void write_slacks(std::ostream& os, const std::string& type, const TimingTags::tag_range tags, const EdgeId edge) { +void write_slacks(std::ostream& os, const std::string& type, const TimingTags::tag_range& tags, const EdgeId edge) { for(const auto& tag : tags) { TATUM_ASSERT(tag.type() == TagType::SLACK); @@ -341,7 +341,7 @@ void write_slacks(std::ostream& os, const std::string& type, const TimingTags::t } } -void write_slacks(std::ostream& os, const std::string& type, const TimingTags::tag_range tags, const NodeId node) { +void write_slacks(std::ostream& os, const std::string& type, const TimingTags::tag_range& tags, const NodeId node) { for(const auto& tag : tags) { TATUM_ASSERT(tag.type() == TagType::SLACK); diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/echo_writer.hpp b/libs/EXTERNAL/libtatum/libtatum/tatum/echo_writer.hpp index 50f870e0007..eeb0e75d1db 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/echo_writer.hpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/echo_writer.hpp @@ -11,10 +11,10 @@ namespace tatum { void write_timing_graph(std::ostream& os, const TimingGraph& tg); void write_timing_constraints(std::ostream& os, const TimingConstraints& tc); -void write_analysis_result(std::ostream& os, const TimingGraph& tg, const std::shared_ptr analyzer); +void write_analysis_result(std::ostream& os, const TimingGraph& tg, const std::shared_ptr& analyzer); void write_delay_model(std::ostream& os, const TimingGraph& tg, const DelayCalculator& dc); -void write_echo(std::string filename, const TimingGraph& tg, const TimingConstraints& tc, const DelayCalculator& dc, const std::shared_ptr analyzer); -void write_echo(std::ostream& os, const TimingGraph& tg, const TimingConstraints& tc, const DelayCalculator& dc, const std::shared_ptr analyzer); +void write_echo(const std::string& filename, const TimingGraph& tg, const TimingConstraints& tc, const DelayCalculator& dc, const std::shared_ptr& analyzer); +void write_echo(std::ostream& os, const TimingGraph& tg, const TimingConstraints& tc, const DelayCalculator& dc, const std::shared_ptr& analyzer); } diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/graph_walkers/TimingGraphWalker.hpp b/libs/EXTERNAL/libtatum/libtatum/tatum/graph_walkers/TimingGraphWalker.hpp index 14c54920385..90447ac4273 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/graph_walkers/TimingGraphWalker.hpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/graph_walkers/TimingGraphWalker.hpp @@ -91,7 +91,7 @@ class TimingGraphWalker { ///Retrieve profiling information ///\param key The profiling key ///\returns The profiling value for the given key, or NaN if the key is not found - double get_profiling_data(std::string key) const { + double get_profiling_data(const std::string& key) const { auto iter = profiling_data_.find(key); if(iter != profiling_data_.end()) { return iter->second; @@ -100,7 +100,7 @@ class TimingGraphWalker { } } - void set_profiling_data(std::string key, double val) { + void set_profiling_data(const std::string& key, double val) { profiling_data_[key] = val; } diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/report/TimingPath.hpp b/libs/EXTERNAL/libtatum/libtatum/tatum/report/TimingPath.hpp index dbbaf955e9c..6800ad643d1 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/report/TimingPath.hpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/report/TimingPath.hpp @@ -1,5 +1,7 @@ #ifndef TATUM_TIMING_PATH_HPP #define TATUM_TIMING_PATH_HPP +#include +#include #include #include "tatum/report/TimingPathFwd.hpp" @@ -88,7 +90,7 @@ class TimingSubPath { public: TimingSubPath() = default; TimingSubPath(std::vector elems) - : elements_(elems) {} + : elements_(std::move(std::move(elems))) {} path_elem_range elements() const { return util::make_range(elements_.begin(), @@ -116,9 +118,9 @@ class TimingPath { const TimingPathElem& data_required_elem, const TimingTag& slack) : path_info_(info) - , clock_launch_path_(clock_launch) - , data_arrival_path_(data_arrival) - , clock_capture_path_(clock_capture) + , clock_launch_path_(std::move(std::move(clock_launch))) + , data_arrival_path_(std::move(std::move(data_arrival))) + , clock_capture_path_(std::move(std::move(clock_capture))) , data_required_element_(data_required_elem) , slack_tag_(slack) { //pass diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/report/graphviz_dot_writer.cpp b/libs/EXTERNAL/libtatum/libtatum/tatum/report/graphviz_dot_writer.cpp index 807a0eb963c..762ada40bae 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/report/graphviz_dot_writer.cpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/report/graphviz_dot_writer.cpp @@ -23,7 +23,7 @@ GraphvizDotWriter::GraphvizDotWriter(const TimingGraph& tg, const DelayCalculato nodes_to_dump_ = std::set(nodes.begin(), nodes.end()); } -void GraphvizDotWriter::write_dot_file(std::string filename) { +void GraphvizDotWriter::write_dot_file(const std::string& filename) { std::ofstream os(filename); write_dot_file(os); } @@ -43,11 +43,11 @@ void GraphvizDotWriter::write_dot_file(std::ostream& os) { write_dot_format(os, node_tags, node_slacks, timing_type); } -void GraphvizDotWriter::write_dot_file(std::string filename, const SetupTimingAnalyzer& analyzer) { +void GraphvizDotWriter::write_dot_file(const std::string& filename, const SetupTimingAnalyzer& analyzer) { std::ofstream os(filename); write_dot_file(os, analyzer); } -void GraphvizDotWriter::write_dot_file(std::string filename, const HoldTimingAnalyzer& analyzer) { +void GraphvizDotWriter::write_dot_file(const std::string& filename, const HoldTimingAnalyzer& analyzer) { std::ofstream os(filename); write_dot_file(os, analyzer); } @@ -165,7 +165,7 @@ void GraphvizDotWriter::write_dot_edge(std::ostream& os, const EdgeId edge, cons EdgeType edge_type = tg_.edge_type(edge); - std::string color = ""; + std::string color; os << "\t" << node_name(src_node) << " -> " << node_name(sink_node); os << " [ label=\"" << edge; if(edge_type == EdgeType::PRIMITIVE_CLOCK_CAPTURE) { diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/report/graphviz_dot_writer.hpp b/libs/EXTERNAL/libtatum/libtatum/tatum/report/graphviz_dot_writer.hpp index 2943d628164..824c159fc1f 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/report/graphviz_dot_writer.hpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/report/graphviz_dot_writer.hpp @@ -38,14 +38,14 @@ class GraphvizDotWriter { } //Write the dot file with no timing tags - void write_dot_file(std::string filename); + void write_dot_file(const std::string& filename); void write_dot_file(std::ostream& os); //Write the dot file with timing tags - void write_dot_file(std::string filename, const SetupTimingAnalyzer& analyzer); + void write_dot_file(const std::string& filename, const SetupTimingAnalyzer& analyzer); void write_dot_file(std::ostream& os, const SetupTimingAnalyzer& analyzer); - void write_dot_file(std::string filename, const HoldTimingAnalyzer& analyzer); + void write_dot_file(const std::string& filename, const HoldTimingAnalyzer& analyzer); void write_dot_file(std::ostream& os, const HoldTimingAnalyzer& analyzer); private: void write_dot_format(std::ostream& os, diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.cpp b/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.cpp index 63f9ab5ce3f..ab14f48fb1d 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.cpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.cpp @@ -7,18 +7,18 @@ namespace tatum { * Tag utilities */ //Return the tag from the range [first,last) which has the lowest value -TimingTags::const_iterator find_minimum_tag(TimingTags::tag_range tags) { +TimingTags::const_iterator find_minimum_tag(const TimingTags::tag_range& tags) { return std::min_element(tags.begin(), tags.end(), TimingTagValueComp()); } //Return the tag from the range [first,last) which has the highest value -TimingTags::const_iterator find_maximum_tag(TimingTags::tag_range tags) { +TimingTags::const_iterator find_maximum_tag(const TimingTags::tag_range& tags) { return std::max_element(tags.begin(), tags.end(), TimingTagValueComp()); } -TimingTags::const_iterator find_tag(TimingTags::tag_range tags, +TimingTags::const_iterator find_tag(const TimingTags::tag_range& tags, DomainId launch_domain, DomainId capture_domain) { for(auto iter = tags.begin(); iter != tags.end(); ++iter) { @@ -31,7 +31,7 @@ TimingTags::const_iterator find_tag(TimingTags::tag_range tags, } //Returns true of the specified set of tags would constrain a node of type node_type -bool is_constrained(NodeType node_type, TimingTags::tag_range tags) { +bool is_constrained(NodeType node_type, const TimingTags::tag_range& tags) { bool has_clock_launch = false; bool has_clock_capture = false; bool has_data_required = false; diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.hpp b/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.hpp index 0c1c78315af..a13f4ecbc2c 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.hpp +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.hpp @@ -171,7 +171,7 @@ class TimingTags { std::pair find_data_required_with_valid_data_arrival(DomainId launch_domain, DomainId capture_domain); - iterator insert(iterator iter, const TimingTag& tag); + iterator insert(const iterator& iter, const TimingTag& tag); void grow_insert(size_t index, const TimingTag& tag); void increment_size(TagType type); @@ -204,18 +204,18 @@ class TimingTags { */ //Return the tag from the range [first,last) which has the lowest value -TimingTags::const_iterator find_minimum_tag(TimingTags::tag_range tags); +TimingTags::const_iterator find_minimum_tag(const TimingTags::tag_range& tags); //Return the tag from the range [first,last) which has the highest value -TimingTags::const_iterator find_maximum_tag(TimingTags::tag_range tags); +TimingTags::const_iterator find_maximum_tag(const TimingTags::tag_range& tags); //Return the tag for the specified clock domains -TimingTags::const_iterator find_tag(TimingTags::tag_range tags, +TimingTags::const_iterator find_tag(const TimingTags::tag_range& tags, DomainId launch_domain, DomainId capture_domain); //Returns true of the specified set of tags would constrain a node of type node_type -bool is_constrained(NodeType node_type, TimingTags::tag_range tags); +bool is_constrained(NodeType node_type, const TimingTags::tag_range& tags); } //namepsace diff --git a/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.inl b/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.inl index 05e61439668..7bda274c5c0 100644 --- a/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.inl +++ b/libs/EXTERNAL/libtatum/libtatum/tatum/tags/TimingTags.inl @@ -239,7 +239,7 @@ inline std::pair TimingTags::find_data_required_with_ inline size_t TimingTags::capacity() const { return capacity_; } -inline TimingTags::iterator TimingTags::insert(iterator iter, const TimingTag& tag) { +inline TimingTags::iterator TimingTags::insert(const iterator& iter, const TimingTag& tag) { size_t index = std::distance(begin(), iter); TATUM_ASSERT(index <= size()); diff --git a/libs/libarchfpga/src/arch_error.h b/libs/libarchfpga/src/arch_error.h index 0dae1d8592e..2723ef7bfef 100644 --- a/libs/libarchfpga/src/arch_error.h +++ b/libs/libarchfpga/src/arch_error.h @@ -3,6 +3,7 @@ #include "vtr_error.h" #include +#include //Note that we mark this function with the C++11 attribute 'noreturn' //as it will throw exceptions and not return normally. This can help @@ -12,7 +13,7 @@ class ArchFpgaError : public vtr::VtrError { public: ArchFpgaError(std::string msg = "", std::string new_filename = "", size_t new_linenumber = -1) - : vtr::VtrError(msg, new_filename, new_linenumber) {} + : vtr::VtrError(std::move(msg), std::move(new_filename), new_linenumber) {} }; #endif diff --git a/libs/libarchfpga/src/arch_util.cpp b/libs/libarchfpga/src/arch_util.cpp index 27780c42ab4..b8d541b8c9e 100644 --- a/libs/libarchfpga/src/arch_util.cpp +++ b/libs/libarchfpga/src/arch_util.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "vtr_assert.h" #include "vtr_memory.h" @@ -16,7 +17,7 @@ static void free_all_pb_graph_nodes(std::vector& type_desc static void free_pb_graph(t_pb_graph_node* pb_graph_node); static void free_pb_type(t_pb_type* pb_type); -InstPort::InstPort(std::string str) { +InstPort::InstPort(const std::string& str) { std::vector inst_port = vtr::split(str, "."); if (inst_port.size() == 1) { @@ -33,10 +34,10 @@ InstPort::InstPort(std::string str) { } } -InstPort::name_index InstPort::parse_name_index(std::string str) { - auto open_bracket_pos = str.find("["); - auto close_bracket_pos = str.find("]"); - auto colon_pos = str.find(":"); +InstPort::name_index InstPort::parse_name_index(const std::string& str) { + auto open_bracket_pos = str.find('['); + auto close_bracket_pos = str.find(']'); + auto colon_pos = str.find(':'); //Parse checks if (open_bracket_pos == std::string::npos && close_bracket_pos != std::string::npos) { @@ -1293,7 +1294,7 @@ void primitives_annotation_clock_match(t_pin_to_pin_annotation* annotation, } } -const t_segment_inf* find_segment(const t_arch* arch, std::string name) { +const t_segment_inf* find_segment(const t_arch* arch, const std::string& name) { for (size_t i = 0; i < (arch->Segments).size(); ++i) { const t_segment_inf* seg = &arch->Segments[i]; if (seg->name == name) { @@ -1305,7 +1306,7 @@ const t_segment_inf* find_segment(const t_arch* arch, std::string name) { } bool segment_exists(const t_arch* arch, std::string name) { - return find_segment(arch, name) != nullptr; + return find_segment(arch, std::move(name)) != nullptr; } bool is_library_model(const char* model_name) { diff --git a/libs/libarchfpga/src/arch_util.h b/libs/libarchfpga/src/arch_util.h index ca8d2a4c95a..8f21fbd808d 100644 --- a/libs/libarchfpga/src/arch_util.h +++ b/libs/libarchfpga/src/arch_util.h @@ -8,7 +8,7 @@ class InstPort { static constexpr int UNSPECIFIED = -1; InstPort() = default; - InstPort(std::string str); + InstPort(const std::string& str); std::string instance_name() const { return instance_.name; } std::string port_name() const { return port_.name; } @@ -31,7 +31,7 @@ class InstPort { int high_idx = UNSPECIFIED; }; - name_index parse_name_index(std::string str); + name_index parse_name_index(const std::string& str); name_index instance_; name_index port_; @@ -71,7 +71,7 @@ void primitives_annotation_clock_match(t_pin_to_pin_annotation* annotation, t_pb_type* parent_pb_type); bool segment_exists(const t_arch* arch, std::string name); -const t_segment_inf* find_segment(const t_arch* arch, std::string name); +const t_segment_inf* find_segment(const t_arch* arch, const std::string& name); bool is_library_model(const char* model_name); bool is_library_model(const t_model* model); #endif diff --git a/libs/libarchfpga/src/expr_eval.cpp b/libs/libarchfpga/src/expr_eval.cpp index b39da1e121b..31806794a25 100644 --- a/libs/libarchfpga/src/expr_eval.cpp +++ b/libs/libarchfpga/src/expr_eval.cpp @@ -132,7 +132,7 @@ static bool is_char_number(const char ch); static bool is_operator(const char ch); // returns true if the specified name is an known function operator -static bool is_function(std::string name); +static bool is_function(const std::string& name); // returns the length of any identifier (e.g. name, function) starting at the beginning of str static int identifier_length(const char* str); @@ -142,7 +142,7 @@ static bool goto_next_char(int* str_ind, const string& pw_formula, char ch); /**** Function Implementations ****/ /* returns integer result according to specified non-piece-wise formula and data */ -int parse_formula(std::string formula, const t_formula_data& mydata) { +int parse_formula(const std::string& formula, const t_formula_data& mydata) { int result = -1; /* output in reverse-polish notation */ @@ -208,7 +208,7 @@ int parse_piecewise_formula(const char* formula, const t_formula_data& mydata) { } tmp_ind_count = str_ind - tmp_ind_start; /* range start is between { and : */ substr = pw_formula.substr(tmp_ind_start, tmp_ind_count); - range_start = parse_formula(substr.c_str(), mydata); + range_start = parse_formula(substr, mydata); /* get the end of the range */ tmp_ind_start = str_ind + 1; @@ -218,7 +218,7 @@ int parse_piecewise_formula(const char* formula, const t_formula_data& mydata) { } tmp_ind_count = str_ind - tmp_ind_start; /* range end is between : and } */ substr = pw_formula.substr(tmp_ind_start, tmp_ind_count); - range_end = parse_formula(substr.c_str(), mydata); + range_end = parse_formula(substr, mydata); if (range_start > range_end) { archfpga_throw(__FILE__, __LINE__, "parse_piecewise_formula: range_start, %d, is bigger than range end, %d\n", range_start, range_end); @@ -254,7 +254,7 @@ int parse_piecewise_formula(const char* formula, const t_formula_data& mydata) { substr = pw_formula.substr(tmp_ind_start, tmp_ind_count); /* now parse the formula corresponding to the appropriate piece-wise range */ - result = parse_formula(substr.c_str(), mydata); + result = parse_formula(substr, mydata); return result; } @@ -387,7 +387,7 @@ static void get_formula_object(const char* ch, int& ichar, const t_formula_data& } ichar--; fobj->type = E_FML_NUMBER; - fobj->data.num = vtr::atoi(ss.str().c_str()); + fobj->data.num = vtr::atoi(ss.str()); } else { switch ((*ch)) { case '+': @@ -730,7 +730,7 @@ static bool is_operator(const char ch) { } } -static bool is_function(std::string name) { +static bool is_function(const std::string& name) { if (name == "min" || name == "max" || name == "gcd" diff --git a/libs/libarchfpga/src/expr_eval.h b/libs/libarchfpga/src/expr_eval.h index f3bca0e3bc0..177828c5da1 100644 --- a/libs/libarchfpga/src/expr_eval.h +++ b/libs/libarchfpga/src/expr_eval.h @@ -8,9 +8,9 @@ class t_formula_data { public: - void set_var_value(std::string var, int value) { vars_[var] = value; } + void set_var_value(const std::string& var, int value) { vars_[var] = value; } - int get_var_value(std::string var) const { + int get_var_value(const std::string& var) const { auto iter = vars_.find(var); if (iter == vars_.end()) { archfpga_throw(__FILE__, __LINE__, @@ -25,7 +25,7 @@ class t_formula_data { }; /* returns integer result according to specified formula and data */ -int parse_formula(std::string formula, const t_formula_data& mydata); +int parse_formula(const std::string& formula, const t_formula_data& mydata); /* returns integer result according to specified piece-wise formula and data */ int parse_piecewise_formula(const char* formula, const t_formula_data& mydata); diff --git a/libs/libarchfpga/src/parse_switchblocks.cpp b/libs/libarchfpga/src/parse_switchblocks.cpp index e9d8cad0bb9..73b36f07cd7 100644 --- a/libs/libarchfpga/src/parse_switchblocks.cpp +++ b/libs/libarchfpga/src/parse_switchblocks.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include #include #include @@ -253,7 +254,7 @@ static void parse_comma_separated_wire_points(const char* ch, std::vector +#include #include #include #include @@ -91,7 +92,7 @@ enum class e_sb_type; class t_metadata_value { public: explicit t_metadata_value(std::string v) - : value_(v) {} + : value_(std::move(v)) {} explicit t_metadata_value(const t_metadata_value& o) : value_(o.value_) {} @@ -107,14 +108,14 @@ struct t_metadata_dict : std::unordered_map< std::string, std::vector> { // Is this key present in the map? - inline bool has(std::string key) const { + inline bool has(const std::string& key) const { return this->count(key) >= 1; } // Get all metadata values matching key. // // Returns nullptr if key is not found. - inline const std::vector* get(std::string key) const { + inline const std::vector* get(const std::string& key) const { auto iter = this->find(key); if (iter != this->end()) { return &iter->second; @@ -127,7 +128,7 @@ struct t_metadata_dict : std::unordered_map< // Returns nullptr if key is not found or if multiple values are prsent // per key. inline const t_metadata_value* one(std::string key) const { - auto values = get(key); + auto values = get(std::move(key)); if (values == nullptr) { return nullptr; } @@ -138,11 +139,11 @@ struct t_metadata_dict : std::unordered_map< } // Adds value to key. - void add(std::string key, std::string value) { + void add(const std::string& key, std::string value) { // Get the iterator to the key, which may already have elements if // add was called with this key in the past. auto iter_inserted = this->emplace(key, std::vector()); - iter_inserted.first->second.push_back(t_metadata_value(value)); + iter_inserted.first->second.push_back(t_metadata_value(std::move(value))); } }; @@ -259,10 +260,10 @@ enum e_sb_location { */ struct t_grid_loc_spec { t_grid_loc_spec(std::string start, std::string end, std::string repeat, std::string incr) - : start_expr(start) - , end_expr(end) - , repeat_expr(repeat) - , incr_expr(incr) {} + : start_expr(std::move(start)) + , end_expr(std::move(end)) + , repeat_expr(std::move(repeat)) + , incr_expr(std::move(incr)) {} std::string start_expr; //Starting position (inclusive) std::string end_expr; //Ending position (inclusive) @@ -341,7 +342,7 @@ struct t_grid_loc_spec { */ struct t_grid_loc_def { t_grid_loc_def(std::string block_type_val, int priority_val) - : block_type(block_type_val) + : block_type(std::move(block_type_val)) , priority(priority_val) , x("0", "W-1", "max(w+1,W)", "w") //Fill in x direction, no repeat, incr by block width , y("0", "H-1", "max(h+1,H)", "h") //Fill in y direction, no repeat, incr by block height diff --git a/libs/libarchfpga/src/read_xml_arch_file.cpp b/libs/libarchfpga/src/read_xml_arch_file.cpp index 32381facab6..da5042fd106 100644 --- a/libs/libarchfpga/src/read_xml_arch_file.cpp +++ b/libs/libarchfpga/src/read_xml_arch_file.cpp @@ -118,7 +118,7 @@ static void ProcessEquivalentSiteDirectConnection(pugi::xml_node Parent, static void ProcessEquivalentSiteCustomConnection(pugi::xml_node Parent, t_physical_tile_type* PhysicalTileType, t_logical_block_type* LogicalBlockType, - std::string site_name, + const std::string& site_name, const pugiutil::loc_data& loc_data); static void ProcessPb_Type(pugi::xml_node Parent, t_pb_type* pb_type, @@ -212,15 +212,15 @@ void warn_model_missing_timing(pugi::xml_node model_tag, const pugiutil::loc_dat bool check_model_clocks(pugi::xml_node model_tag, const pugiutil::loc_data& loc_data, const t_model* model); bool check_leaf_pb_model_timing_consistency(const t_pb_type* pb_type, const t_arch& arch); const t_pin_to_pin_annotation* find_sequential_annotation(const t_pb_type* pb_type, const t_model_ports* port, enum e_pin_to_pin_delay_annotations annot_type); -const t_pin_to_pin_annotation* find_combinational_annotation(const t_pb_type* pb_type, std::string in_port, std::string out_port); +const t_pin_to_pin_annotation* find_combinational_annotation(const t_pb_type* pb_type, const std::string& in_port, const std::string& out_port); std::string inst_port_to_port_name(std::string inst_port); static bool attribute_to_bool(const pugi::xml_node node, const pugi::xml_attribute attr, const pugiutil::loc_data& loc_data); -int find_switch_by_name(const t_arch& arch, std::string switch_name); +int find_switch_by_name(const t_arch& arch, const std::string& switch_name); -e_side string_to_side(std::string side_str); +e_side string_to_side(const std::string& side_str); static void link_physical_logical_types(std::vector& PhysicalTileTypes, std::vector& LogicalBlockTypes); @@ -3276,7 +3276,7 @@ static void ProcessEquivalentSiteDirectConnection(pugi::xml_node Parent, static void ProcessEquivalentSiteCustomConnection(pugi::xml_node Parent, t_physical_tile_type* PhysicalTileType, t_logical_block_type* LogicalBlockType, - std::string site_name, + const std::string& site_name, const pugiutil::loc_data& loc_data) { pugi::xml_node CurDirect; @@ -4727,7 +4727,7 @@ const t_pin_to_pin_annotation* find_sequential_annotation(const t_pb_type* pb_ty return nullptr; } -const t_pin_to_pin_annotation* find_combinational_annotation(const t_pb_type* pb_type, std::string in_port, std::string out_port) { +const t_pin_to_pin_annotation* find_combinational_annotation(const t_pb_type* pb_type, const std::string& in_port, const std::string& out_port) { for (int iannot = 0; iannot < pb_type->num_annotations; ++iannot) { const t_pin_to_pin_annotation* annot = &pb_type->annotations[iannot]; for (const auto& annot_in_str : vtr::split(annot->input_pins)) { @@ -4770,7 +4770,7 @@ static bool attribute_to_bool(const pugi::xml_node node, return false; } -int find_switch_by_name(const t_arch& arch, std::string switch_name) { +int find_switch_by_name(const t_arch& arch, const std::string& switch_name) { for (int iswitch = 0; iswitch < arch.num_switches; ++iswitch) { const t_arch_switch_inf& arch_switch = arch.Switches[iswitch]; if (arch_switch.name == switch_name) { @@ -4781,7 +4781,7 @@ int find_switch_by_name(const t_arch& arch, std::string switch_name) { return OPEN; } -e_side string_to_side(std::string side_str) { +e_side string_to_side(const std::string& side_str) { e_side side = NUM_SIDES; if (side_str.empty()) { side = NUM_SIDES; diff --git a/libs/libarchfpga/src/read_xml_util.cpp b/libs/libarchfpga/src/read_xml_util.cpp index 784d08a9b4f..bd5ee109247 100644 --- a/libs/libarchfpga/src/read_xml_util.cpp +++ b/libs/libarchfpga/src/read_xml_util.cpp @@ -13,7 +13,7 @@ extern ReqOpt BoolToReqOpt(bool b) { return ReqOpt::OPTIONAL; } -InstPort make_inst_port(std::string str, pugi::xml_node node, const pugiutil::loc_data& loc_data) { +InstPort make_inst_port(const std::string& str, pugi::xml_node node, const pugiutil::loc_data& loc_data) { InstPort inst_port; try { inst_port = InstPort(str); @@ -43,7 +43,7 @@ InstPort make_inst_port(pugi::xml_attribute attr, pugi::xml_node node, const pug void bad_tag(const pugi::xml_node node, const pugiutil::loc_data& loc_data, const pugi::xml_node parent_node, - const std::vector expected_tags) { + const std::vector& expected_tags) { std::string msg = "Unexpected tag "; msg += "<"; msg += node.name(); @@ -76,7 +76,7 @@ void bad_tag(const pugi::xml_node node, void bad_attribute(const pugi::xml_attribute attr, const pugi::xml_node node, const pugiutil::loc_data& loc_data, - const std::vector expected_attributes) { + const std::vector& expected_attributes) { std::string msg = "Unexpected attribute "; msg += "'"; msg += attr.name(); @@ -109,7 +109,7 @@ void bad_attribute(const pugi::xml_attribute attr, void bad_attribute_value(const pugi::xml_attribute attr, const pugi::xml_node node, const pugiutil::loc_data& loc_data, - const std::vector expected_values) { + const std::vector& expected_values) { std::string msg = "Invalid value '"; msg += attr.value(); msg += "'"; diff --git a/libs/libarchfpga/src/read_xml_util.h b/libs/libarchfpga/src/read_xml_util.h index 05a77ab0377..6ebd45594b9 100644 --- a/libs/libarchfpga/src/read_xml_util.h +++ b/libs/libarchfpga/src/read_xml_util.h @@ -11,18 +11,18 @@ pugiutil::ReqOpt BoolToReqOpt(bool b); void bad_tag(const pugi::xml_node node, const pugiutil::loc_data& loc_data, const pugi::xml_node parent_node = pugi::xml_node(), - const std::vector expected_tags = std::vector()); + const std::vector& expected_tags = std::vector()); void bad_attribute(const pugi::xml_attribute attr, const pugi::xml_node node, const pugiutil::loc_data& loc_data, - const std::vector expected_attributes = std::vector()); + const std::vector& expected_attributes = std::vector()); void bad_attribute_value(const pugi::xml_attribute attr, const pugi::xml_node node, const pugiutil::loc_data& loc_data, - const std::vector expected_attributes = std::vector()); + const std::vector& expected_attributes = std::vector()); -InstPort make_inst_port(std::string str, pugi::xml_node node, const pugiutil::loc_data& loc_data); +InstPort make_inst_port(const std::string& str, pugi::xml_node node, const pugiutil::loc_data& loc_data); InstPort make_inst_port(pugi::xml_attribute attr, pugi::xml_node node, const pugiutil::loc_data& loc_data); #endif diff --git a/libs/libpugiutil/src/pugixml_loc.hpp b/libs/libpugiutil/src/pugixml_loc.hpp index 0f597a593b1..a2e60743fd1 100644 --- a/libs/libpugiutil/src/pugixml_loc.hpp +++ b/libs/libpugiutil/src/pugixml_loc.hpp @@ -5,6 +5,7 @@ * hanlding the retrieval of line numbers (useful for error messages) */ +#include #include #include "pugixml.hpp" @@ -16,7 +17,7 @@ class loc_data { loc_data() = default; loc_data(std::string filename_val) - : filename_(filename_val) { + : filename_(std::move(filename_val)) { build_loc_data(); } diff --git a/libs/libpugiutil/src/pugixml_util.cpp b/libs/libpugiutil/src/pugixml_util.cpp index d4d2a398246..f12466d9237 100644 --- a/libs/libpugiutil/src/pugixml_util.cpp +++ b/libs/libpugiutil/src/pugixml_util.cpp @@ -1,13 +1,14 @@ #include "pugixml_util.hpp" #include +#include namespace pugiutil { //Loads the XML file specified by filename into the passed pugi::xml_document // //Returns loc_data look-up for xml node line numbers -loc_data load_xml(pugi::xml_document& doc, //Document object to be loaded with file contents - const std::string filename) { //Filename to load from +loc_data load_xml(pugi::xml_document& doc, //Document object to be loaded with file contents + const std::string& filename) { //Filename to load from auto location_data = loc_data(filename); auto load_result = doc.load_file(filename.c_str()); @@ -17,7 +18,7 @@ loc_data load_xml(pugi::xml_document& doc, //Document object to be loaded w auto col = location_data.col(load_result.offset); throw XmlError("Unable to load XML file '" + filename + "', " + msg + " (line: " + std::to_string(line) + " col: " + std::to_string(col) + ")", - filename.c_str(), line); + filename, line); } return location_data; @@ -110,7 +111,7 @@ size_t count_children(const pugi::xml_node node, // loc_data - XML file location data // expected_count - The expected number of child nodes void expect_child_node_count(const pugi::xml_node node, - std::string child_name, + const std::string& child_name, size_t expected_count, const loc_data& loc_data) { size_t actual_count = count_children(node, child_name, loc_data, OPTIONAL); @@ -188,7 +189,7 @@ void expect_only_children(const pugi::xml_node node, // loc_data - XML file location data void expect_only_attributes(const pugi::xml_node node, std::vector attribute_names, - std::string explanation, + const std::string& explanation, const loc_data& loc_data) { for (auto attrib : node.attributes()) { std::string attrib_name = attrib.name(); @@ -233,7 +234,7 @@ void expect_only_attributes(const pugi::xml_node node, void expect_only_attributes(const pugi::xml_node node, std::vector attribute_names, const loc_data& loc_data) { - expect_only_attributes(node, attribute_names, "", loc_data); + expect_only_attributes(node, std::move(attribute_names), "", loc_data); } //Counts the number of attributes on the specified node diff --git a/libs/libpugiutil/src/pugixml_util.hpp b/libs/libpugiutil/src/pugixml_util.hpp index 8e55f232bc0..d687363bb7c 100644 --- a/libs/libpugiutil/src/pugixml_util.hpp +++ b/libs/libpugiutil/src/pugixml_util.hpp @@ -13,6 +13,7 @@ * messages if the requested item does not exists). */ +#include #include #include #include @@ -26,9 +27,9 @@ namespace pugiutil { //An error produced while getting an XML node/attribute class XmlError : public std::runtime_error { public: - XmlError(std::string msg = "", std::string new_filename = "", size_t new_linenumber = -1) + XmlError(const std::string& msg = "", std::string new_filename = "", size_t new_linenumber = -1) : std::runtime_error(msg) - , filename_(new_filename) + , filename_(std::move(new_filename)) , linenumber_(new_linenumber) {} //Returns the filename associated with this error @@ -48,8 +49,8 @@ class XmlError : public std::runtime_error { //Loads the XML file specified by filename into the passed pugi::xml_docment // //Returns loc_data look-up for xml node line numbers -loc_data load_xml(pugi::xml_document& doc, //Document object to be loaded with file contents - const std::string filename); //Filename to load from +loc_data load_xml(pugi::xml_document& doc, //Document object to be loaded with file contents + const std::string& filename); //Filename to load from //Defines whether something (e.g. a node/attribute) is optional or required. // We use this to improve clarity at the function call site (compared to just @@ -118,7 +119,7 @@ size_t count_children(const pugi::xml_node node, // loc_data - XML file location data // expected_count - The expected number of child nodes void expect_child_node_count(const pugi::xml_node node, - std::string child_name, + const std::string& child_name, size_t expected_count, const loc_data& loc_data); @@ -159,7 +160,7 @@ void expect_only_attributes(const pugi::xml_node node, // loc_data - XML file location data void expect_only_attributes(const pugi::xml_node node, std::vector attribute_names, - std::string explanation, + const std::string& explanation, const loc_data& loc_data); //Counts the number of attributes on the specified node diff --git a/libs/librtlnumber/main.cpp b/libs/librtlnumber/main.cpp index 8cb9de018fe..0fcbe2fc1b6 100644 --- a/libs/librtlnumber/main.cpp +++ b/libs/librtlnumber/main.cpp @@ -14,7 +14,7 @@ #include "rtl_utils.hpp" #define bad_ops(test) _bad_ops(test, __func__, __LINE__) -inline static std::string _bad_ops(std::string test, const char *FUNCT, int LINE) +inline static std::string _bad_ops(const std::string& test, const char *FUNCT, int LINE) { std::cerr << "INVALID INPUT OPS: (" << test << ")@" << FUNCT << "::" << std::to_string(LINE) << std::endl; std::abort(); @@ -28,7 +28,7 @@ inline static std::string _bad_ops(std::string test, const char *FUNCT, int LINE * This is used for testing purposes only, unused in ODIN as the input is already preprocessed */ -static std::string arithmetic(std::string op, std::string a_in) +static std::string arithmetic(const std::string& op, const std::string& a_in) { VNumber a(a_in); @@ -53,7 +53,7 @@ static std::string arithmetic(std::string op, std::string a_in) ).to_full_string(); } -static std::string arithmetic(std::string a_in, std::string op, std::string b_in) +static std::string arithmetic(const std::string& a_in, const std::string& op, const std::string& b_in) { VNumber a(a_in); @@ -101,9 +101,10 @@ static std::string arithmetic(std::string a_in, std::string op, std::string b_in int main(int argc, char** argv) { std::vector input; - for(int i=0; i < argc; i++) input.push_back(argv[i]); + input.reserve(argc); +for(int i=0; i < argc; i++) input.push_back(argv[i]); - std::string result = ""; + std::string result; if(argc < 3) { diff --git a/libs/librtlnumber/src/include/internal_bits.hpp b/libs/librtlnumber/src/include/internal_bits.hpp index 669dd09b6ba..4fc4c215a9d 100644 --- a/libs/librtlnumber/src/include/internal_bits.hpp +++ b/libs/librtlnumber/src/include/internal_bits.hpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include "rtl_utils.hpp" @@ -687,7 +688,7 @@ class VNumber VNumber(BitSpace::VerilogBits other_bitstring, bool other_defined_size, bool other_sign) { - bitstring = BitSpace::VerilogBits(other_bitstring); + bitstring = BitSpace::VerilogBits(std::move(other_bitstring)); sign = other_sign; defined_size = other_defined_size; } diff --git a/libs/librtlnumber/src/include/rtl_utils.hpp b/libs/librtlnumber/src/include/rtl_utils.hpp index 0183dff2236..207623de85c 100644 --- a/libs/librtlnumber/src/include/rtl_utils.hpp +++ b/libs/librtlnumber/src/include/rtl_utils.hpp @@ -39,7 +39,7 @@ std::string string_of_radix_to_bitstring(std::string orig_string, size_t radix); -inline void _assert_Werr(bool cond, const char *FUNCT, int LINE, std::string error_string) +inline void _assert_Werr(bool cond, const char *FUNCT, int LINE, const std::string& error_string) { if (!cond) { std::cerr << std::endl << "ERROR: " << FUNCT << "::" << std::to_string(LINE) << " Assert 'assert_Werr' Failed:\t" << error_string << "!" << std::endl << std::endl; diff --git a/libs/librtlnumber/src/rtl_utils.cpp b/libs/librtlnumber/src/rtl_utils.cpp index ba1ac9ac621..0ccde74f0ca 100644 --- a/libs/librtlnumber/src/rtl_utils.cpp +++ b/libs/librtlnumber/src/rtl_utils.cpp @@ -111,7 +111,7 @@ static std::string _radix_digit_to_bits_str(const char digit, size_t radix, con } case 256: { - std::string bitstring = ""; + std::string bitstring; char temp = digit; // 8 bit per char for(int i=0; i<8; i++) @@ -146,7 +146,7 @@ static std::string _radix_digit_to_bits(const char digit, size_t radix, const c */ std::string string_of_radix_to_bitstring(std::string orig_string, size_t radix) { - std::string result = ""; + std::string result; switch(radix) { @@ -199,7 +199,7 @@ std::string string_of_radix_to_bitstring(std::string orig_string, size_t radix) { case 10: { - std::string new_number = ""; + std::string new_number; uint8_t rem_digit = 0; for(char current_digit : orig_string) diff --git a/libs/libvtrutil/src/vtr_error.h b/libs/libvtrutil/src/vtr_error.h index a8b77c52f3b..7ad77ed9129 100644 --- a/libs/libvtrutil/src/vtr_error.h +++ b/libs/libvtrutil/src/vtr_error.h @@ -3,14 +3,15 @@ #include #include +#include namespace vtr { class VtrError : public std::runtime_error { public: - VtrError(std::string msg = "", std::string new_filename = "", size_t new_linenumber = -1) + VtrError(const std::string& msg = "", std::string new_filename = "", size_t new_linenumber = -1) : std::runtime_error(msg) - , filename_(new_filename) + , filename_(std::move(new_filename)) , linenumber_(new_linenumber) {} //Returns the filename associated with this error diff --git a/libs/libvtrutil/src/vtr_log.cpp b/libs/libvtrutil/src/vtr_log.cpp index 0615e71abe5..8c8e3aafa24 100644 --- a/libs/libvtrutil/src/vtr_log.cpp +++ b/libs/libvtrutil/src/vtr_log.cpp @@ -19,11 +19,11 @@ void set_log_file(const char* filename) { } // namespace vtr -void add_warnings_to_suppress(std::string function_name) { +void add_warnings_to_suppress(const std::string& function_name) { warnings_to_suppress.insert(function_name); } -void set_noisy_warn_log_file(std::string log_file_name) { +void set_noisy_warn_log_file(const std::string& log_file_name) { std::ofstream log; log.open(log_file_name, std::ifstream::out | std::ifstream::trunc); log.close(); diff --git a/libs/libvtrutil/src/vtr_log.h b/libs/libvtrutil/src/vtr_log.h index a0458629aec..3c08619d751 100644 --- a/libs/libvtrutil/src/vtr_log.h +++ b/libs/libvtrutil/src/vtr_log.h @@ -145,11 +145,11 @@ void set_log_file(const char* filename); static std::unordered_set warnings_to_suppress; static std::string noisy_warn_log_file; -void add_warnings_to_suppress(std::string function_name); +void add_warnings_to_suppress(const std::string& function_name); // This function creates a new log file to hold the suppressed warnings. // If the file already exists, it is cleared out first. -void set_noisy_warn_log_file(std::string log_file_name); +void set_noisy_warn_log_file(const std::string& log_file_name); // This function checks whether the function from which the warning has been called // is in the set of warnings_to_suppress. If so, the warning is printed on the diff --git a/libs/libvtrutil/src/vtr_time.cpp b/libs/libvtrutil/src/vtr_time.cpp index 89def557455..ba3eb1a73c4 100644 --- a/libs/libvtrutil/src/vtr_time.cpp +++ b/libs/libvtrutil/src/vtr_time.cpp @@ -1,5 +1,7 @@ #include "vtr_time.h" +#include + #include "vtr_log.h" #include "vtr_rusage.h" @@ -25,7 +27,7 @@ float Timer::delta_max_rss_mib() const { } ScopedActionTimer::ScopedActionTimer(std::string action_str) - : action_(action_str) + : action_(std::move(action_str)) , depth_(f_timer_depth++) { } @@ -57,7 +59,7 @@ int ScopedActionTimer::depth() const { } ScopedFinishTimer::ScopedFinishTimer(std::string action_str) - : ScopedActionTimer(action_str) { + : ScopedActionTimer(std::move(action_str)) { } ScopedFinishTimer::~ScopedFinishTimer() { @@ -69,7 +71,7 @@ ScopedFinishTimer::~ScopedFinishTimer() { } ScopedStartFinishTimer::ScopedStartFinishTimer(std::string action_str) - : ScopedActionTimer(action_str) { + : ScopedActionTimer(std::move(action_str)) { vtr::printf_info("%s%s\n", pad().c_str(), action().c_str()); } diff --git a/libs/libvtrutil/src/vtr_util.cpp b/libs/libvtrutil/src/vtr_util.cpp index 71bcf09315c..650997eb111 100644 --- a/libs/libvtrutil/src/vtr_util.cpp +++ b/libs/libvtrutil/src/vtr_util.cpp @@ -18,7 +18,7 @@ static int cont; /* line continued? (used by strtok)*/ //Splits the string 'text' along the specified delimiter characters in 'delims' //The split strings (excluding the delimiters) are returned -std::vector split(const char* text, const std::string delims) { +std::vector split(const char* text, const std::string& delims) { if (text) { std::string text_str(text); return split(text_str, delims); @@ -26,7 +26,7 @@ std::vector split(const char* text, const std::string delims) { return std::vector(); } -std::vector split(const std::string& text, const std::string delims) { +std::vector split(const std::string& text, const std::string& delims) { std::vector tokens; std::string curr_tok; @@ -87,7 +87,7 @@ std::string replace_all(const std::string& input, const std::string& search, con } //Retruns true if str starts with prefix -bool starts_with(std::string str, std::string prefix) { +bool starts_with(const std::string& str, const std::string& prefix) { return str.find(prefix) == 0; } diff --git a/libs/libvtrutil/src/vtr_util.h b/libs/libvtrutil/src/vtr_util.h index 93fd61c6f5f..b8db0a04259 100644 --- a/libs/libvtrutil/src/vtr_util.h +++ b/libs/libvtrutil/src/vtr_util.h @@ -10,8 +10,8 @@ namespace vtr { //Splits the string 'text' along the specified delimiter characters in 'delims' //The split strings (excluding the delimiters) are returned -std::vector split(const char* text, const std::string delims = " \t\n"); -std::vector split(const std::string& text, const std::string delims = " \t\n"); +std::vector split(const char* text, const std::string& delims = " \t\n"); +std::vector split(const std::string& text, const std::string& delims = " \t\n"); //Returns 'input' with the first instance of 'search' replaced with 'replace' std::string replace_first(const std::string& input, const std::string& search, const std::string& replace); @@ -20,7 +20,7 @@ std::string replace_first(const std::string& input, const std::string& search, c std::string replace_all(const std::string& input, const std::string& search, const std::string& replace); //Retruns true if str starts with prefix -bool starts_with(std::string str, std::string prefix); +bool starts_with(const std::string& str, const std::string& prefix); //Returns a std::string formatted using a printf-style format string std::string string_fmt(const char* fmt, ...); @@ -33,7 +33,7 @@ std::string vstring_fmt(const char* fmt, va_list args); // For example the sequence {"home", "user", "my_files", "test.blif"} with delim="/" // would return "home/user/my_files/test.blif" template -std::string join(Iter begin, Iter end, std::string delim); +std::string join(Iter begin, Iter end, const std::string& delim); template std::string join(Container container, std::string delim); @@ -77,7 +77,7 @@ std::vector ReadLineTokens(FILE* InFile, int* LineNum); * Template implementations */ template -std::string join(Iter begin, Iter end, std::string delim) { +std::string join(Iter begin, Iter end, const std::string& delim) { std::string joined_str; for (auto iter = begin; iter != end; ++iter) { joined_str += *iter; diff --git a/utils/fasm/src/fasm.cpp b/utils/fasm/src/fasm.cpp index 64607f6a6b8..e854245037f 100644 --- a/utils/fasm/src/fasm.cpp +++ b/utils/fasm/src/fasm.cpp @@ -174,7 +174,7 @@ static std::string handle_fasm_prefix(const t_metadata_dict *meta, } std::string FasmWriterVisitor::build_clb_prefix(const t_pb *pb, const t_pb_graph_node* pb_graph_node, bool* is_parent_pb_null) const { - std::string clb_prefix = ""; + std::string clb_prefix; const t_pb *pb_for_graph_node = nullptr; @@ -415,7 +415,7 @@ static LogicVec lut_outputs(const t_pb* atom_pb, size_t num_inputs, const t_pb_r return lut.table(); } -static const t_metadata_dict *get_fasm_type(const t_pb_graph_node* pb_graph_node, std::string target_type) { +static const t_metadata_dict *get_fasm_type(const t_pb_graph_node* pb_graph_node, const std::string& target_type) { if(pb_graph_node == nullptr) { return nullptr; } @@ -564,7 +564,7 @@ void FasmWriterVisitor::check_for_param(const t_pb *atom) { VTR_ASSERT(value != nullptr); std::string fasm_params = value->as_string(); - for(const auto param : vtr::split(fasm_params, "\n")) { + for(const auto& param : vtr::split(fasm_params, "\n")) { auto param_parts = split_fasm_entry(param, "=", "\t "); if(param_parts.size() == 0) { continue; @@ -584,7 +584,7 @@ void FasmWriterVisitor::check_for_param(const t_pb *atom) { auto ¶ms = iter->second; - for(auto param : atom_ctx.nlist.block_params(atom_blk_id)) { + for(const auto& param : atom_ctx.nlist.block_params(atom_blk_id)) { auto feature = params.EmitFasmFeature(param.first, param.second); if(feature.size() > 0) { @@ -669,7 +669,7 @@ void FasmWriterVisitor::find_clb_prefix(const t_pb_graph_node *node, } } -void FasmWriterVisitor::output_fasm_mux(std::string fasm_mux, +void FasmWriterVisitor::output_fasm_mux(const std::string& fasm_mux, t_interconnect *interconnect, t_pb_graph_pin *mux_input_pin) { auto *pb_name = mux_input_pin->parent_node->pb_type->name; @@ -741,11 +741,11 @@ void FasmWriterVisitor::output_fasm_mux(std::string fasm_mux, pb_name, pb_index, port_name, pin_index, fasm_mux.c_str()); } -void FasmWriterVisitor::output_fasm_features(const std::string features) const { +void FasmWriterVisitor::output_fasm_features(const std::string& features) const { output_fasm_features(features, clb_prefix_, blk_prefix_); } -void FasmWriterVisitor::output_fasm_features(const std::string features, const std::string clb_prefix, const std::string blk_prefix) const { +void FasmWriterVisitor::output_fasm_features(const std::string& features, const std::string& clb_prefix, const std::string& blk_prefix) const { std::stringstream os(features); while(os) { diff --git a/utils/fasm/src/fasm.h b/utils/fasm/src/fasm.h index 892dc6a83d7..583e24c0be8 100644 --- a/utils/fasm/src/fasm.h +++ b/utils/fasm/src/fasm.h @@ -66,12 +66,12 @@ class FasmWriterVisitor : public NetlistVisitor { void finish_impl() override; private: - void output_fasm_features(const std::string features) const; - void output_fasm_features(const std::string features, const std::string clb_prefix, const std::string blk_prefix) const; + void output_fasm_features(const std::string& features) const; + void output_fasm_features(const std::string& features, const std::string& clb_prefix, const std::string& blk_prefix) const; void check_features(const t_metadata_dict *meta) const; void check_interconnect(const t_pb_routes &pb_route, int inode); void check_for_lut(const t_pb* atom); - void output_fasm_mux(std::string fasm_mux, t_interconnect *interconnect, t_pb_graph_pin *mux_input_pin); + void output_fasm_mux(const std::string& fasm_mux, t_interconnect *interconnect, t_pb_graph_pin *mux_input_pin); void walk_routing(); void walk_route_tree(const t_rt_node *root); std::string build_clb_prefix(const t_pb *pb, const t_pb_graph_node* pb_graph_node, bool* is_parent_pb_null) const; diff --git a/utils/fasm/src/fasm_utils.cpp b/utils/fasm/src/fasm_utils.cpp index b7e7027fa12..add8a9dd584 100644 --- a/utils/fasm/src/fasm_utils.cpp +++ b/utils/fasm/src/fasm_utils.cpp @@ -2,10 +2,11 @@ #include "vpr_utils.h" #include +#include namespace fasm { -void parse_name_with_optional_index(const std::string in, std::string *name, int *index) { +void parse_name_with_optional_index(const std::string& in, std::string *name, int *index) { auto in_parts = vtr::split(in, "[]"); if(in_parts.size() == 1) { @@ -22,14 +23,14 @@ void parse_name_with_optional_index(const std::string in, std::string *name, int std::vector split_fasm_entry(std::string entry, std::string delims, - std::string ignore) { + const std::string& ignore) { for (size_t ii=0; ii find_tags_in_feature (const std::string& a_String) { @@ -61,7 +62,7 @@ std::string substitute_tags (const std::string& a_Feature, const std::map split_fasm_entry(std::string entry, std::string delims, - std::string ignore); + const std::string& ignore); // Searches for tags in given string, returns their names in a vector. std::vector find_tags_in_feature (const std::string& a_String); diff --git a/utils/fasm/src/lut.cpp b/utils/fasm/src/lut.cpp index 5356fdce922..5f568d611bd 100644 --- a/utils/fasm/src/lut.cpp +++ b/utils/fasm/src/lut.cpp @@ -58,7 +58,7 @@ const LogicVec & Lut::table() { return table_; } -LutOutputDefinition::LutOutputDefinition(std::string definition) { +LutOutputDefinition::LutOutputDefinition(const std::string& definition) { // Parse LUT.INIT[63:0] into // fasm_feature = LUT.INIT // start_bit = 0 diff --git a/utils/fasm/src/lut.h b/utils/fasm/src/lut.h index 798accc856d..41cf01ea4a5 100644 --- a/utils/fasm/src/lut.h +++ b/utils/fasm/src/lut.h @@ -35,7 +35,7 @@ class Lut { // Utility class that creates a FASM feature directive based on the FASM LUT definition. struct LutOutputDefinition { // Definition should be of the format [:& Segments, - const t_timing_inf Timing, + const t_timing_inf& Timing, const t_chan_width_dist Chans) { int i; int Tmp; diff --git a/vpr/src/base/CheckSetup.h b/vpr/src/base/CheckSetup.h index d1e18764d9a..7f513467849 100644 --- a/vpr/src/base/CheckSetup.h +++ b/vpr/src/base/CheckSetup.h @@ -7,7 +7,7 @@ void CheckSetup(const t_packer_opts& PackerOpts, const t_router_opts& RouterOpts, const t_det_routing_arch& RoutingArch, const std::vector& Segments, - const t_timing_inf Timing, + const t_timing_inf& Timing, const t_chan_width_dist Chans); #endif diff --git a/vpr/src/base/SetupGrid.cpp b/vpr/src/base/SetupGrid.cpp index e306dda21a5..02c5e44fa61 100644 --- a/vpr/src/base/SetupGrid.cpp +++ b/vpr/src/base/SetupGrid.cpp @@ -26,8 +26,8 @@ static DeviceGrid auto_size_device_grid(const std::vector& grid_layouts, const std::map& minimum_instance_counts, float maximum_device_utilization); static std::vector grid_overused_resources(const DeviceGrid& grid, std::map instance_counts); -static bool grid_satisfies_instance_counts(const DeviceGrid& grid, std::map instance_counts, float maximum_utilization); -static DeviceGrid build_device_grid(const t_grid_def& grid_def, size_t width, size_t height, bool warn_out_of_range = true, std::vector limiting_resources = std::vector()); +static bool grid_satisfies_instance_counts(const DeviceGrid& grid, const std::map& instance_counts, float maximum_utilization); +static DeviceGrid build_device_grid(const t_grid_def& grid_def, size_t width, size_t height, bool warn_out_of_range = true, const std::vector& limiting_resources = std::vector()); static void CheckGrid(const DeviceGrid& grid); @@ -278,7 +278,7 @@ static std::vector grid_overused_resources(const Devic return overused_resources; } -static bool grid_satisfies_instance_counts(const DeviceGrid& grid, std::map instance_counts, float maximum_utilization) { +static bool grid_satisfies_instance_counts(const DeviceGrid& grid, const std::map& instance_counts, float maximum_utilization) { //Are the resources satisified? auto overused_resources = grid_overused_resources(grid, instance_counts); @@ -297,7 +297,7 @@ static bool grid_satisfies_instance_counts(const DeviceGrid& grid, std::map limiting_resources) { +static DeviceGrid build_device_grid(const t_grid_def& grid_def, size_t grid_width, size_t grid_height, bool warn_out_of_range, const std::vector& limiting_resources) { if (grid_def.grid_type == GridDefType::FIXED) { if (grid_def.width != int(grid_width) || grid_def.height != int(grid_height)) { VPR_FATAL_ERROR(VPR_ERROR_OTHER, @@ -677,7 +677,7 @@ static void CheckGrid(const DeviceGrid& grid) { } } -float calculate_device_utilization(const DeviceGrid& grid, std::map instance_counts) { +float calculate_device_utilization(const DeviceGrid& grid, const std::map& instance_counts) { //Record the resources of the grid std::map grid_resources; for (size_t x = 0; x < grid.width(); ++x) { diff --git a/vpr/src/base/SetupGrid.h b/vpr/src/base/SetupGrid.h index 7691025c9ef..b18f6636133 100644 --- a/vpr/src/base/SetupGrid.h +++ b/vpr/src/base/SetupGrid.h @@ -21,7 +21,7 @@ DeviceGrid create_device_grid(std::string layout_name, DeviceGrid create_device_grid(std::string layout_name, const std::vector& grid_layouts, size_t min_width, size_t min_height); //Calculate the device utilization (i.e. fraction of used grid tiles) for the specified grid and resource requirements -float calculate_device_utilization(const DeviceGrid& grid, std::map instance_counts); +float calculate_device_utilization(const DeviceGrid& grid, const std::map& instance_counts); //Returns the effective size of the device (size of the bounding box of non-empty grid tiles) size_t count_grid_tiles(const DeviceGrid& grid); diff --git a/vpr/src/base/atom_netlist.cpp b/vpr/src/base/atom_netlist.cpp index f911f47d190..acca67a5327 100644 --- a/vpr/src/base/atom_netlist.cpp +++ b/vpr/src/base/atom_netlist.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "atom_netlist.h" @@ -17,7 +18,7 @@ * */ AtomNetlist::AtomNetlist(std::string name, std::string id) - : Netlist(name, id) {} + : Netlist(std::move(name), std::move(id)) {} /* * @@ -107,7 +108,7 @@ AtomBlockId AtomNetlist::find_atom_pin_driver(const AtomBlockId blk_id, const t_ * Mutators * */ -AtomBlockId AtomNetlist::create_block(const std::string name, const t_model* model, const TruthTable truth_table) { +AtomBlockId AtomNetlist::create_block(const std::string& name, const t_model* model, const TruthTable& truth_table) { AtomBlockId blk_id = Netlist::create_block(name); //Initialize the data @@ -175,7 +176,7 @@ AtomPinId AtomNetlist::create_pin(const AtomPortId port_id, BitIndex port_bit, c return pin_id; } -AtomNetId AtomNetlist::create_net(const std::string name) { +AtomNetId AtomNetlist::create_net(const std::string& name) { AtomNetId net_id = Netlist::create_net(name); //Check post-conditions: size @@ -184,8 +185,8 @@ AtomNetId AtomNetlist::create_net(const std::string name) { return net_id; } -AtomNetId AtomNetlist::add_net(const std::string name, AtomPinId driver, std::vector sinks) { - return Netlist::add_net(name, driver, sinks); +AtomNetId AtomNetlist::add_net(const std::string& name, AtomPinId driver, std::vector sinks) { + return Netlist::add_net(name, driver, std::move(sinks)); } void AtomNetlist::remove_block_impl(const AtomBlockId /*blk_id*/) { diff --git a/vpr/src/base/atom_netlist.h b/vpr/src/base/atom_netlist.h index f49bc4af079..62091a33169 100644 --- a/vpr/src/base/atom_netlist.h +++ b/vpr/src/base/atom_netlist.h @@ -139,7 +139,7 @@ class AtomNetlist : public Netlist sinks); + AtomNetId add_net(const std::string& name, AtomPinId driver, std::vector sinks); private: //Private members /* diff --git a/vpr/src/base/atom_netlist_utils.cpp b/vpr/src/base/atom_netlist_utils.cpp index ea32a2d071b..b23870ac455 100644 --- a/vpr/src/base/atom_netlist_utils.cpp +++ b/vpr/src/base/atom_netlist_utils.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "vtr_assert.h" #include "vtr_log.h" @@ -43,7 +44,7 @@ bool remove_buffer_lut(AtomNetlist& netlist, AtomBlockId blk, int verbosity); std::string make_unconn(size_t& unconn_count, PinType type); void cube_to_minterms_recurr(std::vector cube, std::vector& minterms); -void print_netlist_as_blif(std::string filename, const AtomNetlist& netlist) { +void print_netlist_as_blif(const std::string& filename, const AtomNetlist& netlist) { FILE* f = std::fopen(filename.c_str(), "w"); print_netlist_as_blif(f, netlist); std::fclose(f); @@ -120,7 +121,7 @@ void print_netlist_as_blif(FILE* f, const AtomNetlist& netlist) { fprintf(f, "\n"); //Artificial buffers - for (auto buf_pair : artificial_buffer_connections_required) { + for (const auto& buf_pair : artificial_buffer_connections_required) { fprintf(f, "#Artificially inserted primary-output assigment buffer\n"); fprintf(f, ".names %s %s\n", buf_pair.first.c_str(), buf_pair.second.c_str()); fprintf(f, "1 1\n"); @@ -341,10 +342,10 @@ void print_netlist_as_blif(FILE* f, const AtomNetlist& netlist) { fprintf(f, "\n"); - for (auto param : netlist.block_params(blk_id)) { + for (const auto& param : netlist.block_params(blk_id)) { fprintf(f, ".param %s %s\n", param.first.c_str(), param.second.c_str()); } - for (auto attr : netlist.block_attrs(blk_id)) { + for (const auto& attr : netlist.block_attrs(blk_id)) { fprintf(f, ".attr %s %s\n", attr.first.c_str(), attr.second.c_str()); } @@ -645,7 +646,7 @@ std::vector find_combinationally_connected_input_ports(const AtomNet VTR_ASSERT(netlist.port_type(output_port) == PortType::OUTPUT); - std::string out_port_name = netlist.port_name(output_port); + const std::string& out_port_name = netlist.port_name(output_port); AtomBlockId blk = netlist.port_block(output_port); @@ -667,7 +668,7 @@ std::vector find_combinationally_connected_clock_ports(const AtomNet VTR_ASSERT(netlist.port_type(output_port) == PortType::OUTPUT); - std::string out_port_name = netlist.port_name(output_port); + const std::string& out_port_name = netlist.port_name(output_port); AtomBlockId blk = netlist.port_block(output_port); @@ -1266,7 +1267,7 @@ std::vector truth_table_to_lut_mask(const AtomNetlist::TruthTab std::vector cube_to_minterms(std::vector cube) { std::vector minterms; - cube_to_minterms_recurr(cube, minterms); + cube_to_minterms_recurr(std::move(cube), minterms); return minterms; } diff --git a/vpr/src/base/atom_netlist_utils.h b/vpr/src/base/atom_netlist_utils.h index 01c243a873a..7482ffa5b4c 100644 --- a/vpr/src/base/atom_netlist_utils.h +++ b/vpr/src/base/atom_netlist_utils.h @@ -83,7 +83,7 @@ std::vector cube_to_minterms(std::vector cube); /* * Print the netlist for debugging */ -void print_netlist_as_blif(std::string filename, const AtomNetlist& netlist); +void print_netlist_as_blif(const std::string& filename, const AtomNetlist& netlist); void print_netlist_as_blif(FILE* f, const AtomNetlist& netlist); //Returns a user-friendly architectural identifier for the specified atom pin diff --git a/vpr/src/base/clustered_netlist.cpp b/vpr/src/base/clustered_netlist.cpp index f0e031dd413..c243e6fbd72 100644 --- a/vpr/src/base/clustered_netlist.cpp +++ b/vpr/src/base/clustered_netlist.cpp @@ -1,5 +1,7 @@ #include "clustered_netlist.h" +#include + #include "vtr_assert.h" #include "vpr_error.h" @@ -11,7 +13,7 @@ * */ ClusteredNetlist::ClusteredNetlist(std::string name, std::string id) - : Netlist(name, id) {} + : Netlist(std::move(name), std::move(id)) {} /* * @@ -135,7 +137,7 @@ ClusterBlockId ClusteredNetlist::create_block(const char* name, t_pb* pb, t_logi return blk_id; } -ClusterPortId ClusteredNetlist::create_port(const ClusterBlockId blk_id, const std::string name, BitIndex width, PortType type) { +ClusterPortId ClusteredNetlist::create_port(const ClusterBlockId blk_id, const std::string& name, BitIndex width, PortType type) { ClusterPortId port_id = find_port(blk_id, name); if (!port_id) { port_id = Netlist::create_port(blk_id, name, width, type); @@ -166,7 +168,7 @@ ClusterPinId ClusteredNetlist::create_pin(const ClusterPortId port_id, BitIndex return pin_id; } -ClusterNetId ClusteredNetlist::create_net(const std::string name) { +ClusterNetId ClusteredNetlist::create_net(const std::string& name) { //Check if the net has already been created StringId name_id = create_string(name); ClusterNetId net_id = find_net(name_id); diff --git a/vpr/src/base/clustered_netlist.h b/vpr/src/base/clustered_netlist.h index 53039bfdb15..c7e79df35a8 100644 --- a/vpr/src/base/clustered_netlist.h +++ b/vpr/src/base/clustered_netlist.h @@ -179,7 +179,7 @@ class ClusteredNetlist : public Netlist #include "vpr_utils.h" DeviceGrid::DeviceGrid(std::string grid_name, vtr::Matrix grid) - : name_(grid_name) - , grid_(grid) { + : name_(std::move(grid_name)) + , grid_(std::move(grid)) { count_instances(); } DeviceGrid::DeviceGrid(std::string grid_name, vtr::Matrix grid, std::vector limiting_res) - : DeviceGrid(grid_name, grid) { - limiting_resources_ = limiting_res; + : DeviceGrid(std::move(grid_name), std::move(grid)) { + limiting_resources_ = std::move(limiting_res); } size_t DeviceGrid::num_instances(t_physical_tile_type_ptr type) const { diff --git a/vpr/src/base/echo_files.cpp b/vpr/src/base/echo_files.cpp index 6f8de45933b..c720b501621 100644 --- a/vpr/src/base/echo_files.cpp +++ b/vpr/src/base/echo_files.cpp @@ -145,7 +145,7 @@ char* getOutputFileName(enum e_output_files ename) { return outputFileNames[(int)ename]; } -void alloc_and_load_output_file_names(const std::string default_name) { +void alloc_and_load_output_file_names(const std::string& default_name) { char* name; if (outputFileNames == nullptr) { diff --git a/vpr/src/base/echo_files.h b/vpr/src/base/echo_files.h index 70df3a3d962..25097671280 100644 --- a/vpr/src/base/echo_files.h +++ b/vpr/src/base/echo_files.h @@ -79,7 +79,7 @@ void free_echo_file_info(); void setOutputFileName(enum e_output_files ename, const char* name, const char* default_name); char* getOutputFileName(enum e_output_files ename); -void alloc_and_load_output_file_names(const std::string default_name); +void alloc_and_load_output_file_names(const std::string& default_name); void free_output_file_names(); #endif diff --git a/vpr/src/base/logic_vec.h b/vpr/src/base/logic_vec.h index fe6224a6a22..97761d5913c 100644 --- a/vpr/src/base/logic_vec.h +++ b/vpr/src/base/logic_vec.h @@ -1,6 +1,7 @@ #ifndef LOGIC_VEC_H #define LOGIC_VEC_H +#include #include #include @@ -16,7 +17,7 @@ class LogicVec { vtr::LogicValue init_value) //Default value : values_(size_val, init_value) {} LogicVec(std::vector values) - : values_(values) {} + : values_(std::move(values)) {} //Array indexing operator const vtr::LogicValue& operator[](size_t i) const { return values_[i]; } diff --git a/vpr/src/base/netlist.h b/vpr/src/base/netlist.h index f7e99267c27..d8c53ec512a 100644 --- a/vpr/src/base/netlist.h +++ b/vpr/src/base/netlist.h @@ -760,14 +760,14 @@ class Netlist { protected: //Protected Mutators //Create or return an existing block in the netlist // name : The unique name of the block - BlockId create_block(const std::string name); + BlockId create_block(const std::string& name); //Create or return an existing port in the netlist // blk_id : The block the port is associated with // name : The name of the port (must match the name of a port in the block's model) // width : The width (number of bits) of the port // type : The type of the port (INPUT, OUTPUT, CLOCK) - PortId create_port(const BlockId blk_id, const std::string name, BitIndex width, PortType type); + PortId create_port(const BlockId blk_id, const std::string& name, BitIndex width, PortType type); //Create or return an existing pin in the netlist // port_id : The port this pin is associated with diff --git a/vpr/src/base/netlist.tpp b/vpr/src/base/netlist.tpp index eb816b4aaac..9ead8e1ea8e 100644 --- a/vpr/src/base/netlist.tpp +++ b/vpr/src/base/netlist.tpp @@ -1,5 +1,6 @@ #include #include +#include #include "vtr_assert.h" #include "vtr_log.h" @@ -37,8 +38,8 @@ NetId NetlistIdRemapper::new_net_id(NetId old_id) template Netlist::Netlist(std::string name, std::string id) - : netlist_name_(name) - , netlist_id_(id) {} + : netlist_name_(std::move(name)) + , netlist_id_(std::move(id)) {} template Netlist::~Netlist() = default; @@ -611,7 +612,7 @@ bool Netlist::verify_lookups() const { * */ template -BlockId Netlist::create_block(const std::string name) { +BlockId Netlist::create_block(const std::string& name) { //Must have a non-empty name VTR_ASSERT_MSG(!name.empty(), "Non-Empty block name"); @@ -654,7 +655,7 @@ BlockId Netlist::create_block(const std::string n } template -PortId Netlist::create_port(const BlockId blk_id, const std::string name, BitIndex width, PortType type) { +PortId Netlist::create_port(const BlockId blk_id, const std::string& name, BitIndex width, PortType type) { //Check pre-conditions VTR_ASSERT_MSG(valid_block_id(blk_id), "Valid block id"); @@ -1951,7 +1952,7 @@ typename Netlist::StringId Netlist #include #include +#include #include #include #include @@ -107,10 +108,10 @@ void print_blif_port(std::ostream& os, size_t& unconn_count, const std::string& void print_verilog_port(std::ostream& os, const std::string& port_name, const std::vector& nets, PortType type, int depth); std::string create_unconn_net(size_t& unconn_count); -std::string escape_verilog_identifier(const std::string id); -std::string escape_sdf_identifier(const std::string id); +std::string escape_verilog_identifier(const std::string& id); +std::string escape_sdf_identifier(const std::string& id); bool is_special_sdf_char(char c); -std::string join_identifier(std::string lhs, std::string rhs); +std::string join_identifier(const std::string& lhs, const std::string& rhs); // // @@ -127,12 +128,12 @@ class Arc { int snk_ipin, //Sink pin index float del, //Delay on this arc std::string cond = "") //Condition associated with the arc - : source_name_(src_port) + : source_name_(std::move(src_port)) , source_ipin_(src_ipin) - , sink_name_(snk_port) + , sink_name_(std::move(snk_port)) , sink_ipin_(snk_ipin) , delay_(del) - , condition_(cond) {} + , condition_(std::move(cond)) {} //Accessors std::string source_name() const { return source_name_; } @@ -191,10 +192,10 @@ class LutInst : public Instance { std::vector timing_arc_values) //The timing arcs of this instance : type_("LUT_K") , lut_size_(lut_size) - , lut_mask_(lut_mask) - , inst_name_(inst_name) - , port_conns_(port_conns) - , timing_arcs_(timing_arc_values) { + , lut_mask_(std::move(lut_mask)) + , inst_name_(std::move(inst_name)) + , port_conns_(std::move(port_conns)) + , timing_arcs_(std::move(timing_arc_values)) { } //Accessors @@ -417,8 +418,8 @@ class LatchInst : public Instance { double tcq = std::numeric_limits::quiet_NaN(), //Clock-to-Q delay double tsu = std::numeric_limits::quiet_NaN(), //Setup time double thld = std::numeric_limits::quiet_NaN()) //Hold time - : instance_name_(inst_name) - , port_connections_(port_conns) + : instance_name_(std::move(inst_name)) + , port_connections_(std::move(port_conns)) , type_(type) , initial_value_(init_value) , tcq_(tcq) @@ -548,15 +549,15 @@ class BlackBoxInst : public Instance { std::vector timing_arcs, //Combinational timing arcs std::map ports_tsu, //Port setup checks std::map ports_tcq) //Port clock-to-q delays - : type_name_(type_name) - , inst_name_(inst_name) - , params_(params) - , attrs_(attrs) - , input_port_conns_(input_port_conns) - , output_port_conns_(output_port_conns) - , timing_arcs_(timing_arcs) - , ports_tsu_(ports_tsu) - , ports_tcq_(ports_tcq) {} + : type_name_(std::move(type_name)) + , inst_name_(std::move(inst_name)) + , params_(std::move(params)) + , attrs_(std::move(attrs)) + , input_port_conns_(std::move(input_port_conns)) + , output_port_conns_(std::move(output_port_conns)) + , timing_arcs_(std::move(timing_arcs)) + , ports_tsu_(std::move(ports_tsu)) + , ports_tcq_(std::move(ports_tcq)) {} void print_blif(std::ostream& os, size_t& unconn_count, int depth = 0) override { os << indent(depth) << ".subckt " << type_name_ << " \\" @@ -676,7 +677,7 @@ class BlackBoxInst : public Instance { } //Clock-to-Q delays - for (auto kv : ports_tcq_) { + for (const auto& kv : ports_tcq_) { double clock_to_q_ps = get_delay_ps(kv.second); std::stringstream delay_triple; @@ -691,7 +692,7 @@ class BlackBoxInst : public Instance { if (!ports_tsu_.empty() || !ports_thld_.empty()) { //Setup checks os << indent(depth + 1) << "(TIMINGCHECK\n"; - for (auto kv : ports_tsu_) { + for (const auto& kv : ports_tsu_) { double setup_ps = get_delay_ps(kv.second); std::stringstream delay_triple; @@ -699,7 +700,7 @@ class BlackBoxInst : public Instance { os << indent(depth + 2) << "(SETUP " << escape_sdf_identifier(kv.first) << " (posedge clock) " << delay_triple.str() << ")\n"; } - for (auto kv : ports_thld_) { + for (const auto& kv : ports_thld_) { double hold_ps = get_delay_ps(kv.second); std::stringstream delay_triple; @@ -712,7 +713,7 @@ class BlackBoxInst : public Instance { os << indent(depth) << ")\n"; //CELL } - size_t find_port_size(std::string port_name) { + size_t find_port_size(const std::string& port_name) { auto iter = input_port_conns_.find(port_name); if (iter != input_port_conns_.end()) { return iter->second.size(); @@ -749,13 +750,13 @@ class Assignment { public: Assignment(std::string lval, //The left value (assigned to) std::string rval) //The right value (assigned from) - : lval_(lval) - , rval_(rval) {} + : lval_(std::move(lval)) + , rval_(std::move(rval)) {} - void print_verilog(std::ostream& os, std::string indent) { + void print_verilog(std::ostream& os, const std::string& indent) { os << indent << "assign " << escape_verilog_identifier(lval_) << " = " << escape_verilog_identifier(rval_) << ";\n"; } - void print_blif(std::ostream& os, std::string indent) { + void print_blif(std::ostream& os, const std::string& indent) { os << indent << ".names " << rval_ << " " << lval_ << "\n"; os << indent << "1 1\n"; } @@ -777,7 +778,7 @@ class NetlistWriterVisitor : public NetlistVisitor { : verilog_os_(verilog_os) , blif_os_(blif_os) , sdf_os_(sdf_os) - , delay_calc_(delay_calc) { + , delay_calc_(std::move(delay_calc)) { auto& atom_ctx = g_vpr_ctx.atom(); //Initialize the pin to tnode look-up @@ -1032,7 +1033,7 @@ class NetlistWriterVisitor : public NetlistVisitor { int port_idx, //The instance port index int pin_idx) { //The instance pin index - std::string wire_name = inst_name; + std::string wire_name = std::move(inst_name); if (port_type == PortType::INPUT) { wire_name = join_identifier(wire_name, "input"); } else if (port_type == PortType::CLOCK) { @@ -1669,11 +1670,11 @@ class NetlistWriterVisitor : public NetlistVisitor { auto& atom_ctx = g_vpr_ctx.atom(); AtomBlockId blk_id = atom_ctx.lookup.pb_atom(atom); - for (auto param : atom_ctx.nlist.block_params(blk_id)) { + for (const auto& param : atom_ctx.nlist.block_params(blk_id)) { params[param.first] = param.second; } - for (auto attr : atom_ctx.nlist.block_attrs(blk_id)) { + for (const auto& attr : atom_ctx.nlist.block_attrs(blk_id)) { attrs[attr.first] = attr.second; } @@ -1874,7 +1875,7 @@ class NetlistWriterVisitor : public NetlistVisitor { //Helper function for load_lut_mask() // //Converts the given names_row string to a LogicVec - LogicVec names_row_to_logic_vec(const std::string names_row, size_t num_inputs, bool encoding_on_set) { + LogicVec names_row_to_logic_vec(const std::string& names_row, size_t num_inputs, bool encoding_on_set) { //Get an iterator to the last character (i.e. the output value) auto output_val_iter = names_row.end() - 1; @@ -1938,9 +1939,9 @@ class NetlistWriterVisitor : public NetlistVisitor { //Returns the name of the routing segment between two wires std::string interconnect_name(std::string driver_wire, std::string sink_wire) { - std::string name = join_identifier("routing_segment", driver_wire); + std::string name = join_identifier("routing_segment", std::move(driver_wire)); name = join_identifier(name, "to"); - name = join_identifier(name, sink_wire); + name = join_identifier(name, std::move(sink_wire)); return name; } @@ -1989,7 +1990,7 @@ class NetlistWriterVisitor : public NetlistVisitor { // //Main routing for this file. See netlist_writer.h for details. -void netlist_writer(const std::string basename, std::shared_ptr delay_calc) { +void netlist_writer(const std::string& basename, std::shared_ptr delay_calc) { std::string verilog_filename = basename + "_post_synthesis.v"; std::string blif_filename = basename + "_post_synthesis.blif"; std::string sdf_filename = basename + "_post_synthesis.sdf"; @@ -2002,7 +2003,7 @@ void netlist_writer(const std::string basename, std::shared_ptr delay_calc); +void netlist_writer(const std::string& basename, std::shared_ptr delay_calc); #endif diff --git a/vpr/src/base/place_and_route.cpp b/vpr/src/base/place_and_route.cpp index 0f47ebebb37..9ce5d8ffd89 100644 --- a/vpr/src/base/place_and_route.cpp +++ b/vpr/src/base/place_and_route.cpp @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -54,8 +55,8 @@ int binary_search_place_and_route(const t_placer_opts& placer_opts_ref, t_det_routing_arch* det_routing_arch, std::vector& segment_inf, vtr::vector& net_delay, - std::shared_ptr timing_info, - std::shared_ptr delay_calc) { + const std::shared_ptr& timing_info, + const std::shared_ptr& delay_calc) { /* This routine performs a binary search to find the minimum number of * * tracks per channel required to successfully route a circuit, and returns * * that minimum width_fac. */ @@ -462,7 +463,7 @@ static float comp_width(t_chan* chan, float x, float separation) { case GAUSSIAN: val = (x - chan->xpeak) * (x - chan->xpeak) / (2 * chan->width * chan->width); - val = chan->peak * exp(-val); + val = chan->peak * std::exp(-val); val += chan->dc; break; diff --git a/vpr/src/base/place_and_route.h b/vpr/src/base/place_and_route.h index fe37dc0f3f3..3c215791ff8 100644 --- a/vpr/src/base/place_and_route.h +++ b/vpr/src/base/place_and_route.h @@ -32,8 +32,8 @@ int binary_search_place_and_route(const t_placer_opts& placer_opts_ref, t_det_routing_arch* det_routing_arch, std::vector& segment_inf, vtr::vector& net_delay, - std::shared_ptr timing_info, - std::shared_ptr delay_calc); + const std::shared_ptr& timing_info, + const std::shared_ptr& delay_calc); t_chan_width init_chan(int cfactor, t_chan_width_dist chan_width_dist); diff --git a/vpr/src/base/read_blif.cpp b/vpr/src/base/read_blif.cpp index 966794574a3..0a04e9cc0d4 100644 --- a/vpr/src/base/read_blif.cpp +++ b/vpr/src/base/read_blif.cpp @@ -44,7 +44,7 @@ vtr::LogicValue to_vtr_logic_value(blifparse::LogicValue); struct BlifAllocCallback : public blifparse::Callback { public: - BlifAllocCallback(e_circuit_format blif_format, AtomNetlist& main_netlist, const std::string netlist_id, const t_model* user_models, const t_model* library_models) + BlifAllocCallback(e_circuit_format blif_format, AtomNetlist& main_netlist, const std::string& netlist_id, const t_model* user_models, const t_model* library_models) : main_netlist_(main_netlist) , netlist_id_(netlist_id) , user_arch_models_(user_models) @@ -432,7 +432,7 @@ struct BlifAllocCallback : public blifparse::Callback { } private: - const t_model* find_model(std::string name) { + const t_model* find_model(const std::string& name) { const t_model* arch_model = nullptr; for (const t_model* arch_models : {user_arch_models_, library_arch_models_}) { arch_model = arch_models; @@ -455,7 +455,7 @@ struct BlifAllocCallback : public blifparse::Callback { return arch_model; } - const t_model_ports* find_model_port(const t_model* blk_model, std::string port_name) { + const t_model_ports* find_model_port(const t_model* blk_model, const std::string& port_name) { //We need to handle both single, and multi-bit port names // //By convention multi-bit port names have the bit index stored in square brackets @@ -570,7 +570,7 @@ struct BlifAllocCallback : public blifparse::Callback { } else { VTR_ASSERT(blif_model.block_type(blk_id) == AtomBlockType::OUTPAD); - auto raw_output_name = blif_model.block_name(blk_id); + const auto& raw_output_name = blif_model.block_name(blk_id); std::string output_name = vtr::replace_first(raw_output_name, OUTPAD_NAME_PREFIX, ""); diff --git a/vpr/src/base/read_circuit.cpp b/vpr/src/base/read_circuit.cpp index cee5fbe9e9a..e3d05ad3b03 100644 --- a/vpr/src/base/read_circuit.cpp +++ b/vpr/src/base/read_circuit.cpp @@ -177,22 +177,22 @@ static void show_circuit_stats(const AtomNetlist& netlist) { //Determine the maximum length of a type name for nice formatting size_t max_block_type_len = 0; - for (auto kv : block_type_counts) { + for (const auto& kv : block_type_counts) { max_block_type_len = std::max(max_block_type_len, kv.first.size()); } size_t max_net_type_len = 0; - for (auto kv : net_stats) { + for (const auto& kv : net_stats) { max_net_type_len = std::max(max_net_type_len, kv.first.size()); } //Print the statistics VTR_LOG("Circuit Statistics:\n"); VTR_LOG(" Blocks: %zu\n", netlist.blocks().size()); - for (auto kv : block_type_counts) { + for (const auto& kv : block_type_counts) { VTR_LOG(" %-*s: %7zu\n", max_block_type_len, kv.first.c_str(), kv.second); } VTR_LOG(" Nets : %zu\n", netlist.nets().size()); - for (auto kv : net_stats) { + for (const auto& kv : net_stats) { VTR_LOG(" %-*s: %7.1f\n", max_net_type_len, kv.first.c_str(), kv.second); } VTR_LOG(" Netlist Clocks: %zu\n", find_netlist_logical_clock_drivers(netlist).size()); diff --git a/vpr/src/base/read_netlist.cpp b/vpr/src/base/read_netlist.cpp index a44ad17e6b3..4d7598e84af 100644 --- a/vpr/src/base/read_netlist.cpp +++ b/vpr/src/base/read_netlist.cpp @@ -345,7 +345,7 @@ void processAttrsParams(pugi::xml_node Parent, const char* child_name, T& atom_n std::string cval = Cur.text().get(); bool found = false; // Look for corresponding key-value in range from AtomNetlist - for (auto bitem : atom_net_range) { + for (const auto& bitem : atom_net_range) { if (bitem.first == cname) { if (bitem.second != cval) { // Found in AtomNetlist range, but values don't match @@ -365,7 +365,7 @@ void processAttrsParams(pugi::xml_node Parent, const char* child_name, T& atom_n } } // Check for attrs/params in AtomNetlist but not in .net file - for (auto bitem : atom_net_range) { + for (const auto& bitem : atom_net_range) { if (kvs.find(bitem.first) == kvs.end()) vpr_throw(VPR_ERROR_NET_F, netlist_file_name, loc_data.line(Parent), ".net file and .blif file do not match, %s %s missing in .net file.\n", @@ -654,7 +654,7 @@ static int processPorts(pugi::xml_node Parent, t_pb* pb, t_pb_routes& pb_route, if (strcmp(pins[i].c_str(), "open") != 0) { //For connected pins look-up the inter-block net index associated with it - AtomNetId net_id = atom_ctx.nlist.find_net(pins[i].c_str()); + AtomNetId net_id = atom_ctx.nlist.find_net(pins[i]); if (!net_id) { VPR_FATAL_ERROR(VPR_ERROR_NET_F, ".blif and .net do not match, unknown net %s found in .net file.\n.", @@ -734,7 +734,7 @@ static int processPorts(pugi::xml_node Parent, t_pb* pb, t_pb_routes& pb_route, const t_pb_graph_pin* pb_gpin = &pb->pb_graph_node->output_pins[out_port][i]; int rr_node_index = pb_gpin->pin_count_in_cluster; if (strcmp(pins[i].c_str(), "open") != 0) { - AtomNetId net_id = atom_ctx.nlist.find_net(pins[i].c_str()); + AtomNetId net_id = atom_ctx.nlist.find_net(pins[i]); if (!net_id) { VPR_FATAL_ERROR(VPR_ERROR_NET_F, ".blif and .net do not match, unknown net %s found in .net file.\n", diff --git a/vpr/src/base/read_options.cpp b/vpr/src/base/read_options.cpp index 5f654445efd..b45bc66c193 100644 --- a/vpr/src/base/read_options.cpp +++ b/vpr/src/base/read_options.cpp @@ -1,4 +1,6 @@ #include "read_options.h" + +#include #include "constant_nets.h" #include "clock_modeling.h" #include "vpr_error.h" @@ -29,7 +31,7 @@ t_options read_options(int argc, const char** argv) { } struct ParseOnOff { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "on") conv_value.set_value(true); @@ -61,7 +63,7 @@ struct ParseOnOff { }; struct ParseCircuitFormat { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "auto") conv_value.set_value(e_circuit_format::AUTO); @@ -97,7 +99,7 @@ struct ParseCircuitFormat { } }; struct ParseRoutePredictor { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "safe") conv_value.set_value(SAFE); @@ -133,7 +135,7 @@ struct ParseRoutePredictor { }; struct ParseRouterAlgorithm { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "breadth_first") conv_value.set_value(BREADTH_FIRST); @@ -164,7 +166,7 @@ struct ParseRouterAlgorithm { }; struct RouteBudgetsAlgorithm { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "minimax") conv_value.set_value(MINIMAX); @@ -200,7 +202,7 @@ struct RouteBudgetsAlgorithm { }; struct ParseRouteType { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "global") conv_value.set_value(GLOBAL); @@ -231,7 +233,7 @@ struct ParseRouteType { }; struct ParseBaseCost { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "delay_normalized") conv_value.set_value(DELAY_NORMALIZED); @@ -278,7 +280,7 @@ struct ParseBaseCost { }; struct ParsePlaceAlgorithm { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "bounding_box") conv_value.set_value(BOUNDING_BOX_PLACE); @@ -309,7 +311,7 @@ struct ParsePlaceAlgorithm { }; struct ParseClusterSeed { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "timing") conv_value.set_value(e_cluster_seed::TIMING); @@ -356,7 +358,7 @@ struct ParseClusterSeed { }; struct ParseConstantNetMethod { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "global") conv_value.set_value(CONSTANT_NET_GLOBAL); @@ -387,7 +389,7 @@ struct ParseConstantNetMethod { }; struct ParseTimingReportDetail { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "netlist") conv_value.set_value(e_timing_report_detail::NETLIST); @@ -422,7 +424,7 @@ struct ParseTimingReportDetail { }; struct ParseClockModeling { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "ideal") conv_value.set_value(IDEAL_CLOCK); @@ -460,7 +462,7 @@ struct ParseClockModeling { }; struct ParseUnrelatedClustering { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "on") conv_value.set_value(e_unrelated_clustering::ON); @@ -498,7 +500,7 @@ struct ParseUnrelatedClustering { }; struct ParseBalanceBlockTypeUtil { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "on") conv_value.set_value(e_balance_block_type_util::ON); @@ -536,7 +538,7 @@ struct ParseBalanceBlockTypeUtil { }; struct ParseConstGenInference { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "none") conv_value.set_value(e_const_gen_inference::NONE); @@ -574,7 +576,7 @@ struct ParseConstGenInference { }; struct ParseIncrRerouteDelayRipup { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "on") conv_value.set_value(e_incr_reroute_delay_ripup::ON); @@ -612,7 +614,7 @@ struct ParseIncrRerouteDelayRipup { }; struct ParseRouteBBUpdate { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "static") conv_value.set_value(e_route_bb_update::STATIC); @@ -646,7 +648,7 @@ struct ParseRouteBBUpdate { }; struct ParseRouterLookahead { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "classic") conv_value.set_value(e_router_lookahead::CLASSIC); @@ -680,7 +682,7 @@ struct ParseRouterLookahead { }; struct ParsePlaceDelayModel { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "delta") conv_value.set_value(PlaceDelayModelType::DELTA); @@ -714,7 +716,7 @@ struct ParsePlaceDelayModel { }; struct ParseReducer { - ConvertedValue from_str(std::string str) { + ConvertedValue from_str(const std::string& str) { ConvertedValue conv_value; if (str == "min") conv_value.set_value(e_reducer::MIN); @@ -763,7 +765,7 @@ argparse::ArgumentParser create_arg_parser(std::string prog_name, t_options& arg "\n" "Attempts to find the minimum routable channel width, unless a fixed" " channel width is specified with --route_chan_width."; - auto parser = argparse::ArgumentParser(prog_name, description); + auto parser = argparse::ArgumentParser(std::move(prog_name), description); std::string epilog = vtr::replace_all( "Usage Examples\n" diff --git a/vpr/src/base/read_place.cpp b/vpr/src/base/read_place.cpp index 929192ec34c..83f68d1c48b 100644 --- a/vpr/src/base/read_place.cpp +++ b/vpr/src/base/read_place.cpp @@ -61,7 +61,7 @@ void read_place(const char* net_file, std::string place_netlist_id = tokens[3]; std::string place_netlist_file = tokens[1]; - if (place_netlist_id != cluster_ctx.clb_nlist.netlist_id().c_str()) { + if (place_netlist_id != cluster_ctx.clb_nlist.netlist_id()) { auto msg = vtr::string_fmt( "The packed netlist file that generated placement (File: '%s' ID: '%s')" " does not match current netlist (File: '%s' ID: '%s')", diff --git a/vpr/src/base/read_route.cpp b/vpr/src/base/read_route.cpp index 9ec4069fe2c..5393058399e 100644 --- a/vpr/src/base/read_route.cpp +++ b/vpr/src/base/read_route.cpp @@ -47,7 +47,7 @@ static void process_nodes(std::ifstream& fp, ClusterNetId inet, const char* file static void process_nets(std::ifstream& fp, ClusterNetId inet, std::string name, std::vector input_tokens, const char* filename, int& lineno); static void process_global_blocks(std::ifstream& fp, ClusterNetId inet, const char* filename, int& lineno); static void format_coordinates(int& x, int& y, std::string coord, ClusterNetId net, const char* filename, const int lineno); -static void format_pin_info(std::string& pb_name, std::string& port_name, int& pb_pin_num, std::string input); +static void format_pin_info(std::string& pb_name, std::string& port_name, int& pb_pin_num, const std::string& input); static std::string format_name(std::string name); /*************Global Functions****************************/ @@ -97,7 +97,7 @@ bool read_route(const char* route_file, const t_router_opts& router_opts, bool v ++lineno; header.clear(); header = vtr::split(header_str); - if (header[0] == "Array" && header[1] == "size:" && (vtr::atou(header[2].c_str()) != device_ctx.grid.width() || vtr::atou(header[4].c_str()) != device_ctx.grid.height())) { + if (header[0] == "Array" && header[1] == "size:" && (vtr::atou(header[2]) != device_ctx.grid.width() || vtr::atou(header[4]) != device_ctx.grid.height())) { vpr_throw(VPR_ERROR_ROUTE, route_file, lineno, "Device dimensions %sx%s specified in the routing file does not match given %dx%d ", header[2].c_str(), header[4].c_str(), device_ctx.grid.width(), device_ctx.grid.height()); @@ -405,7 +405,7 @@ static void format_coordinates(int& x, int& y, std::string coord, ClusterNetId n } } -static void format_pin_info(std::string& pb_name, std::string& port_name, int& pb_pin_num, std::string input) { +static void format_pin_info(std::string& pb_name, std::string& port_name, int& pb_pin_num, const std::string& input) { /*Parse the pin info in the form of pb_name.port_name[pb_pin_num] *into its appropriate variables*/ std::stringstream pb_info(input); diff --git a/vpr/src/base/setup_clocks.cpp b/vpr/src/base/setup_clocks.cpp index 80bbca3fd0d..1d264394e5d 100644 --- a/vpr/src/base/setup_clocks.cpp +++ b/vpr/src/base/setup_clocks.cpp @@ -13,9 +13,9 @@ #include static MetalLayer get_metal_layer_from_name( - std::string metal_layer_name, + const std::string& metal_layer_name, std::unordered_map clock_metal_layers, - std::string clock_network_name); + const std::string& clock_network_name); static void setup_clock_network_wires(const t_arch& Arch, std::vector& segment_inf); static void setup_clock_connections(const t_arch& Arch); @@ -41,7 +41,7 @@ void setup_clock_network_wires(const t_arch& Arch, std::vector& s vars.set_var_value("W", grid.width()); vars.set_var_value("H", grid.height()); - for (auto clock_network_arch : clock_networks_arch) { + for (const auto& clock_network_arch : clock_networks_arch) { switch (clock_network_arch.type) { case e_clock_type::SPINE: { std::unique_ptr spine = std::make_unique(); @@ -126,7 +126,7 @@ void setup_clock_connections(const t_arch& Arch) { vars.set_var_value("W", grid.width()); vars.set_var_value("H", grid.height()); - for (auto clock_connection_arch : clock_connections_arch) { + for (const auto& clock_connection_arch : clock_connections_arch) { if (clock_connection_arch.from == "ROUTING") { clock_connections_device.emplace_back(new RoutingToClockConnection); if (RoutingToClockConnection* routing_to_clock = dynamic_cast(clock_connections_device.back().get())) { @@ -178,9 +178,9 @@ void setup_clock_connections(const t_arch& Arch) { } MetalLayer get_metal_layer_from_name( - std::string metal_layer_name, + const std::string& metal_layer_name, std::unordered_map clock_metal_layers, - std::string clock_network_name) { + const std::string& clock_network_name) { auto itter = clock_metal_layers.find(metal_layer_name); if (itter == clock_metal_layers.end()) { diff --git a/vpr/src/base/vpr_api.cpp b/vpr/src/base/vpr_api.cpp index f2900d0d299..b5a3946d761 100644 --- a/vpr/src/base/vpr_api.cpp +++ b/vpr/src/base/vpr_api.cpp @@ -13,6 +13,7 @@ #include #include #include +#include #include "vtr_assert.h" #include "vtr_math.h" @@ -231,7 +232,7 @@ void vpr_init_with_options(const t_options* options, t_vpr_setup* vpr_setup, t_a * Initialize the functions names for which VPR_ERRORs * are demoted to VTR_LOG_WARNs */ - for (std::string func_name : vtr::split(options->disable_errors, std::string(":"))) { + for (const std::string& func_name : vtr::split(options->disable_errors, std::string(":"))) { map_error_activation_status(func_name); } @@ -252,7 +253,7 @@ void vpr_init_with_options(const t_options* options, t_vpr_setup* vpr_setup, t_a } set_noisy_warn_log_file(warn_log_file); - for (std::string func_name : vtr::split(warn_functions, std::string(":"))) { + for (const std::string& func_name : vtr::split(warn_functions, std::string(":"))) { add_warnings_to_suppress(func_name); } @@ -753,8 +754,8 @@ RouteStatus vpr_route_fixed_W(t_vpr_setup& vpr_setup, &vpr_setup.RoutingArch, vpr_setup.Segments, net_delay, - timing_info, - delay_calc, + std::move(timing_info), + std::move(delay_calc), arch.Chans, arch.Directs, arch.num_directs, ScreenUpdatePriority::MAJOR); @@ -784,8 +785,8 @@ RouteStatus vpr_route_min_W(t_vpr_setup& vpr_setup, &vpr_setup.RoutingArch, vpr_setup.Segments, net_delay, - timing_info, - delay_calc); + std::move(timing_info), + std::move(delay_calc)); bool status = (min_W > 0); return RouteStatus(status, min_W); @@ -794,7 +795,7 @@ RouteStatus vpr_route_min_W(t_vpr_setup& vpr_setup, RouteStatus vpr_load_routing(t_vpr_setup& vpr_setup, const t_arch& /*arch*/, int fixed_channel_width, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, vtr::vector& net_delay) { vtr::ScopedStartFinishTimer timer("Load Routing"); if (NO_FIXED_CHANNEL_WIDTH == fixed_channel_width) { @@ -1189,7 +1190,7 @@ void vpr_analysis(t_vpr_setup& vpr_setup, const t_arch& Arch, const RouteStatus& //Write the post-syntesis netlist if (vpr_setup.AnalysisOpts.gen_post_synthesis_netlist) { - netlist_writer(atom_ctx.nlist.netlist_name().c_str(), analysis_delay_calc); + netlist_writer(atom_ctx.nlist.netlist_name(), analysis_delay_calc); } //Do power analysis diff --git a/vpr/src/base/vpr_api.h b/vpr/src/base/vpr_api.h index fbbfb890bc0..47cd5d49fe6 100644 --- a/vpr/src/base/vpr_api.h +++ b/vpr/src/base/vpr_api.h @@ -75,7 +75,7 @@ RouteStatus vpr_route_min_W(t_vpr_setup& vpr_setup, RouteStatus vpr_load_routing(t_vpr_setup& vpr_setup, const t_arch& arch, int fixed_channel_width, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, vtr::vector& net_delay); //Loads a previous routing bool vpr_analysis_flow(t_vpr_setup& vpr_setup, const t_arch& Arch, const RouteStatus& route_status); //Perform or skips the analysis stage diff --git a/vpr/src/base/vpr_types.cpp b/vpr/src/base/vpr_types.cpp index 6ddc97c489c..4d3dae0883b 100644 --- a/vpr/src/base/vpr_types.cpp +++ b/vpr/src/base/vpr_types.cpp @@ -6,7 +6,7 @@ t_ext_pin_util_targets::t_ext_pin_util_targets(float default_in_util, float defa defaults_.output_pin_util = default_out_util; } -t_ext_pin_util t_ext_pin_util_targets::get_pin_util(std::string block_type_name) const { +t_ext_pin_util t_ext_pin_util_targets::get_pin_util(const std::string& block_type_name) const { auto itr = overrides_.find(block_type_name); if (itr != overrides_.end()) { return itr->second; @@ -14,7 +14,7 @@ t_ext_pin_util t_ext_pin_util_targets::get_pin_util(std::string block_type_name) return defaults_; } -void t_ext_pin_util_targets::set_block_pin_util(std::string block_type_name, t_ext_pin_util target) { +void t_ext_pin_util_targets::set_block_pin_util(const std::string& block_type_name, t_ext_pin_util target) { overrides_[block_type_name] = target; } @@ -29,11 +29,11 @@ void t_pack_high_fanout_thresholds::set_default(int threshold) { default_ = threshold; } -void t_pack_high_fanout_thresholds::set(std::string block_type_name, int threshold) { +void t_pack_high_fanout_thresholds::set(const std::string& block_type_name, int threshold) { overrides_[block_type_name] = threshold; } -int t_pack_high_fanout_thresholds::get_threshold(std::string block_type_name) const { +int t_pack_high_fanout_thresholds::get_threshold(const std::string& block_type_name) const { auto itr = overrides_.find(block_type_name); if (itr != overrides_.end()) { return itr->second; diff --git a/vpr/src/base/vpr_types.h b/vpr/src/base/vpr_types.h index e6c010f7398..bd337986d32 100644 --- a/vpr/src/base/vpr_types.h +++ b/vpr/src/base/vpr_types.h @@ -165,12 +165,12 @@ class t_ext_pin_util_targets { t_ext_pin_util_targets(float default_in_util, float default_out_util); //Returns the input pin util of the specified block (or default if unspecified) - t_ext_pin_util get_pin_util(std::string block_type_name) const; + t_ext_pin_util get_pin_util(const std::string& block_type_name) const; public: //Sets the pin util for the specified block type //Returns true if non-default was previously set - void set_block_pin_util(std::string block_type_name, t_ext_pin_util target); + void set_block_pin_util(const std::string& block_type_name, t_ext_pin_util target); //Sets the default pin util //Returns true if a default was previously set @@ -186,12 +186,12 @@ class t_pack_high_fanout_thresholds { t_pack_high_fanout_thresholds() = default; t_pack_high_fanout_thresholds(int threshold); - int get_threshold(std::string block_type_name) const; + int get_threshold(const std::string& block_type_name) const; public: //Sets the pin util for the specified block type //Returns true if non-default was previously set - void set(std::string block_type_name, int threshold); + void set(const std::string& block_type_name, int threshold); //Sets the default pin util //Returns true if a default was previously set diff --git a/vpr/src/draw/draw.cpp b/vpr/src/draw/draw.cpp index 505928cf667..8b6592147fe 100644 --- a/vpr/src/draw/draw.cpp +++ b/vpr/src/draw/draw.cpp @@ -396,7 +396,7 @@ void initial_setup_NO_PICTURE_to_ROUTING_with_crit_path(ezgl::application* app, } #endif //NO_GRAPHICS -void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type pic_on_screen_val, std::shared_ptr setup_timing_info) { +void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type pic_on_screen_val, const std::shared_ptr& setup_timing_info) { #ifndef NO_GRAPHICS /* Updates the screen if the user has requested graphics. The priority * diff --git a/vpr/src/draw/draw.h b/vpr/src/draw/draw.h index acc9d214572..2f1c4ec8c90 100644 --- a/vpr/src/draw/draw.h +++ b/vpr/src/draw/draw.h @@ -19,7 +19,7 @@ extern ezgl::application application; #endif /* NO_GRAPHICS */ -void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type pic_on_screen_val, std::shared_ptr timing_info); +void update_screen(ScreenUpdatePriority priority, const char* msg, enum pic_type pic_on_screen_val, const std::shared_ptr& timing_info); //Initializes the drawing locations. //FIXME: Currently broken if no rr-graph is loaded void init_draw_coords(float clb_width); diff --git a/vpr/src/pack/cluster.cpp b/vpr/src/pack/cluster.cpp index fa9d4d8f832..432847f4bb3 100644 --- a/vpr/src/pack/cluster.cpp +++ b/vpr/src/pack/cluster.cpp @@ -40,6 +40,7 @@ #include #include #include +#include #include "vtr_assert.h" #include "vtr_log.h" @@ -320,7 +321,7 @@ static std::vector initialize_seed_atoms(const e_cluster_seed seed_ const t_molecule_stats& max_molecule_stats, const vtr::vector& atom_criticality); -static t_pack_molecule* get_highest_gain_seed_molecule(int* seedindex, const std::multimap& atom_molecules, const std::vector seed_atoms); +static t_pack_molecule* get_highest_gain_seed_molecule(int* seedindex, const std::multimap& atom_molecules, const std::vector& seed_atoms); static float get_molecule_gain(t_pack_molecule* molecule, std::map& blk_gain); static int compare_molecule_gain(const void* a, const void* b); @@ -354,7 +355,7 @@ static t_logical_block_type_ptr identify_logic_block_type(std::map& le_count, const t_pb_type* le_pb_type); @@ -2072,7 +2073,7 @@ static void start_new_cluster(t_cluster_placement_stats* cluster_placement_stats } if (num_used_type_instances[block_type] > num_instances) { - device_ctx.grid = create_device_grid(device_layout_name, arch->grid_layouts, num_used_type_instances, target_device_utilization); + device_ctx.grid = create_device_grid(std::move(device_layout_name), arch->grid_layouts, num_used_type_instances, target_device_utilization); VTR_LOGV(verbosity > 0, "Not enough resources expand FPGA size to (%d x %d)\n", device_ctx.grid.width(), device_ctx.grid.height()); } @@ -2704,7 +2705,7 @@ static std::vector initialize_seed_atoms(const e_cluster_seed seed_ return seed_atoms; } -static t_pack_molecule* get_highest_gain_seed_molecule(int* seedindex, const std::multimap& atom_molecules, const std::vector seed_atoms) { +static t_pack_molecule* get_highest_gain_seed_molecule(int* seedindex, const std::multimap& atom_molecules, const std::vector& seed_atoms) { auto& atom_ctx = g_vpr_ctx.atom(); while (*seedindex < static_cast(seed_atoms.size())) { @@ -3482,7 +3483,7 @@ static void update_le_count(const t_pb* pb, const t_logical_block_type_ptr logic * This function returns true if the given physical block has * a primitive matching the given blif model and is used */ -static bool pb_used_for_blif_model(const t_pb* pb, std::string blif_model_name) { +static bool pb_used_for_blif_model(const t_pb* pb, const std::string& blif_model_name) { auto pb_graph_node = pb->pb_graph_node; auto pb_type = pb_graph_node->pb_type; auto mode = &pb_type->modes[pb->mode]; diff --git a/vpr/src/pack/pack.cpp b/vpr/src/pack/pack.cpp index 612d0df24d9..b151725f026 100644 --- a/vpr/src/pack/pack.cpp +++ b/vpr/src/pack/pack.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "vtr_assert.h" #include "vtr_log.h" @@ -266,7 +267,7 @@ static bool try_size_device_grid(const t_arch& arch, const std::map seen_block_types; - for (auto spec : specs) { + for (const auto& spec : specs) { t_ext_pin_util target_ext_pin_util(1., 1.); auto block_values = vtr::split(spec, ":"); @@ -469,7 +470,7 @@ static t_pack_high_fanout_thresholds parse_high_fanout_thresholds(std::vector seen_block_types; - for (auto spec : specs) { + for (const auto& spec : specs) { auto block_values = vtr::split(spec, ":"); std::string block_type; std::string value; diff --git a/vpr/src/pack/pack_report.cpp b/vpr/src/pack/pack_report.cpp index c571a2737d9..487767447b1 100644 --- a/vpr/src/pack/pack_report.cpp +++ b/vpr/src/pack/pack_report.cpp @@ -66,7 +66,7 @@ void report_packing_pin_usage(std::ostream& os, const VprContext& ctx) { if (total_input_pins[type] != 0) { os << "\t\tHistogram:\n"; auto input_histogram = build_histogram(inputs_used[type], 10, 0, total_input_pins[type]); - for (auto line : format_histogram(input_histogram)) { + for (const auto& line : format_histogram(input_histogram)) { os << "\t\t" << line << "\n"; } } @@ -83,7 +83,7 @@ void report_packing_pin_usage(std::ostream& os, const VprContext& ctx) { os << "\t\tHistogram:\n"; auto output_histogram = build_histogram(outputs_used[type], 10, 0, total_output_pins[type]); - for (auto line : format_histogram(output_histogram)) { + for (const auto& line : format_histogram(output_histogram)) { os << "\t\t" << line << "\n"; } } diff --git a/vpr/src/pack/prepack.cpp b/vpr/src/pack/prepack.cpp index 28e8c2bc506..dd02fe80e47 100644 --- a/vpr/src/pack/prepack.cpp +++ b/vpr/src/pack/prepack.cpp @@ -40,7 +40,7 @@ static void forward_infer_pattern(t_pb_graph_pin* pb_graph_pin); static void backward_infer_pattern(t_pb_graph_pin* pb_graph_pin); -static t_pack_patterns* alloc_and_init_pattern_list_from_hash(std::unordered_map pattern_names); +static t_pack_patterns* alloc_and_init_pattern_list_from_hash(const std::unordered_map& pattern_names); static t_pb_graph_edge* find_expansion_edge_of_pattern(const int pattern_index, const t_pb_graph_node* pb_graph_node); @@ -332,7 +332,7 @@ static void backward_infer_pattern(t_pb_graph_pin* pb_graph_pin) { * Allocates memory for models and loads the name of the packing pattern * so that it can be identified and loaded with more complete information later */ -static t_pack_patterns* alloc_and_init_pattern_list_from_hash(std::unordered_map pattern_names) { +static t_pack_patterns* alloc_and_init_pattern_list_from_hash(const std::unordered_map& pattern_names) { t_pack_patterns* nlist = new t_pack_patterns[pattern_names.size()]; for (const auto& curr_pattern : pattern_names) { diff --git a/vpr/src/place/initial_placement.cpp b/vpr/src/place/initial_placement.cpp index 6631e3f70e8..35838794d3a 100644 --- a/vpr/src/place/initial_placement.cpp +++ b/vpr/src/place/initial_placement.cpp @@ -174,7 +174,7 @@ static void initial_placement_pl_macros(int macros_max_num_tries, int* free_loca // Sorting blocks to place to have most constricted ones to be placed first std::vector sorted_pl_macros(pl_macros.begin(), pl_macros.end()); - auto criteria = [&cluster_ctx](const t_pl_macro lhs, t_pl_macro rhs) { + auto criteria = [&cluster_ctx](const t_pl_macro& lhs, t_pl_macro rhs) { auto lhs_logical_block = cluster_ctx.clb_nlist.block_type(lhs.members[0].blk_index); auto rhs_logical_block = cluster_ctx.clb_nlist.block_type(rhs.members[0].blk_index); diff --git a/vpr/src/place/move_utils.cpp b/vpr/src/place/move_utils.cpp index b2ea57bf1c5..8ead7f98cda 100644 --- a/vpr/src/place/move_utils.cpp +++ b/vpr/src/place/move_utils.cpp @@ -8,14 +8,14 @@ //Records counts of reasons for aborted moves static std::map f_move_abort_reasons; -void log_move_abort(std::string reason) { +void log_move_abort(const std::string& reason) { ++f_move_abort_reasons[reason]; } void report_aborted_moves() { VTR_LOG("\n"); VTR_LOG("Aborted Move Reasons:\n"); - for (auto kv : f_move_abort_reasons) { + for (const auto& kv : f_move_abort_reasons) { VTR_LOG(" %s: %zu\n", kv.first.c_str(), kv.second); } } diff --git a/vpr/src/place/move_utils.h b/vpr/src/place/move_utils.h index 7f6b438509b..c54dc6ee035 100644 --- a/vpr/src/place/move_utils.h +++ b/vpr/src/place/move_utils.h @@ -19,7 +19,7 @@ enum class e_create_move { }; //Records a reasons for an aborted move -void log_move_abort(std::string reason); +void log_move_abort(const std::string& reason); //Prints a breif report about aborted move reasons and counts void report_aborted_moves(); diff --git a/vpr/src/place/place_macro.cpp b/vpr/src/place/place_macro.cpp index 5411e3223f8..75e5d6eac4f 100644 --- a/vpr/src/place/place_macro.cpp +++ b/vpr/src/place/place_macro.cpp @@ -45,7 +45,7 @@ static void find_all_the_macro(int* num_of_macro, std::vector& p static void alloc_and_load_imacro_from_iblk(const std::vector& macros); -static void write_place_macros(std::string filename, const std::vector& macros); +static void write_place_macros(const std::string& filename, const std::vector& macros); static bool is_constant_clb_net(ClusterNetId clb_net); @@ -432,7 +432,7 @@ void free_placement_macros_structs() { } } -static void write_place_macros(std::string filename, const std::vector& macros) { +static void write_place_macros(const std::string& filename, const std::vector& macros) { FILE* f = vtr::fopen(filename.c_str(), "w"); auto& cluster_ctx = g_vpr_ctx.clustering(); diff --git a/vpr/src/place/timing_place.cpp b/vpr/src/place/timing_place.cpp index ab97a77d30b..02197af6901 100644 --- a/vpr/src/place/timing_place.cpp +++ b/vpr/src/place/timing_place.cpp @@ -1,3 +1,4 @@ +#include #include #include @@ -63,7 +64,7 @@ void load_criticalities(SetupTimingInfo& timing_info, float crit_exponent, const /* The placer likes a great deal of contrast between criticalities. * Since path criticality varies much more than timing, we "sharpen" timing * criticality by taking it to some power, crit_exponent (between 1 and 8 by default). */ - f_timing_place_crit[net_id][ipin] = pow(clb_pin_crit, crit_exponent); + f_timing_place_crit[net_id][ipin] = std::pow(clb_pin_crit, crit_exponent); } } } diff --git a/vpr/src/place/timing_place_lookup.cpp b/vpr/src/place/timing_place_lookup.cpp index 4aa439aab16..105d7f0fd65 100644 --- a/vpr/src/place/timing_place_lookup.cpp +++ b/vpr/src/place/timing_place_lookup.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "vtr_assert.h" #include "vtr_ndmatrix.h" @@ -51,7 +52,7 @@ constexpr float IMPOSSIBLE_DELTA = std::numeric_limits::infinity(); //Ind struct t_profile_loc { t_profile_loc(int x, int y, std::vector> delta_values) : root(x, y) - , deltas(delta_values) {} + , deltas(std::move(delta_values)) {} vtr::Point root; std::vector> deltas; diff --git a/vpr/src/power/PowerSpicedComponent.cpp b/vpr/src/power/PowerSpicedComponent.cpp index 621fece123f..f4a4ba670e7 100644 --- a/vpr/src/power/PowerSpicedComponent.cpp +++ b/vpr/src/power/PowerSpicedComponent.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include "vtr_assert.h" @@ -84,7 +85,7 @@ PowerCallibSize* PowerCallibInputs::get_entry_bound(bool lower, PowerSpicedComponent::PowerSpicedComponent(std::string component_name, float (*usage_fn)(int num_inputs, float transistor_size)) { - name = component_name; + name = std::move(component_name); component_usage = usage_fn; /* Always pad with a high and low entry */ diff --git a/vpr/src/power/power_sizing.cpp b/vpr/src/power/power_sizing.cpp index 01c54253f4e..ae323f55a5c 100644 --- a/vpr/src/power/power_sizing.cpp +++ b/vpr/src/power/power_sizing.cpp @@ -21,6 +21,7 @@ */ /************************* INCLUDES *********************************/ +#include #include #include @@ -144,7 +145,7 @@ static double power_count_transistors_mux(t_mux_arch* mux_arch) { for (lvl_idx = 0; lvl_idx < mux_arch->levels; lvl_idx++) { /* Assume there is decoder logic */ - transistor_cnt += ceil(log(max_inputs[lvl_idx]) / log((double)2.0)) + transistor_cnt += ceil(std::log(max_inputs[lvl_idx]) / log((double)2.0)) * power_count_transistor_SRAM_bit(); /* @@ -249,7 +250,7 @@ void power_sizing_init(const t_arch* arch) { auto& power_ctx = g_vpr_ctx.power(); // tech size = 2 lambda, so lambda^2/4.0 = tech^2 - f_MTA_area = ((POWER_MTA_L * POWER_MTA_W) / 4.0) * pow(power_ctx.tech->tech_size, (float)2.0); + f_MTA_area = ((POWER_MTA_L * POWER_MTA_W) / 4.0) * std::pow(power_ctx.tech->tech_size, (float)2.0); // Determines physical size of different PBs power_size_pb(); diff --git a/vpr/src/power/power_util.cpp b/vpr/src/power/power_util.cpp index 7ebc9772a16..01b3e2c52c6 100644 --- a/vpr/src/power/power_util.cpp +++ b/vpr/src/power/power_util.cpp @@ -20,6 +20,7 @@ */ /************************* INCLUDES *********************************/ +#include #include #include #include @@ -188,7 +189,7 @@ int power_calc_buffer_num_stages(float final_stage_size, } else if (final_stage_size < desired_stage_effort) N = 2; else { - N = (int)(log(final_stage_size) / log(desired_stage_effort) + 1); + N = (int)(std::log(final_stage_size) / std::log(desired_stage_effort) + 1); /* We always round down. * Perhaps N+1 would be closer to the desired stage effort, but the delay savings diff --git a/vpr/src/route/build_switchblocks.cpp b/vpr/src/route/build_switchblocks.cpp index 5a25248e31c..6b2cb106e8a 100644 --- a/vpr/src/route/build_switchblocks.cpp +++ b/vpr/src/route/build_switchblocks.cpp @@ -129,6 +129,7 @@ #include #include #include +#include #include "vtr_assert.h" #include "vtr_memory.h" @@ -877,7 +878,7 @@ static int evaluate_num_conns_formula(std::string num_conns_formula, int from_wi vars.set_var_value("from", from_wire_count); vars.set_var_value("to", to_wire_count); - return parse_formula(num_conns_formula, vars); + return parse_formula(std::move(num_conns_formula), vars); } /* Here we find the correct channel (x or y), and the coordinates to index into it based on the diff --git a/vpr/src/route/cb_metrics.cpp b/vpr/src/route/cb_metrics.cpp index a4152b46340..0449fed04a6 100644 --- a/vpr/src/route/cb_metrics.cpp +++ b/vpr/src/route/cb_metrics.cpp @@ -1202,6 +1202,7 @@ static void normalize_xbar(const float fraction_wires_used, t_xbar_matrix* xbar) /* the config vector represents some distribution of signals over available wires. i.e. x wires of type 0 get used, y wires of type 1, etc * this vector is created here, but is updated inside the count_switch_configurations function */ std::vector config; + config.reserve((int)count_map.size()); for (int i = 0; i < (int)count_map.size(); i++) { config.push_back(0); } diff --git a/vpr/src/route/clock_connection_builders.cpp b/vpr/src/route/clock_connection_builders.cpp index e8fca69771b..afdcc5cf87f 100644 --- a/vpr/src/route/clock_connection_builders.cpp +++ b/vpr/src/route/clock_connection_builders.cpp @@ -8,6 +8,7 @@ #include "vtr_error.h" #include +#include #include /* @@ -15,11 +16,11 @@ */ void RoutingToClockConnection::set_clock_name_to_connect_to(std::string clock_name) { - clock_to_connect_to = clock_name; + clock_to_connect_to = std::move(clock_name); } void RoutingToClockConnection::set_clock_switch_point_name(std::string clock_switch_point_name) { - switch_point_name = clock_switch_point_name; + switch_point_name = std::move(clock_switch_point_name); } void RoutingToClockConnection::set_switch_location(int x, int y) { @@ -107,19 +108,19 @@ int RoutingToClockConnection::create_virtual_clock_network_sink_node( */ void ClockToClockConneciton::set_from_clock_name(std::string clock_name) { - from_clock = clock_name; + from_clock = std::move(clock_name); } void ClockToClockConneciton::set_from_clock_switch_point_name(std::string switch_point_name) { - from_switch = switch_point_name; + from_switch = std::move(switch_point_name); } void ClockToClockConneciton::set_to_clock_name(std::string clock_name) { - to_clock = clock_name; + to_clock = std::move(clock_name); } void ClockToClockConneciton::set_to_clock_switch_point_name(std::string switch_point_name) { - to_switch = switch_point_name; + to_switch = std::move(switch_point_name); } void ClockToClockConneciton::set_switch(int rr_switch_index) { @@ -191,12 +192,12 @@ void ClockToClockConneciton::create_switches(const ClockRRGraphBuilder& clock_gr */ void ClockToPinsConnection::set_clock_name_to_connect_from(std::string clock_name) { - clock_to_connect_from = clock_name; + clock_to_connect_from = std::move(clock_name); } void ClockToPinsConnection::set_clock_switch_point_name( std::string connection_switch_point_name) { - switch_point_name = connection_switch_point_name; + switch_point_name = std::move(connection_switch_point_name); } void ClockToPinsConnection::set_switch(int rr_switch_index) { diff --git a/vpr/src/route/clock_network_builders.cpp b/vpr/src/route/clock_network_builders.cpp index ea367bdbb6b..a64bad49b34 100644 --- a/vpr/src/route/clock_network_builders.cpp +++ b/vpr/src/route/clock_network_builders.cpp @@ -1,5 +1,7 @@ #include "clock_network_builders.h" +#include + #include "globals.h" #include "vtr_assert.h" @@ -17,7 +19,7 @@ void populate_segment_values(int seg_index, int length, MetalLayer layer, std::vector& segment_inf) { - segment_inf[seg_index].name = name; + segment_inf[seg_index].name = std::move(name); segment_inf[seg_index].length = length; segment_inf[seg_index].frequency = 1; segment_inf[seg_index].Rmetal = layer.r_metal; @@ -49,7 +51,7 @@ std::string ClockNetwork::get_name() const { */ void ClockNetwork::set_clock_name(std::string clock_name) { - clock_name_ = clock_name; + clock_name_ = std::move(clock_name); } void ClockNetwork::set_num_instance(int num_inst) { @@ -121,7 +123,7 @@ void ClockRib::set_drive_switch(int switch_idx) { } void ClockRib::set_drive_name(std::string name) { - drive.name = name; + drive.name = std::move(name); } void ClockRib::set_tap_locations(int offset_x, int increment_x) { @@ -130,7 +132,7 @@ void ClockRib::set_tap_locations(int offset_x, int increment_x) { } void ClockRib::set_tap_name(std::string name) { - tap.name = name; + tap.name = std::move(name); } /* @@ -367,7 +369,7 @@ void ClockSpine::set_drive_switch(int switch_idx) { } void ClockSpine::set_drive_name(std::string name) { - drive.name = name; + drive.name = std::move(name); } void ClockSpine::set_tap_locations(int offset_y, int increment_y) { @@ -376,7 +378,7 @@ void ClockSpine::set_tap_locations(int offset_y, int increment_y) { } void ClockSpine::set_tap_name(std::string name) { - tap.name = name; + tap.name = std::move(name); } /* diff --git a/vpr/src/route/clock_network_builders.h b/vpr/src/route/clock_network_builders.h index c4db346ae00..0f61b42ce7b 100644 --- a/vpr/src/route/clock_network_builders.h +++ b/vpr/src/route/clock_network_builders.h @@ -2,6 +2,7 @@ #define CLOCK_NETWORK_BUILDERS_H #include +#include #include #include "clock_fwd.h" @@ -129,8 +130,8 @@ class ClockRib : public ClockNetwork { ClockRib(Wire wire1, WireRepeat repeat1, RibDrive drive1, RibTaps tap1) : x_chan_wire(wire1) , repeat(repeat1) - , drive(drive1) - , tap(tap1) {} + , drive(std::move(drive1)) + , tap(std::move(tap1)) {} /* * Getters */ diff --git a/vpr/src/route/connection_based_routing.h b/vpr/src/route/connection_based_routing.h index 0a4049e8c93..b00af6094c5 100644 --- a/vpr/src/route/connection_based_routing.h +++ b/vpr/src/route/connection_based_routing.h @@ -121,7 +121,7 @@ class Connection_based_routing_resources { // check each connection of each net to see if any satisfy the criteria described above (for the forcible_reroute_connection_flag data structure) // and if so, mark them to be rerouted bool forcibly_reroute_connections(float max_criticality, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, vtr::vector& net_delay); }; diff --git a/vpr/src/route/route_budgets.cpp b/vpr/src/route/route_budgets.cpp index d09656c0244..e69af4a4b78 100644 --- a/vpr/src/route/route_budgets.cpp +++ b/vpr/src/route/route_budgets.cpp @@ -20,6 +20,7 @@ #include #include "vpr_context.h" #include +#include #include "vpr_error.h" #include "globals.h" #include "tatum/util/tatum_assert.hpp" @@ -128,7 +129,7 @@ void route_budgets::load_route_budgets(vtr::vector& net_de allocate_slack_using_weights(net_delay, netlist_pin_lookup); calculate_delay_targets(); } else if (router_opts.routing_budgets_algorithm == SCALE_DELAY) { - allocate_slack_using_delays_and_criticalities(net_delay, timing_info, netlist_pin_lookup, router_opts); + allocate_slack_using_delays_and_criticalities(net_delay, std::move(timing_info), netlist_pin_lookup, router_opts); } set = true; } @@ -293,7 +294,7 @@ void route_budgets::set_min_max_budgets_equal() { } } -float route_budgets::minimax_PERT(std::shared_ptr timing_info, vtr::vector& temp_budgets, vtr::vector& net_delay, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, analysis_type analysis_type, bool keep_in_bounds, slack_allocated_type slack_type) { +float route_budgets::minimax_PERT(const std::shared_ptr& timing_info, vtr::vector& temp_budgets, vtr::vector& net_delay, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, analysis_type analysis_type, bool keep_in_bounds, slack_allocated_type slack_type) { /*This function uses weights to calculate how much slack to allocate to a connection. * The weights are deteremined by how much delay of the whole path is present in this connection*/ @@ -343,7 +344,7 @@ float route_budgets::minimax_PERT(std::shared_ptr timing_in return max_budget_change; } -float route_budgets::calculate_clb_pin_slack(ClusterNetId net_id, int ipin, std::shared_ptr timing_info, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, analysis_type type, AtomPinId& atom_pin) { +float route_budgets::calculate_clb_pin_slack(ClusterNetId net_id, int ipin, const std::shared_ptr& timing_info, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, analysis_type type, AtomPinId& atom_pin) { /*Calculates the slack for the specific clb pin. Takes the minimum slack. Keeps track of the pin * used in this calculation so it can be used again for getting the total path delay*/ auto& cluster_ctx = g_vpr_ctx.clustering(); @@ -387,7 +388,7 @@ float route_budgets::calculate_clb_pin_slack(ClusterNetId net_id, int ipin, std: return clb_min_slack; } -float route_budgets::get_total_path_delay(std::shared_ptr timing_analyzer, +float route_budgets::get_total_path_delay(const std::shared_ptr& timing_analyzer, analysis_type analysis_type, tatum::NodeId timing_node) { /*The total path delay through a connection is calculated using the arrival and required time @@ -454,7 +455,7 @@ float route_budgets::get_total_path_delay(std::shared_ptr& net_delay, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, const t_router_opts& router_opts) { /*Simplifies the budget calculation. The pin criticality describes 1-slack ratio diff --git a/vpr/src/route/route_budgets.h b/vpr/src/route/route_budgets.h index 601ad845199..015891b4317 100644 --- a/vpr/src/route/route_budgets.h +++ b/vpr/src/route/route_budgets.h @@ -57,13 +57,13 @@ class route_budgets { /*different ways to set route budgets*/ void allocate_slack_using_delays_and_criticalities(vtr::vector& net_delay, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, const t_router_opts& router_opts); void allocate_slack_using_weights(vtr::vector& net_delay, const ClusteredPinAtomPinsLookup& netlist_pin_lookup); /*Sometimes want to allocate only positive or negative slack. * By default, allocate both*/ - float minimax_PERT(std::shared_ptr timing_info, vtr::vector& temp_budgets, vtr::vector& net_delay, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, analysis_type analysis_type, bool keep_in_bounds, slack_allocated_type slack_type = BOTH); + float minimax_PERT(const std::shared_ptr& timing_info, vtr::vector& temp_budgets, vtr::vector& net_delay, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, analysis_type analysis_type, bool keep_in_bounds, slack_allocated_type slack_type = BOTH); void process_negative_slack_using_minimax(vtr::vector& net_delay, const ClusteredPinAtomPinsLookup& netlist_pin_lookup); /*Perform static timing analysis*/ @@ -78,8 +78,8 @@ class route_budgets { void keep_budget_above_value(vtr::vector& temp_budgets, float bottom_range); /*helper functions*/ - float calculate_clb_pin_slack(ClusterNetId net_id, int ipin, std::shared_ptr timing_info, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, analysis_type type, AtomPinId& atom_pin); - float get_total_path_delay(std::shared_ptr timing_analyzer, + float calculate_clb_pin_slack(ClusterNetId net_id, int ipin, const std::shared_ptr& timing_info, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, analysis_type type, AtomPinId& atom_pin); + float get_total_path_delay(const std::shared_ptr& timing_analyzer, analysis_type analysis_type, tatum::NodeId timing_node); void set_min_max_budgets_equal(); diff --git a/vpr/src/route/route_common.cpp b/vpr/src/route/route_common.cpp index 6204dad984b..5d0c26300fe 100644 --- a/vpr/src/route/route_common.cpp +++ b/vpr/src/route/route_common.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -318,8 +319,8 @@ bool try_route(int width_fac, segment_inf, net_delay, netlist_pin_lookup, - timing_info, - delay_calc, + std::move(timing_info), + std::move(delay_calc), first_iteration_priority); profiling::time_on_fanout_analysis(); diff --git a/vpr/src/route/route_timing.cpp b/vpr/src/route/route_timing.cpp index cc738162be4..90934d1e383 100644 --- a/vpr/src/route/route_timing.cpp +++ b/vpr/src/route/route_timing.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -283,7 +284,7 @@ static void print_route_status(int itry, const RouterStats& router_stats, const OveruseInfo& overuse_info, const WirelengthInfo& wirelength_info, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, float est_success_iteration); static std::string describe_unrouteable_connection(const int source_node, const int sink_node); @@ -296,11 +297,11 @@ static t_bb calc_current_bb(const t_trace* head); static bool is_better_quality_routing(const vtr::vector& best_routing, const RoutingMetrics& best_routing_metrics, const WirelengthInfo& wirelength_info, - std::shared_ptr timing_info); + const std::shared_ptr& timing_info); static bool early_reconvergence_exit_heuristic(const t_router_opts& router_opts, int itry_since_last_convergence, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, const RoutingMetrics& best_routing_metrics); static void generate_route_timing_reports(const t_router_opts& router_opts, @@ -318,8 +319,8 @@ bool try_timing_driven_route(const t_router_opts& router_opts, const std::vector& segment_inf, vtr::vector& net_delay, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, - std::shared_ptr timing_info, - std::shared_ptr delay_calc, + const std::shared_ptr& timing_info, + const std::shared_ptr& delay_calc, ScreenUpdatePriority first_iteration_priority) { /* Timing-driven routing algorithm. The timing graph (includes slack) * * must have already been allocated, and net_delay must have been allocated. * @@ -781,7 +782,7 @@ bool try_timing_driven_route_net(ClusterNetId net_id, vtr::vector& net_delay, const RouterLookahead& router_lookahead, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, route_budgets& budgeting_inf, bool& was_rerouted) { auto& cluster_ctx = g_vpr_ctx.clustering(); @@ -940,7 +941,7 @@ bool timing_driven_route_net(ClusterNetId net_id, float* net_delay, const RouterLookahead& router_lookahead, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, route_budgets& budgeting_inf) { /* Returns true as long as found some way to hook up this net, even if that * * way resulted in overuse of resources (congestion). If there is no way * @@ -1628,7 +1629,7 @@ static void timing_driven_expand_cheapest(t_heap* cheapest, target_node, router_stats); } else { - //Post-heap prune, do not re-explore from the current/new partial path as it + //Post-heap prune, do not re-explore from the current/new partial path as it //has worse cost than the best partial path to this node found so far VTR_LOGV_DEBUG(f_router_debug, " Worse cost to %d\n", inode); VTR_LOGV_DEBUG(f_router_debug, " Old total cost: %g\n", best_total_cost); @@ -2282,7 +2283,7 @@ static bool timing_driven_check_net_delays(vtr::vector& ne for (auto net_id : cluster_ctx.clb_nlist.nets()) { for (ipin = 1; ipin < cluster_ctx.clb_nlist.net_pins(net_id).size(); ipin++) { if (net_delay_check[net_id][ipin] == 0.) { /* Should be only GLOBAL nets */ - if (fabs(net_delay[net_id][ipin]) > ERROR_TOL) { + if (std::fabs(net_delay[net_id][ipin]) > ERROR_TOL) { VPR_ERROR(VPR_ERROR_ROUTE, "in timing_driven_check_net_delays: net %lu pin %d.\n" "\tIncremental calc. net_delay is %g, but from scratch net delay is %g.\n", @@ -2491,7 +2492,7 @@ void Connection_based_routing_resources::set_lower_bound_connection_delays(vtr:: * 1. the connection is critical enough * 2. the connection is suboptimal, in comparison to lower_bound_connection_delay */ bool Connection_based_routing_resources::forcibly_reroute_connections(float max_criticality, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, vtr::vector& net_delay) { auto& cluster_ctx = g_vpr_ctx.clustering(); @@ -2640,7 +2641,7 @@ static void print_route_status_header() { VTR_LOG("---- ------ ------- ---- ------- ------- ------- ----------------- --------------- -------- ---------- ---------- ---------- ---------- --------\n"); } -static void print_route_status(int itry, double elapsed_sec, float pres_fac, int num_bb_updated, const RouterStats& router_stats, const OveruseInfo& overuse_info, const WirelengthInfo& wirelength_info, std::shared_ptr timing_info, float est_success_iteration) { +static void print_route_status(int itry, double elapsed_sec, float pres_fac, int num_bb_updated, const RouterStats& router_stats, const OveruseInfo& overuse_info, const WirelengthInfo& wirelength_info, const std::shared_ptr& timing_info, float est_success_iteration) { //Iteration VTR_LOG("%4d", itry); @@ -2933,7 +2934,7 @@ void enable_router_debug(const t_router_opts& router_opts, ClusterNetId net, int static bool is_better_quality_routing(const vtr::vector& best_routing, const RoutingMetrics& best_routing_metrics, const WirelengthInfo& wirelength_info, - std::shared_ptr timing_info) { + const std::shared_ptr& timing_info) { if (best_routing.empty()) { return true; //First legal routing } @@ -2971,7 +2972,7 @@ static bool is_better_quality_routing(const vtr::vector timing_info, + const std::shared_ptr& timing_info, const RoutingMetrics& best_routing_metrics) { //Give-up on reconvergent routing if the CPD improvement after the //first iteration since convergence is small, compared to the best diff --git a/vpr/src/route/route_timing.h b/vpr/src/route/route_timing.h index c356b096c3b..d07a8c68726 100644 --- a/vpr/src/route/route_timing.h +++ b/vpr/src/route/route_timing.h @@ -18,8 +18,8 @@ bool try_timing_driven_route(const t_router_opts& router_opts, const std::vector& segment_inf, vtr::vector& net_delay, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, - std::shared_ptr timing_info, - std::shared_ptr delay_calc, + const std::shared_ptr& timing_info, + const std::shared_ptr& delay_calc, ScreenUpdatePriority first_iteration_priority); bool try_timing_driven_route_net(ClusterNetId net_id, @@ -33,7 +33,7 @@ bool try_timing_driven_route_net(ClusterNetId net_id, vtr::vector& net_delay, const RouterLookahead& router_lookahead, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, route_budgets& budgeting_inf, bool& was_rerouted); @@ -48,7 +48,7 @@ bool timing_driven_route_net(ClusterNetId net_id, float* net_delay, const RouterLookahead& router_lookahead, const ClusteredPinAtomPinsLookup& netlist_pin_lookup, - std::shared_ptr timing_info, + const std::shared_ptr& timing_info, route_budgets& budgeting_inf); void alloc_timing_driven_route_structs(float** pin_criticality_ptr, diff --git a/vpr/src/route/route_tree_timing.cpp b/vpr/src/route/route_tree_timing.cpp index 7988d02dcb6..3c5d4db478a 100644 --- a/vpr/src/route/route_tree_timing.cpp +++ b/vpr/src/route/route_tree_timing.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -65,7 +66,7 @@ void collect_route_tree_connections(const t_rt_node* node, std::set #include "globals.h" #include "route_tree_type.h" #include "route_common.h" @@ -188,7 +190,7 @@ void alloc_routing_structs(t_chan_width chan_width, create_rr_graph(graph_type, device_ctx.physical_tile_types, device_ctx.grid, - chan_width, + std::move(chan_width), device_ctx.num_arch_switches, det_routing_arch, segment_inf, diff --git a/vpr/src/route/router_lookahead.cpp b/vpr/src/route/router_lookahead.cpp index 130b862e94c..3a546c1e95f 100644 --- a/vpr/src/route/router_lookahead.cpp +++ b/vpr/src/route/router_lookahead.cpp @@ -1,5 +1,7 @@ #include "router_lookahead.h" +#include + #include "router_lookahead_map.h" #include "vpr_error.h" #include "globals.h" @@ -23,8 +25,8 @@ static std::unique_ptr make_router_lookahead_object(e_router_lo std::unique_ptr make_router_lookahead( e_router_lookahead router_lookahead_type, - std::string write_lookahead, - std::string read_lookahead, + const std::string& write_lookahead, + const std::string& read_lookahead, const std::vector& segment_inf) { std::unique_ptr router_lookahead = make_router_lookahead_object(router_lookahead_type); @@ -202,7 +204,7 @@ void invalidate_router_lookahead_cache() { const RouterLookahead* get_cached_router_lookahead( e_router_lookahead router_lookahead_type, std::string write_lookahead, - std::string read_lookahead, + const std::string& read_lookahead, const std::vector& segment_inf) { auto& router_ctx = g_vpr_ctx.routing(); @@ -220,7 +222,7 @@ const RouterLookahead* get_cached_router_lookahead( cache_key, make_router_lookahead( router_lookahead_type, - write_lookahead, + std::move(write_lookahead), read_lookahead, segment_inf)); } diff --git a/vpr/src/route/router_lookahead.h b/vpr/src/route/router_lookahead.h index 283df54befe..a3f3db83aca 100644 --- a/vpr/src/route/router_lookahead.h +++ b/vpr/src/route/router_lookahead.h @@ -34,8 +34,8 @@ class RouterLookahead { // cannot be used. std::unique_ptr make_router_lookahead( e_router_lookahead router_lookahead_type, - std::string write_lookahead, - std::string read_lookahead, + const std::string& write_lookahead, + const std::string& read_lookahead, const std::vector& segment_inf); // Clear router lookahead cache (e.g. when changing or free rrgraph). @@ -48,7 +48,7 @@ void invalidate_router_lookahead_cache(); const RouterLookahead* get_cached_router_lookahead( e_router_lookahead router_lookahead_type, std::string write_lookahead, - std::string read_lookahead, + const std::string& read_lookahead, const std::vector& segment_inf); class ClassicLookahead : public RouterLookahead { diff --git a/vpr/src/route/router_lookahead_map.cpp b/vpr/src/route/router_lookahead_map.cpp index c2ad6aad766..b4f4b047c60 100644 --- a/vpr/src/route/router_lookahead_map.cpp +++ b/vpr/src/route/router_lookahead_map.cpp @@ -532,12 +532,12 @@ Cost_Entry Expansion_Cost_Entry::get_geomean_entry() { float geomean_delay = 0; float geomean_cong = 0; for (auto cost_entry : this->cost_vector) { - geomean_delay += log(cost_entry.delay); - geomean_cong += log(cost_entry.congestion); + geomean_delay += std::log(cost_entry.delay); + geomean_cong += std::log(cost_entry.congestion); } - geomean_delay = exp(geomean_delay / (float)this->cost_vector.size()); - geomean_cong = exp(geomean_cong / (float)this->cost_vector.size()); + geomean_delay = std::exp(geomean_delay / (float)this->cost_vector.size()); + geomean_cong = std::exp(geomean_cong / (float)this->cost_vector.size()); return Cost_Entry(geomean_delay, geomean_cong); } @@ -568,7 +568,7 @@ Cost_Entry Expansion_Cost_Entry::get_median_entry() { /* sort the cost entries into bins */ std::vector > entry_bins(num_bins, std::vector()); for (auto entry : this->cost_vector) { - float bin_num = floor((entry.delay - min_del_entry.delay) / bin_size); + float bin_num = std::floor((entry.delay - min_del_entry.delay) / bin_size); VTR_ASSERT(vtr::nint(bin_num) >= 0 && vtr::nint(bin_num) <= num_bins); if (vtr::nint(bin_num) == num_bins) { diff --git a/vpr/src/route/rr_graph.cpp b/vpr/src/route/rr_graph.cpp index df1bb8b0967..f740c3aafe4 100644 --- a/vpr/src/route/rr_graph.cpp +++ b/vpr/src/route/rr_graph.cpp @@ -1,3 +1,4 @@ +#include #include #include #include @@ -287,7 +288,7 @@ static void build_rr_graph(const t_graph_type graph_type, t_chan_width nodes_per_chan, const enum e_switch_block_type sb_type, const int Fs, - const std::vector switchblocks, + const std::vector& switchblocks, const int num_arch_switches, const std::vector& segment_inf, const int global_route_switch, @@ -308,7 +309,7 @@ static void build_rr_graph(const t_graph_type graph_type, void create_rr_graph(const t_graph_type graph_type, const std::vector& block_types, const DeviceGrid& grid, - const t_chan_width nodes_per_chan, + const t_chan_width& nodes_per_chan, const int num_arch_switches, t_det_routing_arch* det_routing_arch, std::vector& segment_inf, @@ -413,7 +414,7 @@ static void build_rr_graph(const t_graph_type graph_type, t_chan_width nodes_per_chan, const enum e_switch_block_type sb_type, const int Fs, - const std::vector switchblocks, + const std::vector& switchblocks, const int num_arch_switches, const std::vector& segment_inf, const int global_route_switch, @@ -986,7 +987,7 @@ static std::vector> alloc_and_load_perturb_ipins(const int L_n } if ((Fc_in[itype][0][iseg] <= tracks_in_seg_type - 2) - && (fabs(Fc_ratio - vtr::nint(Fc_ratio)) + && (std::fabs(Fc_ratio - vtr::nint(Fc_ratio)) < (0.5 / (float)tracks_in_seg_type))) { result[itype][iseg] = true; } @@ -2956,7 +2957,7 @@ static std::vector alloc_and_load_perturb_opins(const t_physical_tile_type * case. */ /* get an upper bound on the number of prime factors of num_wire_types */ - max_primes = (int)floor(log((float)num_wire_types) / log(2.0)); + max_primes = (int)floor(std::log((float)num_wire_types) / log(2.0)); max_primes = std::max(max_primes, 1); //Minimum of 1 to ensure we allocate space for at least one prime_factor prime_factors = (int*)vtr::malloc(max_primes * sizeof(int)); @@ -2994,7 +2995,7 @@ static std::vector alloc_and_load_perturb_opins(const t_physical_tile_type n = step_size / prime_factors[i]; n = n - (float)vtr::nint(n); /* fractinal part */ - if (fabs(n) < threshold) { + if (std::fabs(n) < threshold) { perturb_opins[0] = true; break; } else { diff --git a/vpr/src/route/rr_graph.h b/vpr/src/route/rr_graph.h index f55a64f7f9f..1656c514a81 100644 --- a/vpr/src/route/rr_graph.h +++ b/vpr/src/route/rr_graph.h @@ -28,7 +28,7 @@ enum { void create_rr_graph(const t_graph_type graph_type, const std::vector& block_types, const DeviceGrid& grid, - t_chan_width nodes_per_chan, + const t_chan_width& nodes_per_chan, const int num_arch_switches, t_det_routing_arch* det_routing_arch, std::vector& segment_inf, diff --git a/vpr/src/route/rr_graph2.cpp b/vpr/src/route/rr_graph2.cpp index 556a879229f..90298edf860 100644 --- a/vpr/src/route/rr_graph2.cpp +++ b/vpr/src/route/rr_graph2.cpp @@ -38,7 +38,7 @@ static void load_block_rr_indices(const DeviceGrid& grid, t_rr_node_indices& indices, int* index); -static int get_bidir_track_to_chan_seg(const std::vector conn_tracks, +static int get_bidir_track_to_chan_seg(const std::vector& conn_tracks, const t_rr_node_indices& L_rr_node_indices, const int to_chan, const int to_seg, @@ -1705,7 +1705,7 @@ int get_track_to_tracks(const int from_chan, return num_conn; } -static int get_bidir_track_to_chan_seg(const std::vector conn_tracks, +static int get_bidir_track_to_chan_seg(const std::vector& conn_tracks, const t_rr_node_indices& L_rr_node_indices, const int to_chan, const int to_seg, diff --git a/vpr/src/route/rr_graph_area.cpp b/vpr/src/route/rr_graph_area.cpp index 963bba43e90..726fd3ef9f6 100644 --- a/vpr/src/route/rr_graph_area.cpp +++ b/vpr/src/route/rr_graph_area.cpp @@ -598,9 +598,9 @@ float trans_per_buf(float Rbuf, float R_minW_nmos, float R_minW_pmos) { /* Target stage ratio = 4. 1 minimum width buffer, then num_stage bigger * * ones. */ - num_stage = vtr::nint(log10(R_minW_nmos / Rbuf) / log10(4.)); + num_stage = vtr::nint(std::log10(R_minW_nmos / Rbuf) / log10(4.)); num_stage = std::max(num_stage, 1); - stage_ratio = pow((float)(R_minW_nmos / Rbuf), (float)(1. / (float)num_stage)); + stage_ratio = std::pow((float)(R_minW_nmos / Rbuf), (float)(1. / (float)num_stage)); Rstage = R_minW_nmos; trans_count = 0.; @@ -637,7 +637,7 @@ static float trans_per_mux(int num_inputs, float trans_sram_bit, float pass_tran /* This is a large multiplexer so design it using a two-level multiplexer * * + 0.00001 is to make sure exact square roots two don't get rounded down * * to one lower level. */ - num_second_stage_trans = (int)floor((float)sqrt((float)num_inputs) + 0.00001); + num_second_stage_trans = (int)floor((float)std::sqrt((float)num_inputs) + 0.00001); pass_trans = (num_inputs + num_second_stage_trans) * pass_trans_area; sram_trans = (ceil((float)num_inputs / num_second_stage_trans - 0.00001) + num_second_stage_trans) @@ -689,11 +689,11 @@ static float trans_per_R(float Rtrans, float R_minW_trans) { } else if (trans_area_eq == AREA_IMPROVED_NMOS_ONLY) { /* New transistor area estimation equation. Here only NMOS transistors * are taken into account */ - trans_area = 0.447 + 0.128 * drive_strength + 0.391 * sqrt(drive_strength); + trans_area = 0.447 + 0.128 * drive_strength + 0.391 * std::sqrt(drive_strength); } else if (trans_area_eq == AREA_IMPROVED_MIXED) { /* New transistor area estimation equation. Here both NMOS and PMOS * transistors are taken into account (extra spacing needed for N-wells) */ - trans_area = 0.518 + 0.127 * drive_strength + 0.428 * sqrt(drive_strength); + trans_area = 0.518 + 0.127 * drive_strength + 0.428 * std::sqrt(drive_strength); } else { VPR_FATAL_ERROR(VPR_ERROR_ROUTE, "Unrecognized transistor area model: %d\n", (int)trans_area_eq); } diff --git a/vpr/src/route/rr_graph_clock.cpp b/vpr/src/route/rr_graph_clock.cpp index 47746c0f883..c69558635bc 100644 --- a/vpr/src/route/rr_graph_clock.cpp +++ b/vpr/src/route/rr_graph_clock.cpp @@ -1,5 +1,7 @@ #include "rr_graph_clock.h" +#include + #include "globals.h" #include "rr_graph.h" #include "rr_graph2.h" @@ -121,16 +123,16 @@ int ClockRRGraphBuilder::add_rr_switch_from_arch_switch_inf(int arch_switch_idx, return rr_switch_idx; } -void ClockRRGraphBuilder::add_switch_location(std::string clock_name, +void ClockRRGraphBuilder::add_switch_location(const std::string& clock_name, std::string switch_point_name, int x, int y, int node_index) { // Note use of operator[] will automatically insert clock name if it doesn't exist - clock_name_to_switch_points[clock_name].insert_switch_node_idx(switch_point_name, x, y, node_index); + clock_name_to_switch_points[clock_name].insert_switch_node_idx(std::move(switch_point_name), x, y, node_index); } -void SwitchPoints::insert_switch_node_idx(std::string switch_point_name, int x, int y, int node_idx) { +void SwitchPoints::insert_switch_node_idx(const std::string& switch_point_name, int x, int y, int node_idx) { // Note use of operator[] will automatically insert switch name if it doesn't exit switch_point_name_to_switch_location[switch_point_name].insert_node_idx(x, y, node_idx); } @@ -150,7 +152,7 @@ void SwitchPoint::insert_node_idx(int x, int y, int node_idx) { locations.insert({x, y}); } -std::vector ClockRRGraphBuilder::get_rr_node_indices_at_switch_location(std::string clock_name, +std::vector ClockRRGraphBuilder::get_rr_node_indices_at_switch_location(const std::string& clock_name, std::string switch_point_name, int x, int y) const { @@ -160,10 +162,10 @@ std::vector ClockRRGraphBuilder::get_rr_node_indices_at_switch_location(std VTR_ASSERT(itter != clock_name_to_switch_points.end()); auto& switch_points = itter->second; - return switch_points.get_rr_node_indices_at_location(switch_point_name, x, y); + return switch_points.get_rr_node_indices_at_location(std::move(switch_point_name), x, y); } -std::vector SwitchPoints::get_rr_node_indices_at_location(std::string switch_point_name, +std::vector SwitchPoints::get_rr_node_indices_at_location(const std::string& switch_point_name, int x, int y) const { auto itter = switch_point_name_to_switch_location.find(switch_point_name); @@ -183,7 +185,7 @@ std::vector SwitchPoint::get_rr_node_indices_at_location(int x, int y) cons return rr_node_indices[x][y]; } -std::set> ClockRRGraphBuilder::get_switch_locations(std::string clock_name, +std::set> ClockRRGraphBuilder::get_switch_locations(const std::string& clock_name, std::string switch_point_name) const { auto itter = clock_name_to_switch_points.find(clock_name); @@ -191,10 +193,10 @@ std::set> ClockRRGraphBuilder::get_switch_locations(std::str VTR_ASSERT(itter != clock_name_to_switch_points.end()); auto& switch_points = itter->second; - return switch_points.get_switch_locations(switch_point_name); + return switch_points.get_switch_locations(std::move(switch_point_name)); } -std::set> SwitchPoints::get_switch_locations(std::string switch_point_name) const { +std::set> SwitchPoints::get_switch_locations(const std::string& switch_point_name) const { auto itter = switch_point_name_to_switch_location.find(switch_point_name); // assert that switch name exists in map diff --git a/vpr/src/route/rr_graph_clock.h b/vpr/src/route/rr_graph_clock.h index ccab33d8bf4..c858b2b6f5c 100644 --- a/vpr/src/route/rr_graph_clock.h +++ b/vpr/src/route/rr_graph_clock.h @@ -50,14 +50,14 @@ class SwitchPoints { /* Example: x,y = middle of the chip, switch_point_name == name of main drive * of global clock spine, returns the rr_nodes of all the clock spines that * start the newtork there*/ - std::vector get_rr_node_indices_at_location(std::string switch_point_name, + std::vector get_rr_node_indices_at_location(const std::string& switch_point_name, int x, int y) const; - std::set> get_switch_locations(std::string switch_point_name) const; + std::set> get_switch_locations(const std::string& switch_point_name) const; /** Setters **/ - void insert_switch_node_idx(std::string switch_point_name, int x, int y, int node_idx); + void insert_switch_node_idx(const std::string& switch_point_name, int x, int y, int node_idx); }; class ClockRRGraphBuilder { @@ -74,20 +74,20 @@ class ClockRRGraphBuilder { std::unordered_map clock_name_to_switch_points; /* Saves a map from switch rr_node idx -> {x, y} location */ - void add_switch_location(std::string clock_name, + void add_switch_location(const std::string& clock_name, std::string switch_point_name, int x, int y, int node_index); /* Returns the rr_node idx of the switch at location {x, y} */ - std::vector get_rr_node_indices_at_switch_location(std::string clock_name, + std::vector get_rr_node_indices_at_switch_location(const std::string& clock_name, std::string switch_point_name, int x, int y) const; /* Returns all the switch locations for the a certain clock network switch */ - std::set> get_switch_locations(std::string clock_name, + std::set> get_switch_locations(const std::string& clock_name, std::string switch_point_name) const; public: diff --git a/vpr/src/route/rr_metadata.cpp b/vpr/src/route/rr_metadata.cpp index a39e71117e8..6ff79c1402a 100644 --- a/vpr/src/route/rr_metadata.cpp +++ b/vpr/src/route/rr_metadata.cpp @@ -1,5 +1,7 @@ #include "rr_metadata.h" +#include + #include "globals.h" namespace vpr { @@ -11,7 +13,7 @@ const t_metadata_value* rr_node_metadata(int src_node, std::string key) { return nullptr; } auto& data = device_ctx.rr_node_metadata.at(src_node); - return data.one(key); + return data.one(std::move(key)); } void add_rr_node_metadata(int src_node, std::string key, std::string value) { @@ -21,7 +23,7 @@ void add_rr_node_metadata(int src_node, std::string key, std::string value) { device_ctx.rr_node_metadata.emplace(src_node, t_metadata_dict()); } auto& data = device_ctx.rr_node_metadata.at(src_node); - data.add(key, value); + data.add(std::move(key), std::move(value)); } const t_metadata_value* rr_edge_metadata(int src_node, int sink_id, short switch_id, std::string key) { @@ -33,7 +35,7 @@ const t_metadata_value* rr_edge_metadata(int src_node, int sink_id, short switch return nullptr; } - return iter->second.one(key); + return iter->second.one(std::move(key)); } void add_rr_edge_metadata(int src_node, int sink_id, short switch_id, std::string key, std::string value) { @@ -43,7 +45,7 @@ void add_rr_edge_metadata(int src_node, int sink_id, short switch_id, std::strin device_ctx.rr_edge_metadata.emplace(rr_edge, t_metadata_dict()); } auto& data = device_ctx.rr_edge_metadata.at(rr_edge); - data.add(key, value); + data.add(std::move(key), std::move(value)); } } // namespace vpr diff --git a/vpr/src/timing/PreClusterDelayCalculator.h b/vpr/src/timing/PreClusterDelayCalculator.h index 54e97e66a1a..5d0f1af7f0f 100644 --- a/vpr/src/timing/PreClusterDelayCalculator.h +++ b/vpr/src/timing/PreClusterDelayCalculator.h @@ -1,5 +1,7 @@ #ifndef PRE_CLUSTER_DELAY_CALCULATOR_H #define PRE_CLUSTER_DELAY_CALCULATOR_H +#include + #include "vtr_assert.h" #include "tatum/Time.hpp" @@ -21,7 +23,7 @@ class PreClusterDelayCalculator : public tatum::DelayCalculator { : netlist_(netlist) , netlist_lookup_(netlist_lookup) , inter_cluster_net_delay_(intercluster_net_delay) - , block_to_pb_gnode_(expected_lowest_cost_pb_gnode) { + , block_to_pb_gnode_(std::move(expected_lowest_cost_pb_gnode)) { //nop } diff --git a/vpr/src/timing/concrete_timing_info.cpp b/vpr/src/timing/concrete_timing_info.cpp index 02f141ca973..b8660f23261 100644 --- a/vpr/src/timing/concrete_timing_info.cpp +++ b/vpr/src/timing/concrete_timing_info.cpp @@ -3,7 +3,7 @@ #include "timing_info.h" #include "concrete_timing_info.h" -void warn_unconstrained(std::shared_ptr analyzer) { +void warn_unconstrained(const std::shared_ptr& analyzer) { if (analyzer->num_unconstrained_startpoints() > 0) { VTR_LOG_WARN("%zu timing startpoints were not constrained during timing analysis\n", analyzer->num_unconstrained_startpoints()); diff --git a/vpr/src/timing/concrete_timing_info.h b/vpr/src/timing/concrete_timing_info.h index cd41569431a..ebe36109036 100644 --- a/vpr/src/timing/concrete_timing_info.h +++ b/vpr/src/timing/concrete_timing_info.h @@ -1,6 +1,8 @@ #ifndef VPR_CONCRETE_TIMING_INFO_H #define VPR_CONCRETE_TIMING_INFO_H +#include + #include "vtr_log.h" #include "timing_util.h" #include "vpr_error.h" @@ -9,7 +11,7 @@ #include "tatum/report/graphviz_dot_writer.hpp" -void warn_unconstrained(std::shared_ptr analyzer); +void warn_unconstrained(const std::shared_ptr& analyzer); //NOTE: These classes should not be used directly but created with the // make_*_timing_info() functions in timing_info.h, and used through @@ -23,10 +25,10 @@ class ConcreteSetupTimingInfo : public SetupTimingInfo { std::shared_ptr timing_constraints_v, std::shared_ptr delay_calc, std::shared_ptr analyzer_v) - : timing_graph_(timing_graph_v) - , timing_constraints_(timing_constraints_v) + : timing_graph_(std::move(timing_graph_v)) + , timing_constraints_(std::move(timing_constraints_v)) , delay_calc_(delay_calc) - , setup_analyzer_(analyzer_v) + , setup_analyzer_(std::move(analyzer_v)) , slack_crit_(g_vpr_ctx.atom().nlist, g_vpr_ctx.atom().lookup) { //pass } @@ -172,10 +174,10 @@ class ConcreteHoldTimingInfo : public HoldTimingInfo { std::shared_ptr timing_constraints_v, std::shared_ptr delay_calc, std::shared_ptr analyzer_v) - : timing_graph_(timing_graph_v) - , timing_constraints_(timing_constraints_v) + : timing_graph_(std::move(timing_graph_v)) + , timing_constraints_(std::move(timing_constraints_v)) , delay_calc_(delay_calc) - , hold_analyzer_(analyzer_v) + , hold_analyzer_(std::move(analyzer_v)) , slack_crit_(g_vpr_ctx.atom().nlist, g_vpr_ctx.atom().lookup) { //pass } @@ -264,10 +266,10 @@ template class ConcreteSetupHoldTimingInfo : public SetupHoldTimingInfo { public: //Constructors - ConcreteSetupHoldTimingInfo(std::shared_ptr timing_graph_v, - std::shared_ptr timing_constraints_v, + ConcreteSetupHoldTimingInfo(const std::shared_ptr& timing_graph_v, + const std::shared_ptr& timing_constraints_v, std::shared_ptr delay_calc, - std::shared_ptr analyzer_v) + const std::shared_ptr& analyzer_v) : setup_timing_(timing_graph_v, timing_constraints_v, delay_calc, analyzer_v) , hold_timing_(timing_graph_v, timing_constraints_v, delay_calc, analyzer_v) , setup_hold_analyzer_(analyzer_v) { diff --git a/vpr/src/timing/read_sdc.cpp b/vpr/src/timing/read_sdc.cpp index 98897237060..2c50ccaee03 100644 --- a/vpr/src/timing/read_sdc.cpp +++ b/vpr/src/timing/read_sdc.cpp @@ -1128,7 +1128,7 @@ void apply_single_clock_default_timing_constraints(const AtomNetlist& netlist, const AtomPinId clock_driver, tatum::TimingConstraints& tc) { AtomNetId clock_net = netlist.pin_net(clock_driver); - std::string clock_name = netlist.net_name(clock_net); + const std::string& clock_name = netlist.net_name(clock_net); VTR_LOG("Setting default timing constraints:\n"); VTR_LOG(" * constrain all primay inputs and primary outputs on netlist clock '%s'\n", clock_name.c_str()); @@ -1176,7 +1176,7 @@ void apply_multi_clock_default_timing_constraints(const AtomNetlist& netlist, AtomNetId clock_net = netlist.pin_net(clock_driver); //Create the clock - std::string clock_name = netlist.net_name(clock_net); + const std::string& clock_name = netlist.net_name(clock_net); tatum::DomainId clock = tc.create_clock_domain(clock_name); //Mark the clock domain source diff --git a/vpr/src/timing/timing_util.cpp b/vpr/src/timing/timing_util.cpp index 0117ea5fc49..0eb8047d135 100644 --- a/vpr/src/timing/timing_util.cpp +++ b/vpr/src/timing/timing_util.cpp @@ -281,8 +281,8 @@ float find_hold_total_negative_slack(const tatum::HoldTimingAnalyzer& hold_analy return tns; } -tatum::NodeId find_origin_node_for_hold_slack(const tatum::TimingTags::tag_range arrival_tags, - const tatum::TimingTags::tag_range required_tags, +tatum::NodeId find_origin_node_for_hold_slack(const tatum::TimingTags::tag_range& arrival_tags, + const tatum::TimingTags::tag_range& required_tags, float slack) { /*Given the slack, arrival, and required tags of a certain timing node, * its origin node is found*/ @@ -538,7 +538,7 @@ float calculate_clb_net_pin_criticality(const SetupTimingInfo& timing_info, cons float calc_relaxed_criticality(const std::map& domains_max_req, const std::map& domains_worst_slack, - const tatum::TimingTags::tag_range tags) { + const tatum::TimingTags::tag_range& tags) { //Allowable round-off tolerance during criticality calculation constexpr float CRITICALITY_ROUND_OFF_TOLERANCE = 1e-4; @@ -600,7 +600,7 @@ float calc_relaxed_criticality(const std::map& domains_max_re return max_crit; } -void print_tatum_cpds(std::vector cpds) { +void print_tatum_cpds(const std::vector& cpds) { for (auto path : cpds) { VTR_LOG("Tatum %zu -> %zu: least_slack=%g cpd=%g\n", size_t(path.launch_domain()), size_t(path.capture_domain()), float(path.slack()), float(path.delay())); } diff --git a/vpr/src/timing/timing_util.h b/vpr/src/timing/timing_util.h index 65141110974..406f8dba4c9 100644 --- a/vpr/src/timing/timing_util.h +++ b/vpr/src/timing/timing_util.h @@ -61,8 +61,8 @@ void print_hold_timing_summary(const tatum::TimingConstraints& constraints, cons float find_total_negative_slack_within_clb_blocks(const tatum::HoldTimingAnalyzer& hold_analyzer); -tatum::NodeId find_origin_node_for_hold_slack(const tatum::TimingTags::tag_range arrival_tags, - const tatum::TimingTags::tag_range required_tags, +tatum::NodeId find_origin_node_for_hold_slack(const tatum::TimingTags::tag_range& arrival_tags, + const tatum::TimingTags::tag_range& required_tags, float slack); /* @@ -93,10 +93,10 @@ float calculate_clb_net_pin_criticality(const SetupTimingInfo& timing_info, cons // which handles the trade-off between different timing constraints in multi-clock circuits. float calc_relaxed_criticality(const std::map& domains_max_req, const std::map& domains_worst_slack, - const tatum::TimingTags::tag_range tags); + const tatum::TimingTags::tag_range& tags); /* * Debug */ -void print_tatum_cpds(std::vector cpds); +void print_tatum_cpds(const std::vector& cpds); #endif diff --git a/vpr/src/util/histogram.cpp b/vpr/src/util/histogram.cpp index c6eafeb44fd..9caf4bf083d 100644 --- a/vpr/src/util/histogram.cpp +++ b/vpr/src/util/histogram.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "vtr_log.h" #include "vtr_assert.h" @@ -57,9 +58,9 @@ std::vector build_histogram(std::vector values, size_t n void print_histogram(std::vector histogram) { size_t char_width = 80; - auto lines = format_histogram(histogram, char_width); + auto lines = format_histogram(std::move(histogram), char_width); - for (auto line : lines) { + for (const auto& line : lines) { VTR_LOG("%s\n", line.c_str()); } } diff --git a/vpr/src/util/vpr_error.cpp b/vpr/src/util/vpr_error.cpp index 14eb464b5ef..28b12e9a40a 100644 --- a/vpr/src/util/vpr_error.cpp +++ b/vpr/src/util/vpr_error.cpp @@ -1,5 +1,6 @@ #include #include +#include #include "vtr_util.h" #include "vtr_log.h" @@ -17,7 +18,7 @@ static std::unordered_set functions_to_demote; * anything but throw an exception which will be caught * main.c. */ -void map_error_activation_status(std::string function_name) { +void map_error_activation_status(const std::string& function_name) { functions_to_demote.insert(function_name); } @@ -56,7 +57,7 @@ void vpr_throw_msg(enum e_vpr_error type, const char* psz_file_name, unsigned int line_num, std::string msg) { - throw VprError(type, msg, psz_file_name, line_num); + throw VprError(type, std::move(msg), psz_file_name, line_num); } void vpr_throw_opt(enum e_vpr_error type, diff --git a/vpr/src/util/vpr_error.h b/vpr/src/util/vpr_error.h index 5820ebc0aae..1168dcdda57 100644 --- a/vpr/src/util/vpr_error.h +++ b/vpr/src/util/vpr_error.h @@ -4,6 +4,7 @@ #include #include #include +#include #include "vtr_error.h" @@ -39,7 +40,7 @@ class VprError : public vtr::VtrError { std::string msg = "", std::string file = "", size_t linenum = -1) - : VtrError(msg, file, linenum) + : VtrError(std::move(msg), std::move(file), linenum) , type_(err_type) {} t_vpr_error_type type() const { return type_; } @@ -51,7 +52,7 @@ class VprError : public vtr::VtrError { // This function is used to save into the functions_to_demote set // all the function names which contain VPR_THROW errors that are // going to be demoted to be VTR_LOG_WARN -void map_error_activation_status(std::string function_name); +void map_error_activation_status(const std::string& function_name); //VPR error reporting routines // diff --git a/vpr/src/util/vpr_utils.cpp b/vpr/src/util/vpr_utils.cpp index e19d1720915..b0775b1f936 100644 --- a/vpr/src/util/vpr_utils.cpp +++ b/vpr/src/util/vpr_utils.cpp @@ -2,6 +2,7 @@ #include #include #include +#include #include "vtr_assert.h" #include "vtr_log.h" @@ -228,6 +229,7 @@ std::vector block_type_class_index_to_pin_names(t_physical_tile_typ t_class& class_inf = type->class_inf[class_index]; std::vector pin_names; + pin_names.reserve(class_inf.num_pins); for (int ipin = 0; ipin < class_inf.num_pins; ++ipin) { pin_names.push_back(block_type_pin_index_to_name(type, class_inf.pinlist[ipin])); } @@ -636,7 +638,7 @@ void get_pin_range_for_block(const ClusterBlockId blk_id, *pin_high = (place_ctx.block_locs[blk_id].loc.z + 1) * (type->num_pins / type->capacity) - 1; } -t_physical_tile_type_ptr find_tile_type_by_name(std::string name, const std::vector& types) { +t_physical_tile_type_ptr find_tile_type_by_name(const std::string& name, const std::vector& types) { for (auto const& type : types) { if (type.name == name) { return &type; @@ -736,7 +738,7 @@ t_physical_tile_type_ptr find_most_common_tile_type(const DeviceGrid& grid) { } InstPort parse_inst_port(std::string str) { - InstPort inst_port(str); + InstPort inst_port(std::move(str)); auto& device_ctx = g_vpr_ctx.device(); auto blk_type = find_tile_type_by_name(inst_port.instance_name(), device_ctx.physical_tile_types); @@ -778,7 +780,7 @@ InstPort parse_inst_port(std::string str) { int find_pin_class(t_physical_tile_type_ptr type, std::string port_name, int pin_index_in_port, e_pin_type pin_type) { int iclass = OPEN; - int ipin = find_pin(type, port_name, pin_index_in_port); + int ipin = find_pin(type, std::move(port_name), pin_index_in_port); if (ipin != OPEN) { iclass = type->pin_class[ipin]; @@ -790,7 +792,7 @@ int find_pin_class(t_physical_tile_type_ptr type, std::string port_name, int pin return iclass; } -int find_pin(t_physical_tile_type_ptr type, std::string port_name, int pin_index_in_port) { +int find_pin(t_physical_tile_type_ptr type, const std::string& port_name, int pin_index_in_port) { int ipin = OPEN; int port_base_ipin = 0; int num_pins = OPEN; @@ -813,7 +815,7 @@ int find_pin(t_physical_tile_type_ptr type, std::string port_name, int pin_index } //Returns true if the specified block type contains the specified blif model name -bool block_type_contains_blif_model(t_logical_block_type_ptr type, std::string blif_model_name) { +bool block_type_contains_blif_model(t_logical_block_type_ptr type, const std::string& blif_model_name) { return pb_type_contains_blif_model(type->pb_type, blif_model_name); } @@ -1174,7 +1176,7 @@ t_pb_graph_pin* get_pb_graph_node_pin_from_block_pin(ClusterBlockId iblock, int } const t_port* find_pb_graph_port(const t_pb_graph_node* pb_gnode, std::string port_name) { - const t_pb_graph_pin* gpin = find_pb_graph_pin(pb_gnode, port_name, 0); + const t_pb_graph_pin* gpin = find_pb_graph_pin(pb_gnode, std::move(port_name), 0); if (gpin != nullptr) { return gpin->port; @@ -1182,7 +1184,7 @@ const t_port* find_pb_graph_port(const t_pb_graph_node* pb_gnode, std::string po return nullptr; } -const t_pb_graph_pin* find_pb_graph_pin(const t_pb_graph_node* pb_gnode, std::string port_name, int index) { +const t_pb_graph_pin* find_pb_graph_pin(const t_pb_graph_node* pb_gnode, const std::string& port_name, int index) { for (int iport = 0; iport < pb_gnode->num_input_ports; iport++) { if (pb_gnode->num_input_pins[iport] < index) continue; diff --git a/vpr/src/util/vpr_utils.h b/vpr/src/util/vpr_utils.h index e43cc91dacd..fddfcc0b41f 100644 --- a/vpr/src/util/vpr_utils.h +++ b/vpr/src/util/vpr_utils.h @@ -89,12 +89,12 @@ std::tuple find_pb_route_clb_input_net_pin(ClusterBlockI const t_port* find_pb_graph_port(const t_pb_graph_node* pb_gnode, std::string port_name); //Returns the graph pin matching name at pin index -const t_pb_graph_pin* find_pb_graph_pin(const t_pb_graph_node* pb_gnode, std::string port_name, int index); +const t_pb_graph_pin* find_pb_graph_pin(const t_pb_graph_node* pb_gnode, const std::string& port_name, int index); AtomPinId find_atom_pin(ClusterBlockId blk_id, const t_pb_graph_pin* pb_gpin); //Returns the physical tile type matching a given physical tile type name, or nullptr (if not found) -t_physical_tile_type_ptr find_tile_type_by_name(std::string name, const std::vector& types); +t_physical_tile_type_ptr find_tile_type_by_name(const std::string& name, const std::vector& types); //Returns the logical block type which is most common in the device grid t_logical_block_type_ptr find_most_common_block_type(const DeviceGrid& grid); @@ -108,13 +108,13 @@ InstPort parse_inst_port(std::string str); int find_pin_class(t_physical_tile_type_ptr type, std::string port_name, int pin_index_in_port, e_pin_type pin_type); -int find_pin(t_physical_tile_type_ptr type, std::string port_name, int pin_index_in_port); +int find_pin(t_physical_tile_type_ptr type, const std::string& port_name, int pin_index_in_port); //Returns the block type which is most likely the logic block t_logical_block_type_ptr infer_logic_block_type(const DeviceGrid& grid); //Returns true if the specified block type contains the specified blif model name -bool block_type_contains_blif_model(t_logical_block_type_ptr type, std::string blif_model_name); +bool block_type_contains_blif_model(t_logical_block_type_ptr type, const std::string& blif_model_name); //Returns true of a pb_type (or it's children) contain the specified blif model name bool pb_type_contains_blif_model(const t_pb_type* pb_type, const std::string& blif_model_name); diff --git a/vtr_flow/benchmarks/arithmetic/multless_consts/verilog/synth/tests/test1.png b/vtr_flow/benchmarks/arithmetic/multless_consts/verilog/synth/tests/test1.png index a0cd6452fb7..9ce4572eb97 100644 Binary files a/vtr_flow/benchmarks/arithmetic/multless_consts/verilog/synth/tests/test1.png and b/vtr_flow/benchmarks/arithmetic/multless_consts/verilog/synth/tests/test1.png differ