From d28f024b61b32f6620cbde66a0a253a547fa455a Mon Sep 17 00:00:00 2001 From: ubuntu Date: Tue, 28 Nov 2023 02:04:42 -0800 Subject: [PATCH] minor change --- libs/libpcf/src/base/repack_design_constraints.cpp | 12 +++++++++--- libs/libpcf/src/base/repack_design_constraints.h | 2 +- openfpga/src/repack/repack_option.cpp | 7 +++---- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/libs/libpcf/src/base/repack_design_constraints.cpp b/libs/libpcf/src/base/repack_design_constraints.cpp index b72e7fe82..68f926042 100644 --- a/libs/libpcf/src/base/repack_design_constraints.cpp +++ b/libs/libpcf/src/base/repack_design_constraints.cpp @@ -54,9 +54,15 @@ std::string RepackDesignConstraints::net( return repack_design_constraint_nets_[repack_design_constraint_id]; } -std::map> -RepackDesignConstraints::ignore_net_pin_map() const { - return ignore_net_pin_map_; +std::vector RepackDesignConstraints::ignore_net_on_pin( + const std::string& net_name) const { + std::map>::const_iterator it = + ignore_net_pin_map_.find(net_name); + if (it != ignore_net_pin_map_.end()) { + return it->second; + } else { + return std::vector(); + } } std::string RepackDesignConstraints::find_constrained_pin_net( diff --git a/libs/libpcf/src/base/repack_design_constraints.h b/libs/libpcf/src/base/repack_design_constraints.h index 2d7659642..c0de2bc85 100644 --- a/libs/libpcf/src/base/repack_design_constraints.h +++ b/libs/libpcf/src/base/repack_design_constraints.h @@ -69,7 +69,7 @@ class RepackDesignConstraints { std::string net( const RepackDesignConstraintId& repack_design_constraint_id) const; - std::map> ignore_net_pin_map() const; + std::vector ignore_net_on_pin(const std::string& net_name) const; /* Find a constrained net */ std::string find_constrained_pin_net(const std::string& pb_type, const openfpga::BasicPort& pin) const; diff --git a/openfpga/src/repack/repack_option.cpp b/openfpga/src/repack/repack_option.cpp index 7603b12e7..51581f072 100644 --- a/openfpga/src/repack/repack_option.cpp +++ b/openfpga/src/repack/repack_option.cpp @@ -49,14 +49,13 @@ bool RepackOption::is_pin_ignore_global_nets(const std::string& pb_type_name, bool RepackOption::net_is_specified_to_be_ignored(std::string cluster_net_name, std::string pb_type_name, const BasicPort& port) const { - auto result = design_constraints_.ignore_net_pin_map().find(cluster_net_name); - if (result == design_constraints_.ignore_net_pin_map().end()) { + auto pin_ctx_to_parse = + design_constraints_.ignore_net_on_pin(cluster_net_name); + if (pin_ctx_to_parse.empty()) { /* Not found, return false */ return false; } else { /* Split the content using a tokenizer */ - auto pin_ctx_to_parse = - design_constraints_.ignore_net_pin_map()[cluster_net_name]; for (auto pin_ctx_to_parse_iter : pin_ctx_to_parse) { int num_parse_errors_temp = 0; StringToken tokenizer(pin_ctx_to_parse_iter);