Obstruction Layout

Header: fiction/layouts/obstruction_layout.hpp

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.

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, true> : public Lyt
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 coordinate tgt 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 via obstruct_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 coordinate tgt if the obstruction was manually marked via obstruct_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 iff c 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 from c1 to c2 is obstructed.

struct obstruction_layout_storage