Skip to content

Commit

Permalink
lint, constant for "Internal Switch"
Browse files Browse the repository at this point in the history
  • Loading branch information
duck2 committed Aug 15, 2024
1 parent 0cd06c2 commit b27a746
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 12 deletions.
3 changes: 3 additions & 0 deletions libs/libarchfpga/src/physical_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -1660,6 +1660,9 @@ constexpr std::array<const char*, size_t(SwitchType::NUM_SWITCH_TYPES)> 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
Expand Down
2 changes: 1 addition & 1 deletion libs/librrgraph/src/io/rr_graph_uxsdcxx_serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -526,7 +526,7 @@ class RrGraphSerializer final : public uxsd::RrGraphBase<RrGraphContextTypes> {
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;
Expand Down
2 changes: 0 additions & 2 deletions utils/fasm/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
2 changes: 0 additions & 2 deletions utils/fasm/test/test_fasm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
Expand Down
4 changes: 0 additions & 4 deletions vpr/src/pack/post_routing_pb_pin_fixup.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ static std::vector<e_side> 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<RRNodeId, ClusterNetId>& rr_node_nets,
Expand Down Expand Up @@ -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");

Expand Down Expand Up @@ -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,
Expand Down
2 changes: 0 additions & 2 deletions vpr/src/pack/post_routing_pb_pin_fixup.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion vpr/src/util/vpr_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit b27a746

Please sign in to comment.