Obstructions¶
Gate and cell layouts expose persistent obstruction methods directly. Occupied tiles or
cells remain obstructed regardless of manual assignments, and a gate layout also treats its
existing signal connections as obstructed. A*, path enumeration, and Yen’s algorithm
therefore route around the gates and wires placed on any gate layout. Connections are
directed: blocking a to b does not block b to a.
Use standalone obstructions data for temporary search constraints. A*, path enumeration, and Yen’s
algorithm combine this data with the layout’s obstructions without changing either input.
The same data works with bare coordinate grids. Search data contains no layout or occupancy.
foreach_obstructed_coordinate and foreach_obstructed_connection enumerate manual assignments.
Python exposes these assignments through obstructed_coordinates() and obstructed_connections().
Header: fiction/layouts/obstructions.hpp
using grid = fiction::layouts::cartesian_layout;
grid lyt{{4, 4}};
fiction::layouts::obstructions blocked;
blocked.obstruct_coordinate({1, 1});
using path = fiction::physical_design::layout_coordinate_path;
auto paths = fiction::physical_design::path_finding::yen_k_shortest_paths<path>(
lyt, {{0, 0}, {3, 3}}, 3, {}, blocked);
-
class obstructions¶
Layout-independent coordinate and directed-connection constraints for routing searches.
Gate layouts expose persistent obstruction methods directly. Routing algorithms accept this separate object for temporary constraints and combine it with the layout’s persistent obstructions and occupancy. Copies are independent. This object contains no layout or occupancy information.
Public Functions
-
inline void obstruct_coordinate(const layout_base::coordinate &c)¶
Marks the given coordinate as obstructed.
- Parameters:
c – Coordinate to obstruct.
- Throws:
std::bad_alloc – If allocation fails.
-
inline void obstruct_connection(const layout_base::coordinate &src, const layout_base::coordinate &tgt)¶
Marks the connection from coordinate
srcto coordinatetgtas obstructed.Note
Coordinates marked this way will not be crossed with wires by path finding algorithms.
- Parameters:
src – Source coordinate.
tgt – Target coordinate.
- Throws:
std::bad_alloc – If allocation fails.
-
inline void clear_obstructed_coordinate(const layout_base::coordinate &c) noexcept¶
Clears the obstruction status of the given coordinate
cif the obstruction was manually marked viaobstruct_coordinate.- Parameters:
c – Coordinate to clear.
-
inline void clear_obstructed_connection(const layout_base::coordinate &src, const layout_base::coordinate &tgt) noexcept¶
Clears the obstruction status of the connection from coordinate
srcto coordinatetgtif the obstruction was manually marked viaobstruct_connection.- Parameters:
src – Source coordinate.
tgt – Target coordinate.
-
inline void clear_obstructed_coordinates() noexcept¶
Clears all obstructed coordinates that were manually marked via
obstruct_coordinate.
-
inline void clear_obstructed_connections() noexcept¶
Clears all obstructed connections that were manually marked via
obstruct_connection.
-
inline bool is_obstructed_coordinate(const layout_base::coordinate &c) const noexcept¶
Checks if the given coordinate is obstructed of some sort.
- Parameters:
c – Coordinate to check.
- Returns:
trueiffcis obstructed.
-
inline bool is_obstructed_connection(const layout_base::coordinate &src, const layout_base::coordinate &tgt) const noexcept¶
Checks if the given coordinate-coordinate connection is obstructed of some sort.
- Parameters:
src – Source coordinate.
tgt – Target coordinate.
- Returns:
trueiff the connection fromsrctotgtis obstructed.
-
inline void obstruct_coordinate(const layout_base::coordinate &c)¶
from mnt.pyfiction.layouts import cartesian_layout, obstructions
from mnt.pyfiction.physical_design.path_finding import yen_k_shortest_paths
lyt = cartesian_layout((4, 4))
blocked = obstructions()
blocked.obstruct_coordinate((1, 1))
paths = yen_k_shortest_paths(lyt, (0, 0), (3, 3), 3, obstructions=blocked)
- class obstructions¶
Layout-independent coordinate and directed-connection constraints for routing searches.
Gate layouts expose persistent obstruction methods directly. Routing algorithms accept this separate object for temporary constraints and combine it with the layout’s persistent obstructions and occupancy. Copies are independent. This object contains no layout or occupancy information.
- clear_obstructed_connection(src: coordinate | tuple[int, int] | tuple[int, int, int], tgt: coordinate | tuple[int, int] | tuple[int, int, int]) None¶
Clears the obstruction status of the connection from coordinate
srcto coordinatetgtif the obstruction was manually marked viaobstruct_connection.- Parameters:
src – Source coordinate.
tgt – Target coordinate.
- clear_obstructed_connections() None¶
Clears all obstructed connections that were manually marked via
obstruct_connection.
- clear_obstructed_coordinate(c: coordinate | tuple[int, int] | tuple[int, int, int]) None¶
Clears the obstruction status of the given coordinate
cif the obstruction was manually marked viaobstruct_coordinate.- Parameters:
c – Coordinate to clear.
- clear_obstructed_coordinates() None¶
Clears all obstructed coordinates that were manually marked via
obstruct_coordinate.
- is_obstructed_connection(src: coordinate | tuple[int, int] | tuple[int, int, int], tgt: coordinate | tuple[int, int] | tuple[int, int, int]) bool¶
Checks if the given coordinate-coordinate connection is obstructed of some sort.
- Parameters:
src – Source coordinate.
tgt – Target coordinate.
- Returns:
trueiff the connection fromsrctotgtis obstructed.
- is_obstructed_coordinate(c: coordinate | tuple[int, int] | tuple[int, int, int]) bool¶
Checks if the given coordinate is obstructed of some sort.
- Parameters:
c – Coordinate to check.
- Returns:
trueiffcis obstructed.
- obstruct_connection(src: coordinate | tuple[int, int] | tuple[int, int, int], tgt: coordinate | tuple[int, int] | tuple[int, int, int]) None¶
Marks the connection from coordinate
srcto coordinatetgtas obstructed.- Parameters:
src – Source coordinate.
tgt – Target coordinate.
- Raises:
MemoryError – If allocation fails.
Note
Coordinates marked this way will not be crossed with wires by path finding algorithms.
- obstruct_coordinate(c: coordinate | tuple[int, int] | tuple[int, int, int]) None¶
Marks the given coordinate as obstructed.
- Parameters:
c – Coordinate to obstruct.
- Raises:
MemoryError – If allocation fails.
- obstructed_connections() list[tuple[coordinate, coordinate]]¶
Returns explicit directed-connection obstructions in unspecified order.
- obstructed_coordinates() list[coordinate]¶
Returns explicit coordinate obstructions in unspecified order.