From b27a74606a5ec5d7b3259b2a1ac6e8d0ecdf8354 Mon Sep 17 00:00:00 2001 From: Duck Deux Date: Thu, 15 Aug 2024 10:23:07 -0700 Subject: [PATCH] lint, constant for "Internal Switch" --- libs/libarchfpga/src/physical_types.h | 3 +++ libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h | 2 +- utils/fasm/src/main.cpp | 2 -- utils/fasm/test/test_fasm.cpp | 2 -- vpr/src/pack/post_routing_pb_pin_fixup.cpp | 4 ---- vpr/src/pack/post_routing_pb_pin_fixup.h | 2 -- vpr/src/util/vpr_utils.cpp | 2 +- 7 files changed, 5 insertions(+), 12 deletions(-) diff --git a/libs/libarchfpga/src/physical_types.h b/libs/libarchfpga/src/physical_types.h index 4845ff3aca8..24f53f42033 100644 --- a/libs/libarchfpga/src/physical_types.h +++ b/libs/libarchfpga/src/physical_types.h @@ -1660,6 +1660,9 @@ constexpr std::array SWITCH_T */ constexpr const char* VPR_DELAYLESS_SWITCH_NAME = "__vpr_delayless_switch__"; +/* Internal switch: used by the flat router */ +constexpr const char* VPR_INTERNAL_SWITCH_NAME = "Internal Switch"; + enum class BufferSize { AUTO, ABSOLUTE diff --git a/libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h b/libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h index 53d365b24e6..9d2b7d9bf63 100644 --- a/libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h +++ b/libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h @@ -526,7 +526,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase { bool found_arch_name = false; std::string string_name = std::string(name); // The string name has the format of "Internal Switch/delay". So, I have to use compare to specify the portion I want to be compared. - bool is_internal_sw = string_name.compare(0, 15, "Internal Switch") == 0; + bool is_internal_sw = string_name.compare(0, 15, VPR_INTERNAL_SWITCH_NAME) == 0; for (const auto& arch_sw_inf: arch_switch_inf_) { if (string_name == arch_sw_inf.name || is_internal_sw) { found_arch_name = true; diff --git a/utils/fasm/src/main.cpp b/utils/fasm/src/main.cpp index dfd4b0ba319..a5256cf1b66 100644 --- a/utils/fasm/src/main.cpp +++ b/utils/fasm/src/main.cpp @@ -92,10 +92,8 @@ int main(int argc, const char **argv) { sync_netlists_to_routing((const Netlist<>&) g_vpr_ctx.clustering().clb_nlist, g_vpr_ctx.device(), g_vpr_ctx.mutable_atom(), - g_vpr_ctx.atom().lookup, g_vpr_ctx.mutable_clustering(), g_vpr_ctx.placement(), - g_vpr_ctx.routing(), vpr_setup.PackerOpts.pack_verbosity > 2); } } diff --git a/utils/fasm/test/test_fasm.cpp b/utils/fasm/test/test_fasm.cpp index 0d4039511ca..1cdfd635d35 100644 --- a/utils/fasm/test/test_fasm.cpp +++ b/utils/fasm/test/test_fasm.cpp @@ -335,10 +335,8 @@ TEST_CASE("fasm_integration_test", "[fasm]") { sync_netlists_to_routing((const Netlist<>&) g_vpr_ctx.clustering().clb_nlist, g_vpr_ctx.device(), g_vpr_ctx.mutable_atom(), - g_vpr_ctx.atom().lookup, g_vpr_ctx.mutable_clustering(), g_vpr_ctx.placement(), - g_vpr_ctx.routing(), vpr_setup.PackerOpts.pack_verbosity > 2); } } diff --git a/vpr/src/pack/post_routing_pb_pin_fixup.cpp b/vpr/src/pack/post_routing_pb_pin_fixup.cpp index 69daabf5fec..3694f5c44ba 100644 --- a/vpr/src/pack/post_routing_pb_pin_fixup.cpp +++ b/vpr/src/pack/post_routing_pb_pin_fixup.cpp @@ -48,7 +48,6 @@ static std::vector find_physical_tile_pin_side(t_physical_tile_type_ptr * - if the net id does not match, we update the clustering context *******************************************************************/ static void update_cluster_pin_with_post_routing_results(const Netlist<>& net_list, - const AtomContext& atom_ctx, const DeviceContext& device_ctx, ClusteringContext& clustering_ctx, const vtr::vector& rr_node_nets, @@ -1037,10 +1036,8 @@ static void update_cluster_routing_traces_with_post_routing_results(AtomContext& void sync_netlists_to_routing(const Netlist<>& net_list, const DeviceContext& device_ctx, AtomContext& atom_ctx, - const AtomLookup& atom_look_up, ClusteringContext& clustering_ctx, const PlacementContext& placement_ctx, - const RoutingContext& routing_ctx, const bool& verbose) { vtr::ScopedStartFinishTimer timer("Synchronize the packed netlist to routing optimization"); @@ -1069,7 +1066,6 @@ void sync_netlists_to_routing(const Netlist<>& net_list, if (seen_block_ids.insert(clb_blk_id).second) { update_cluster_pin_with_post_routing_results(net_list, - atom_ctx, device_ctx, clustering_ctx, rr_node_nets, diff --git a/vpr/src/pack/post_routing_pb_pin_fixup.h b/vpr/src/pack/post_routing_pb_pin_fixup.h index bcb731e1bed..026bcacb356 100644 --- a/vpr/src/pack/post_routing_pb_pin_fixup.h +++ b/vpr/src/pack/post_routing_pb_pin_fixup.h @@ -12,10 +12,8 @@ void sync_netlists_to_routing(const Netlist<>& net_list, const DeviceContext& device_ctx, AtomContext& atom_ctx, - const AtomLookup& atom_lookup, ClusteringContext& clustering_ctx, const PlacementContext& placement_ctx, - const RoutingContext& routing_ctx, const bool& verbose); #endif diff --git a/vpr/src/util/vpr_utils.cpp b/vpr/src/util/vpr_utils.cpp index 6f47cf100cb..5786816accd 100644 --- a/vpr/src/util/vpr_utils.cpp +++ b/vpr/src/util/vpr_utils.cpp @@ -2465,7 +2465,7 @@ t_arch_switch_inf create_internal_arch_sw(float delay) { arch_switch_inf.set_type(SwitchType::MUX); std::ostringstream stream_obj; stream_obj << delay << std::scientific; - arch_switch_inf.name = ("Internal Switch/" + stream_obj.str()); + arch_switch_inf.name = (std::string(VPR_INTERNAL_SWITCH_NAME) + "/" + stream_obj.str()); arch_switch_inf.R = 0.; arch_switch_inf.Cin = 0.; arch_switch_inf.Cout = 0;