Skip to content

Commit

Permalink
🚨 Fixed compiler warnings (#480)
Browse files Browse the repository at this point in the history
* Update wiring_reduction.hpp

* 🎨 Incorporated pre-commit fixes

* Update post_layout_optimization.hpp

* 🎨 Incorporated pre-commit fixes

* Update post_layout_optimization.hpp

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
simon1hofmann and pre-commit-ci[bot] authored Jul 19, 2024
1 parent 2379031 commit c1cfe49
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
#ifndef FICTION_POST_LAYOUT_OPTIMIZATION_HPP
#define FICTION_POST_LAYOUT_OPTIMIZATION_HPP

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"

#include "fiction/algorithms/path_finding/a_star.hpp"
#include "fiction/algorithms/path_finding/cost.hpp"
#include "fiction/algorithms/path_finding/distance.hpp"
Expand Down Expand Up @@ -1047,4 +1050,6 @@ void post_layout_optimization(const Lyt& lyt, post_layout_optimization_params ps

} // namespace fiction

#pragma GCC diagnostic pop

#endif // FICTION_POST_LAYOUT_OPTIMIZATION_HPP
21 changes: 11 additions & 10 deletions include/fiction/algorithms/physical_design/wiring_reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -403,30 +403,31 @@ create_wiring_reduction_layout(const Lyt& lyt, const uint64_t x_offset = 0, cons
// crossing:
//
// =
auto is_single_wire = [&lyt, &old_coord](const uint64_t x_offset, const uint64_t y_offset)
auto is_single_wire = [&lyt, &old_coord](const uint64_t add_x_offset, const uint64_t add_y_offset)
{
return lyt.is_wire_tile({old_coord.x - x_offset, old_coord.y - y_offset, 0}) &&
!lyt.is_fanout(lyt.get_node({old_coord.x - x_offset, old_coord.y - y_offset, 0}) &&
lyt.is_empty_tile({old_coord.x - x_offset, old_coord.y - y_offset, 1}));
return lyt.is_wire_tile({old_coord.x - add_x_offset, old_coord.y - add_y_offset, 0}) &&
!lyt.is_fanout(lyt.get_node({old_coord.x - add_x_offset, old_coord.y - add_y_offset, 0}) &&
lyt.is_empty_tile({old_coord.x - add_x_offset, old_coord.y - add_y_offset, 1}));
};

// utility function to check for crossings with outgoing wires to the bottom layer:
//
// +→=
//
// =
auto is_crossing = [&lyt, &old_coord](const uint64_t x_offset, const uint64_t y_offset)
auto is_crossing = [&lyt, &old_coord](const uint64_t add_x_offset, const uint64_t add_y_offset)
{
return lyt.has_northern_incoming_signal({old_coord.x - x_offset, old_coord.y - y_offset + 1, 0}) &&
lyt.has_western_incoming_signal({old_coord.x - x_offset + 1, old_coord.y - y_offset, 0});
return lyt.has_northern_incoming_signal(
{old_coord.x - add_x_offset, old_coord.y - add_y_offset + 1, 0}) &&
lyt.has_western_incoming_signal({old_coord.x - add_x_offset + 1, old_coord.y - add_y_offset, 0});
};

// utility function to fully obstruct a coordinate
auto obstruct_coordinate =
[&wiring_reduction_lyt, &new_coord](const uint64_t x_offset, const uint64_t y_offset)
[&wiring_reduction_lyt, &new_coord](const uint64_t add_x_offset, const uint64_t add_y_offset)
{
wiring_reduction_lyt.obstruct_coordinate({new_coord.x - x_offset, new_coord.y - y_offset, 0});
wiring_reduction_lyt.obstruct_coordinate({new_coord.x - x_offset, new_coord.y - y_offset, 1});
wiring_reduction_lyt.obstruct_coordinate({new_coord.x - add_x_offset, new_coord.y - add_y_offset, 0});
wiring_reduction_lyt.obstruct_coordinate({new_coord.x - add_x_offset, new_coord.y - add_y_offset, 1});
};

// handle single input gates and wires
Expand Down

0 comments on commit c1cfe49

Please sign in to comment.