Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ› Fixed multiple post_layout_optimization bugs #472

Merged
merged 25 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
d4bcce8
Update post_layout_optimization.hpp
simon1hofmann Jul 9, 2024
379e92e
Update wiring_reduction.hpp
simon1hofmann Jul 9, 2024
5a37fbc
Update include/fiction/algorithms/physical_design/post_layout_optimiz…
simon1hofmann Jul 9, 2024
5b5869c
Update wiring_reduction.hpp
simon1hofmann Jul 9, 2024
33ce0f7
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 9, 2024
cf2560d
Update post_layout_optimization.hpp
simon1hofmann Jul 9, 2024
7285b64
Update post_layout_optimization.hpp
simon1hofmann Jul 16, 2024
244256d
Update wiring_reduction.hpp
simon1hofmann Jul 16, 2024
25a7baf
Update post_layout_optimization.hpp
simon1hofmann Jul 16, 2024
4cbd5e9
Update test_post_layout_optimization.py
simon1hofmann Jul 16, 2024
7656af9
Update test_post_layout_optimization.py
simon1hofmann Jul 16, 2024
fe55e04
Update test_post_layout_optimization.py
simon1hofmann Jul 16, 2024
d4328a1
Update post_layout_optimization.hpp
simon1hofmann Jul 16, 2024
ea98d0e
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 16, 2024
772c3c7
Update test_post_layout_optimization.py
simon1hofmann Jul 16, 2024
80db7e1
Update post_layout_optimization.hpp
simon1hofmann Jul 16, 2024
3861ed9
Update wiring_reduction.hpp
simon1hofmann Jul 17, 2024
92f0854
Update post_layout_optimization.hpp
simon1hofmann Jul 17, 2024
8127946
Merge branch 'main' into plo_bug
simon1hofmann Jul 17, 2024
d650614
Update post_layout_optimization.hpp
simon1hofmann Jul 17, 2024
b179a96
Update wiring_reduction.hpp
simon1hofmann Jul 17, 2024
b7b08be
Update post_layout_optimization.hpp
simon1hofmann Jul 17, 2024
b6de22e
Update pyfiction-docstring-generator.yml
simon1hofmann Jul 17, 2024
5cf674b
Update pyfiction-docstring-generator.yml
simon1hofmann Jul 17, 2024
aae1b3c
Merge branch 'main' into plo_bug
simon1hofmann Jul 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -514,7 +514,7 @@ bool improve_gate_location(Lyt& lyt, const tile<Lyt>& old_pos, const tile<Lyt>&
{
const uint64_t y = k - x;

if (moved_gate || (num_gate_relocations >= max_gate_relocations))
if (moved_gate || ((num_gate_relocations >= max_gate_relocations) && !lyt.is_po_tile(current_pos)))
{
break;
}
Expand Down Expand Up @@ -636,7 +636,7 @@ bool improve_gate_location(Lyt& lyt, const tile<Lyt>& old_pos, const tile<Lyt>&
}
}

if (moved_gate || (num_gate_relocations >= max_gate_relocations))
if (moved_gate || ((num_gate_relocations >= max_gate_relocations) & !lyt.is_po_tile(current_pos)))
marcelwa marked this conversation as resolved.
Show resolved Hide resolved
{
break;
}
Expand Down Expand Up @@ -846,15 +846,14 @@ class post_layout_optimization_impl

std::sort(gate_tiles.begin(), gate_tiles.end(), detail::compare_gate_tiles<Lyt>);

tile<Lyt> max_non_po;
// Iterate through the vector in reverse
for (auto it = gate_tiles.rbegin(); it != gate_tiles.rend(); ++it)
tile<Lyt> max_non_po{0, 0};
// Determine minimal border for POs
for (auto gate_tile : gate_tiles)
simon1hofmann marked this conversation as resolved.
Show resolved Hide resolved
simon1hofmann marked this conversation as resolved.
Show resolved Hide resolved
{
// Stop if a condition based on the element is met
if (!layout.is_po_tile(*it))
if (!layout.is_po_tile(gate_tile))
{
max_non_po = *it;
break;
max_non_po.x = std::max(max_non_po.x, gate_tile.x);
max_non_po.y = std::max(max_non_po.y, gate_tile.y);
}
}
moved_at_least_one_gate = false;
Expand Down
49 changes: 49 additions & 0 deletions include/fiction/algorithms/physical_design/wiring_reduction.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,55 @@ create_wiring_reduction_layout(const Lyt& lyt, const uint64_t x_offset = 0, cons
wiring_reduction_lyt.obstruct_coordinate(new_coord);
wiring_reduction_lyt.obstruct_coordinate({new_coord.x, new_coord.y, 1});

// special case:
simon1hofmann marked this conversation as resolved.
Show resolved Hide resolved
// =
// ↓
// = =
// ↓ ↓
// =β†’&
//
// -> No crossing between coordinate to the left and coordinate above the gate
if (lyt.has_northern_incoming_signal({old_coord.x - 1, old_coord.y, old_coord.z}) &&
lyt.has_northern_incoming_signal({old_coord.x, old_coord.y - 1, old_coord.z}) &&
lyt.is_wire_tile({old_coord.x - 1, old_coord.y, old_coord.z}) &&
lyt.is_wire_tile({old_coord.x, old_coord.y - 1, old_coord.z}) &&
lyt.is_wire_tile({old_coord.x - 1, old_coord.y - 1, old_coord.z}) &&
lyt.is_wire_tile({old_coord.x, old_coord.y - 2, old_coord.z}) &&
!lyt.is_fanout(lyt.get_node({old_coord.x - 1, old_coord.y, old_coord.z})) &&
!lyt.is_fanout(lyt.get_node({old_coord.x, old_coord.y - 1, old_coord.z})) &&
!lyt.is_fanout(lyt.get_node({old_coord.x - 1, old_coord.y - 1, old_coord.z})) &&
!lyt.is_fanout(lyt.get_node({old_coord.x, old_coord.y - 2, old_coord.z})))

{
if (wiring_reduction_lyt.get_search_direction() == search_direction::HORIZONTAL)
{
wiring_reduction_lyt.obstruct_coordinate({new_coord.x - 1, new_coord.y, 0});
wiring_reduction_lyt.obstruct_coordinate({new_coord.x - 1, new_coord.y, 1});
}
}
// special case:
// =β†’=
// ↓
// =β†’=β†’&
//
// -> No crossing between coordinate to the left and coordinate above the gate
if (lyt.has_western_incoming_signal({old_coord.x - 1, old_coord.y, old_coord.z}) &&
lyt.has_western_incoming_signal({old_coord.x, old_coord.y - 1, old_coord.z}) &&
lyt.is_wire_tile({old_coord.x - 1, old_coord.y, old_coord.z}) &&
lyt.is_wire_tile({old_coord.x, old_coord.y - 1, old_coord.z}) &&
lyt.is_wire_tile({old_coord.x - 1, old_coord.y - 1, old_coord.z}) &&
lyt.is_wire_tile({old_coord.x - 2, old_coord.y, old_coord.z}) &&
!lyt.is_fanout(lyt.get_node({old_coord.x - 1, old_coord.y, old_coord.z})) &&
!lyt.is_fanout(lyt.get_node({old_coord.x, old_coord.y - 1, old_coord.z})) &&
!lyt.is_fanout(lyt.get_node({old_coord.x - 1, old_coord.y - 1, old_coord.z})) &&
!lyt.is_fanout(lyt.get_node({old_coord.x - 2, old_coord.y, old_coord.z})))
{
if (wiring_reduction_lyt.get_search_direction() == search_direction::VERTICAL)
{
wiring_reduction_lyt.obstruct_coordinate({new_coord.x, new_coord.y - 1, 0});
wiring_reduction_lyt.obstruct_coordinate({new_coord.x, new_coord.y - 1, 1});
}
}
// special case:
// +β†’=
// ↓ ↓
Expand Down
Loading