Obstruction Layout
The obstruction layout enables a unified interface for checking coordinates and connections for their obstruction that can be layered on top of any coordinate layout. An obstruction could be due to a prior placement or due to a fabrication defect. This interface can be added before construction of a new layout or to an already existing one without altering it.
Header: fiction/layouts/obstruction_layout.hpp
-
template<typename Lyt, bool has_obstruction_interface = std::conjunction_v<has_is_obstructed_coordinate<Lyt>, has_is_obstructed_connection<Lyt>>>
class obstruction_layout : public Lyt A layout type to layer on top of any coordinate layout. It implements a unified obstruction interface that determines whether a coordinate is blocked by something. That could either be due to prior placement of cells, gates, and wires or because of fabrication defects.
Currently, this layout type supports obstruction rules for gate_level_layout and cell_level_layout.
- Template Parameters:
Lyt – Any coordinate layout type that is to be extended by an obstruction interface.
has_obstruction_interface – Automatically determines whether an obstruction interface is already present.
-
template<typename Lyt>
class obstruction_layout<Lyt, false> : public Lyt Public Functions
-
inline obstruction_layout()
Standard constructor for empty layouts.
-
inline explicit obstruction_layout(const Lyt &lyt)
Standard constructor that layers the obstruction interface onto an existing layout.
- Parameters:
lyt – Existing layout that is to be extended by an obstruction interface.
-
inline void obstruct_coordinate(const typename Lyt::coordinate &c) noexcept
Marks the given coordinate as obstructed.
- Parameters:
c – Coordinate to obstruct.
-
inline void obstruct_connection(const typename Lyt::coordinate &src, const typename Lyt::coordinate &tgt) noexcept
Marks the connection from coordinate
src
to coordinatetgt
as obstructed.Note
Coordinates marked this way will not be crossed with wires by path finding algorithms.
- Parameters:
src – Source coordinate.
tgt – Target coordinate.
-
inline void clear_obstructed_coordinate(const typename Lyt::coordinate &c) noexcept
Clears the obstruction status of the given coordinate
c
if the obstruction was manually marked viaobstruct_coordinate
.- Parameters:
c – Coordinate to clear.
-
inline void clear_obstructed_connection(const typename Lyt::coordinate &src, const typename Lyt::coordinate &tgt) noexcept
Clears the obstruction status of the connection from coordinate
src
to coordinatetgt
if 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 typename Lyt::coordinate &c) const noexcept
Checks if the given coordinate is obstructed of some sort.
- Parameters:
c – Coordinate to check.
- Returns:
true
iffc
is obstructed.
-
inline bool is_obstructed_connection(const typename Lyt::coordinate &src, const typename Lyt::coordinate &tgt) const noexcept
Checks if the given coordinate-coordinate connection is obstructed of some sort.
- Parameters:
src – Source coordinate.
tgt – Target coordinate.
- Returns:
true
iff the connection fromc1
toc2
is obstructed.
-
template<>
struct obstruction_layout_storage
-
inline obstruction_layout()
- class mnt.pyfiction.cartesian_obstruction_layout
- clear_obstructed_connection(self: mnt.pyfiction.pyfiction.cartesian_obstruction_layout, src: mnt.pyfiction.pyfiction.offset_coordinate, tgt: mnt.pyfiction.pyfiction.offset_coordinate) None
- clear_obstructed_connections(self: mnt.pyfiction.pyfiction.cartesian_obstruction_layout) None
- clear_obstructed_coordinate(self: mnt.pyfiction.pyfiction.cartesian_obstruction_layout, c: mnt.pyfiction.pyfiction.offset_coordinate) None
- clear_obstructed_coordinates(self: mnt.pyfiction.pyfiction.cartesian_obstruction_layout) None
- is_obstructed_connection(self: mnt.pyfiction.pyfiction.cartesian_obstruction_layout, src: mnt.pyfiction.pyfiction.offset_coordinate, tgt: mnt.pyfiction.pyfiction.offset_coordinate) bool
- is_obstructed_coordinate(self: mnt.pyfiction.pyfiction.cartesian_obstruction_layout, c: mnt.pyfiction.pyfiction.offset_coordinate) bool
- obstruct_connection(self: mnt.pyfiction.pyfiction.cartesian_obstruction_layout, src: mnt.pyfiction.pyfiction.offset_coordinate, tgt: mnt.pyfiction.pyfiction.offset_coordinate) None
- obstruct_coordinate(self: mnt.pyfiction.pyfiction.cartesian_obstruction_layout, c: mnt.pyfiction.pyfiction.offset_coordinate) None
- class mnt.pyfiction.shifted_cartesian_obstruction_layout
- clear_obstructed_connection(self: mnt.pyfiction.pyfiction.shifted_cartesian_obstruction_layout, src: mnt.pyfiction.pyfiction.offset_coordinate, tgt: mnt.pyfiction.pyfiction.offset_coordinate) None
- clear_obstructed_connections(self: mnt.pyfiction.pyfiction.shifted_cartesian_obstruction_layout) None
- clear_obstructed_coordinate(self: mnt.pyfiction.pyfiction.shifted_cartesian_obstruction_layout, c: mnt.pyfiction.pyfiction.offset_coordinate) None
- clear_obstructed_coordinates(self: mnt.pyfiction.pyfiction.shifted_cartesian_obstruction_layout) None
- is_obstructed_connection(self: mnt.pyfiction.pyfiction.shifted_cartesian_obstruction_layout, src: mnt.pyfiction.pyfiction.offset_coordinate, tgt: mnt.pyfiction.pyfiction.offset_coordinate) bool
- is_obstructed_coordinate(self: mnt.pyfiction.pyfiction.shifted_cartesian_obstruction_layout, c: mnt.pyfiction.pyfiction.offset_coordinate) bool
- obstruct_connection(self: mnt.pyfiction.pyfiction.shifted_cartesian_obstruction_layout, src: mnt.pyfiction.pyfiction.offset_coordinate, tgt: mnt.pyfiction.pyfiction.offset_coordinate) None
- obstruct_coordinate(self: mnt.pyfiction.pyfiction.shifted_cartesian_obstruction_layout, c: mnt.pyfiction.pyfiction.offset_coordinate) None
- class mnt.pyfiction.hexagonal_obstruction_layout
- clear_obstructed_connection(self: mnt.pyfiction.pyfiction.hexagonal_obstruction_layout, src: mnt.pyfiction.pyfiction.offset_coordinate, tgt: mnt.pyfiction.pyfiction.offset_coordinate) None
- clear_obstructed_connections(self: mnt.pyfiction.pyfiction.hexagonal_obstruction_layout) None
- clear_obstructed_coordinate(self: mnt.pyfiction.pyfiction.hexagonal_obstruction_layout, c: mnt.pyfiction.pyfiction.offset_coordinate) None
- clear_obstructed_coordinates(self: mnt.pyfiction.pyfiction.hexagonal_obstruction_layout) None
- is_obstructed_connection(self: mnt.pyfiction.pyfiction.hexagonal_obstruction_layout, src: mnt.pyfiction.pyfiction.offset_coordinate, tgt: mnt.pyfiction.pyfiction.offset_coordinate) bool
- is_obstructed_coordinate(self: mnt.pyfiction.pyfiction.hexagonal_obstruction_layout, c: mnt.pyfiction.pyfiction.offset_coordinate) bool
- obstruct_connection(self: mnt.pyfiction.pyfiction.hexagonal_obstruction_layout, src: mnt.pyfiction.pyfiction.offset_coordinate, tgt: mnt.pyfiction.pyfiction.offset_coordinate) None
- obstruct_coordinate(self: mnt.pyfiction.pyfiction.hexagonal_obstruction_layout, c: mnt.pyfiction.pyfiction.offset_coordinate) None