From a99c76565a249267a00a934c90689f4ad3d55de8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 16 Oct 2024 16:58:11 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8E=A8=20Incorporated=20pre-commit=20fixe?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../post_layout_optimization.hpp | 116 +++++++++--------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/include/fiction/algorithms/physical_design/post_layout_optimization.hpp b/include/fiction/algorithms/physical_design/post_layout_optimization.hpp index 36e247333..dd89b05ab 100644 --- a/include/fiction/algorithms/physical_design/post_layout_optimization.hpp +++ b/include/fiction/algorithms/physical_design/post_layout_optimization.hpp @@ -850,72 +850,72 @@ d!fanins.empty() !(fanins.size() == 2 && new_path_from_fanin_2_to_gate.empty()) && &!fanouts.empty() !(fanouts.size() == 2 && new_path_from_gate_to_fanout_2.empty())) +{ + for (const auto& path : {new_path_from_fanin_1_to_gate, new_path_from_fanin_2_to_gate, + new_path_from_gate_to_fanout_1, new_path_from_gate_to_fanout_2}) + { + if (!path.empty()) + { + route_path(lyt, path); + for (const auto& tile : path) { - for (const auto& path : {new_path_from_fanin_1_to_gate, new_path_from_fanin_2_to_gate, - new_path_from_gate_to_fanout_1, new_path_from_gate_to_fanout_2}) - { - if (!path.empty()) - { - route_path(lyt, path); - for (const auto& tile : path) - { - lyt.obstruct_coordinate(tile); - } - } - } + lyt.obstruct_coordinate(tile); + } + } + } - moved_gate = true; + moved_gate = true; - // update children based on number of fanins - if (fanins.size() == 2) - { - lyt.move_node(lyt.get_node(new_pos), new_pos, - { - lyt.make_signal(lyt.get_node(new_path_from_fanin_1_to_gate.end()[-2])), - lyt.make_signal(lyt.get_node(new_path_from_fanin_2_to_gate.end()[-2])), - }); - } - else if (fanins.size() == 1) - { - lyt.move_node(lyt.get_node(new_pos), new_pos, - {lyt.make_signal(lyt.get_node(new_path_from_fanin_1_to_gate.end()[-2]))}); - } + // update children based on number of fanins + if (fanins.size() == 2) + { + lyt.move_node(lyt.get_node(new_pos), new_pos, + { + lyt.make_signal(lyt.get_node(new_path_from_fanin_1_to_gate.end()[-2])), + lyt.make_signal(lyt.get_node(new_path_from_fanin_2_to_gate.end()[-2])), + }); + } + else if (fanins.size() == 1) + { + lyt.move_node(lyt.get_node(new_pos), new_pos, + {lyt.make_signal(lyt.get_node(new_path_from_fanin_1_to_gate.end()[-2]))}); + } - // update children of fanouts - for (const auto& fanout : fanouts) - { - std::vector> signals{}; - signals.reserve(lyt.fanin_size(lyt.get_node(fanout))); + // update children of fanouts + for (const auto& fanout : fanouts) + { + std::vector> signals{}; + signals.reserve(lyt.fanin_size(lyt.get_node(fanout))); - lyt.foreach_fanin(lyt.get_node(fanout), - [&lyt, &signals](const auto& i) - { - auto fout = static_cast>(i); - signals.push_back(lyt.make_signal(lyt.get_node(fout))); - }); + lyt.foreach_fanin(lyt.get_node(fanout), + [&lyt, &signals](const auto& i) + { + auto fout = static_cast>(i); + signals.push_back(lyt.make_signal(lyt.get_node(fout))); + }); - lyt.move_node(lyt.get_node(fanout), fanout, signals); - } + lyt.move_node(lyt.get_node(fanout), fanout, signals); + } - if (new_pos == old_pos) - { - return false; - } - } - // if no routing was found, remove added obstructions - else - { - for (const auto& path : {new_path_from_fanin_1_to_gate, new_path_from_fanin_2_to_gate, - new_path_from_gate_to_fanout_1, new_path_from_gate_to_fanout_2}) - { - for (const auto& tile : path) - { - lyt.clear_obstructed_coordinate(tile); - } - } - } + if (new_pos == old_pos) + { + return false; + } +} +// if no routing was found, remove added obstructions +else +{ + for (const auto& path : {new_path_from_fanin_1_to_gate, new_path_from_fanin_2_to_gate, + new_path_from_gate_to_fanout_1, new_path_from_gate_to_fanout_2}) + { + for (const auto& tile : path) + { + lyt.clear_obstructed_coordinate(tile); + } + } +} - current_pos = new_pos; +current_pos = new_pos; } return true; }