Gate-level Layout
The gate-level layout can be layered on top of any clocked layout type at compile time to extend its functionality by a notion of gates that can be assigned to its clock zones. Each gate is identified as a Boolean function. Thereby, this layout type is technology-independent and does not have any concrete implementation, structures, or shapes assigned to its gates. Even the sizes of the clock zones (tiles) are not determined. Consequently, this layout type is best suited for logic-level placement and routing and can be considered fiction‘s most important core data type.
The gate-level layout is implemented in accordance with mockturtle
‘s
network interface API. Thus, it is itself a mockturtle
network that can be passed to various of mockturtle’s algorithms. However, since each logic node (gate) in the layout
has to have a concrete position assigned, mockturtle cannot be used to generate valid layouts.
Header: fiction/layouts/gate_level_layout.hpp
-
template<typename ClockedLayout>
class gate_level_layout : public ClockedLayout A layout type to layer on top of a clocked layout that allows the assignment of gates to clock zones (aka tiles in this context). This class represents a gate-level FCN layout and, thus, adds a notion of Boolean logic. The gate_level_layout class fulfills the requirements of a
mockturtle
logic network so that it can be used in many ofmockturtle
’s algorithms. Since a layout has to assign fixed positions to its gates (logic nodes), most generative member functions likecreate_pi
,create_po
,create_and
, etc. require additional coordinate parameters. Consequently,mockturtle
’s algorithms cannot be used to generate gate_level_layout networks. To make the class compliant with the API anyways, these member functions have their parameters defaulted but they are, in fact required to create meaningful layouts.The following notion is utilized in this implementation:
a node
n
is an index representing then
th created gate. All properties of said gate, e.g., its type and position, are stored independently and can be requested from the layout. An empty layout has 2 nodes, namelyconst0
andconst1
as required bymockturtle
. At the moment, they are not used for anything meaningful but could be.a signal is an unsigned integer representation of a
tile
, i.e., a coordinate in the layout. It can be seen as a pointer to a position. Consequently, the utilized coordinates need to be convertible touint64_t
.the creation of PIs and POs creates nodes (the latter in contrast to other
mockturtle
networks) that have a position on the layout.the creation of buffers (
create_buf
) creates nodes as well. A buffer with more than one output is a fanout such thatis_fanout
will returntrue
on it. However, it is also still a buffer (is_buf
returnstrue
as well). Buffers and wires are used interchangeably.each node has an associated gate function. PIs, POs, and buffers compute the identity function.
signals (pointers to tiles) cannot be inverting. Thereby, inverter nodes (gates) have to be created that can be checked for via is_inv.
each
create_...
function requires a tile parameter that determines its placement. If the provided tile is dead, the location will not be stored and the node will not count towards number of gates or wires.a node can be overwritten by creating another node on its location. This can, however, lead to unwanted effects and should be avoided.
nodes can be moved via the
move_node
function. This function can also be used to update their children, i.e., incoming signals.
Most implementation details regarding
mockturtle
-specific functions are borrowed frommockturtle/networks/klut.hpp
. Therefore,mockturtle
API functions are only sporadically documented where their behavior might differ. Information on their functionality can be found inmockturtle
’s docs.- Template Parameters:
ClockedLayout – The clocked layout that is to be extended by gate functions.
Public Types
-
using gate_level_layout_storage = mockturtle::storage<gate_level_layout_storage_node, gate_level_layout_storage_data<node, signal>>
tile-based layout storage container
Public Functions
-
inline explicit gate_level_layout(const typename ClockedLayout::aspect_ratio &ar = {}, const std::string &name = {})
Standard constructor. Creates a named gate-level layout of the given aspect ratio. To this end, it calls
ClockedLayout
’s standard constructor.- Parameters:
ar – Highest possible position in the layout.
name – Layout name.
-
inline gate_level_layout(const typename ClockedLayout::aspect_ratio &ar, const clocking_scheme<tile> &scheme, const std::string &name = {})
Standard constructor. Creates a gate-level layout of the given aspect ratio and clocks it via the given clocking scheme. To this end, it calls
ClockedLayout
’s standard constructor.- Parameters:
ar – Highest possible position in the layout.
scheme – Clocking scheme to apply to this layout.
name – Layout name.
-
inline explicit gate_level_layout(storage s)
Copy constructor from another layout’s storage.
- Parameters:
s – Storage of another gate_level_layout.
-
inline gate_level_layout(storage s, event_storage e)
Copy constructor from another layout’s storage.
- Parameters:
s – Storage of another gate_level_layout.
e – Event storage of another gate_level_layout.
-
inline explicit gate_level_layout(const ClockedLayout &lyt)
Copy constructor from another
ClockedLayout
.- Parameters:
lyt – Clocked layout.
-
inline gate_level_layout clone() const noexcept
Clones the layout returning a deep copy.
- Returns:
Deep copy of the layout.
-
inline bool is_pi_tile(const tile &t) const noexcept
Check whether tile
t
hosts a primary input.- Parameters:
t – Tile to be checked.
- Returns:
true
iff the node located at tilet
is a PI.
-
inline bool is_po_tile(const tile &t) const noexcept
Check whether tile
t
hosts a primary output.- Parameters:
t – Tile to be checked.
- Returns:
true
iff the node located at tilet
is a PO.
-
inline auto size() const noexcept
Does NOT return the layout dimensions but the number of nodes (including constants and dead ones) in accordance with the
mockturtle
API.- Returns:
Number of all nodes.
-
inline auto num_gates() const noexcept
Returns the number of placed nodes in the layout that do not compute the identity function.
- Returns:
Number of gates in the layout.
-
inline auto num_wires() const noexcept
Returns the number of placed nodes in the layout that compute the identity function including PIs and POs.
- Returns:
Number of wires in the layout.
-
inline auto num_crossings() const noexcept
Returns the number of placed nodes in the layout that compute the identity function and cross other nodes.
- Returns:
Number of crossings in the layout.
-
inline bool is_empty() const noexcept
Checks whether there are no gates or wires assigned to the layout’s coordinates.
- Returns:
true
iff the layout is empty.
-
template<bool RespectClocking = true>
inline auto fanin_size(const node n) const Returns the number of incoming, adjacently placed, and properly clocked signals to the given node.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
n – Node to check.
- Returns:
Number of fanins to
n
.
-
template<bool RespectClocking = true>
inline auto fanout_size(const node n) const Returns the number of outgoing, adjacently placed, and properly clocked signals of the given node.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
n – Node to check.
- Returns:
Number of fanouts to
n
.
-
inline node get_node(const signal &s) const noexcept
Fetches the node that is placed onto a tile pointed to by a given signal. If no node is placed there, the
const0
node is returned.- Parameters:
s – Pointer to a tile.
- Returns:
Node at position
t
wheres
points att
; or 0 if no node is placed att
.
-
inline node get_node(const tile &t) const noexcept
Fetches the node that is placed onto the provided tile If no node is placed there, the
const0
node is returned.- Parameters:
t – Tile in the layout.
- Returns:
Node at position
t
; or 0 if no node is placed att
.
-
inline tile get_tile(const node n) const noexcept
The inverse function of
get_node
. Fetches the tile that the provided node is placed on. Returns a default dead tile if the node is not placed.- Parameters:
n – Node whose location is desired.
- Returns:
Tile at which
n
is placed or a default dead tile ifn
is not placed.
-
inline bool is_dead(const node n) const noexcept
Checks whether a node (not its assigned tile) is dead. Nodes can be dead for a variety of reasons. For instance if they are dangling (see the
mockturtle
API). In this layout type, nodes are also marked dead when they are not assigned to a tile (which is considered equivalent to dangling).- Parameters:
n – Node to check for liveliness.
- Returns:
true
iffn
is dead.
-
inline signal make_signal(const node n) const noexcept
Invokes the same behavior as
get_tile(n)
but additionally casts the return value to a signal. That is, this function returns the signal representation of the tile that the noden
is assigned to.- Parameters:
n – Node whose signal is desired.
- Returns:
Signal that points to
n
.
-
inline signal move_node(const node n, const tile &t, const std::vector<signal> &new_children = {}) noexcept
Moves a given node to a new position and also updates its children, i.e., incoming signals.
- Parameters:
n – Node to move.
t – Tile to move
n
to.new_children – New incoming signals to
n
.
- Returns:
Signal pointing to
n
’s new tile.
-
inline signal connect(const signal &s, const node n) noexcept
Connects the given signal
s
to the given noden
as a child. The new childs
is appended at the end ofn
’s list of children. Thus, if the order of children is important,move_node()
should be used instead. Otherwise, this function has a smaller overhead and is to be preferred.- Parameters:
s – New incoming signal to
n
.n – Node that should add
s
as its child.
- Returns:
Signal pointing to
n
.
-
inline void clear_tile(const tile &t) noexcept
Removes all assigned nodes from the given tile and marks them as dead.
Note
This function does not reduce the number of nodes in the layout nor does it reduce the number of PIs that are being returned via
num_pis()
even if the tile to clear is an input tile. However, the number of POs is reduced if the tile to clear is an output tile. While this seems counter-intuitive and inconsistent, it is in line with mockturtle’s understanding of nodes and primary outputs.- Parameters:
t – Tile whose nodes are to be removed.
-
inline bool is_complemented(const signal &s) const noexcept
Necessary function in the
mockturtle
API. However, in this layout type, signals cannot be complemented.- Parameters:
s – Signal to check.
- Returns:
false
.
-
inline bool is_gate(const node n) const noexcept
Returns whether a given node is a gate in accordance with
mockturtle
’s definition, i.e., whether it not a constant and not a PI. Thereby, any wire/buffer (including POs) is a gate if this function is used to check for it. This poses an inconsistency but is required to comply with certainmockturtle
algorithms.- Parameters:
n – Node to check.
- Returns:
true
iffn
is neither a constant nor a PI.
-
inline bool is_buf(const node n) const noexcept
Returns whether
n
computes the identity function.- Parameters:
n – Node to check.
- Returns:
true
iffn
computes the identity.
-
inline bool is_wire(const node n) const noexcept
Equivalent to
is_buf
.
-
inline bool is_inv(const node n) const noexcept
Returns whether
n
computes the binary inversion (NOT gate).- Parameters:
n – Node to check.
- Returns:
true
iffn
is a NOT gate.
-
inline bool is_fanout(const node n) const noexcept
Returns whether
n
is a wire and has multiple outputs, thereby, acting as a fanout gate. Note that a fanout will returntrue
for bothis_wire
andis_fanout
.- Parameters:
n – Node to check.
- Returns:
true
iffn
is a fanout gate.
-
inline bool is_function(const node n) const
Returns whether
n
oden
computes a function. That is, this function returnstrue
iffn
is not a constant.- Parameters:
n – Node to check.
- Returns:
true
iffn
is not a constant.
-
inline bool is_gate_tile(const tile &t) const noexcept
Returns whether the node assigned to
t
fulfillsis_gate
(in accordance withmockturtle
’s definition of gates).- Parameters:
t – Tile to check.
- Returns:
true
ifft
hosts a node that is a neither a constant nor a PI.
-
inline bool is_wire_tile(const tile &t) const noexcept
Returns whether the node assigned to
t
fulfillsis_wire
.- Parameters:
t – Tile to check.
- Returns:
true
ifft
hosts a node that computes the identity.
-
inline bool is_empty_tile(const tile &t) const noexcept
Returns whether
t
does not have a node assigned to it.- Parameters:
t – Tile to check.
- Returns:
true
ifft
is an empty tile.
-
template<typename Fn>
inline void foreach_pi(Fn &&fn) const Applies a function to all primary input nodes (including dead ones) in the layout.
- Template Parameters:
Fn – Functor type that has to comply with the restrictions imposed by
mockturtle::foreach_element_transform
.- Parameters:
fn – Functor to apply to each primary input node.
-
template<typename Fn>
inline void foreach_po(Fn &&fn) const Applies a function to all primary output signals (including those that point to dead nodes) in the layout. Note the difference to
foreach_pi
in the signature offn
. This function applies to all POs as signals whereasforeach_pi
applies to all PIs as nodes. This is with respect tomockturtle
’s API.- Template Parameters:
Fn – Functor type that has to comply with the restrictions imposed by
mockturtle::foreach_element_transform
.- Parameters:
fn – Functor to apply to each primary output signal.
-
template<typename Fn>
inline void foreach_node(Fn &&fn) const Applies a function to all nodes (excluding dead ones) in the layout.
- Template Parameters:
Fn – Functor type that has to comply with the restrictions imposed by
mockturtle::foreach_element_if
.- Parameters:
fn – Functor to apply to each node that is not dead.
-
template<typename Fn>
inline void foreach_gate(Fn &&fn) const Applies a function to all gates (excluding dead ones) in the layout. Uses
is_gate
to check whether a node is a gate.- Template Parameters:
Fn – Functor type that has to comply with the restrictions imposed by
mockturtle::foreach_element_if
.- Parameters:
fn – Functor to apply to each gate that is not dead.
-
template<typename Fn>
inline void foreach_wire(Fn &&fn) const Applies a function to all wires (excluding dead ones) in the layout. Uses
is_wire
to check whether a node is a wire.- Template Parameters:
Fn – Functor type that has to comply with the restrictions imposed by
mockturtle::foreach_element_if
.- Parameters:
fn – Functor to apply to each wire that is not dead.
-
template<typename Fn, bool RespectClocking = true>
inline void foreach_fanin(const node n, Fn &&fn) const Applies a function to all nodes that are incoming to a given one. Thereby, only incoming clocked zones (+/- one layer to include crossings) are being considered whose data flow connections are respectively established. That is, the given function is applied to all nodes that are connected to the one assigned to
t
as fanins on neighboring tiles.- Template Parameters:
Fn – Functor type that has to comply with the restrictions imposed by
mockturtle::foreach_element_transform
.RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
n – Node whose fanins are desired.
fn – Functor to apply to each of
n
’s fanins.
-
template<bool RespectClocking = true>
inline auto incoming_data_flow(const tile &t) const noexcept Returns a container that contains all tiles that feed information to the given one. Thereby, only incoming clocked zones (+/- one layer to include crossings) are being considered whose data flow connections are respectively established. That is, the returned container contains all tiles that host nodes that are connected to the one assigned to
t
as fanins.- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Tile whose incoming data flow ones are desired.
- Returns:
A container that contains all of
t
’s incoming data flow tiles.
-
template<typename Fn, bool RespectClocking = true>
inline void foreach_fanout(const node n, Fn &&fn) const Applies a function to all nodes that are outgoing from a given one. Thereby, only outgoing clocked zones (+/- one layer to include crossings) are being considered whose data flow connections are respectively established. That is, the given function is applied to all nodes that are connected to the one assigned to
t
as fanouts on neighboring tiles.- Template Parameters:
Fn – Functor type that has to comply with the restrictions imposed by
mockturtle::foreach_element_transform
.RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
n – Node whose fanouts are desired.
fn – Functor to apply to each of
n
’s fanouts.
-
template<bool RespectClocking = true>
inline auto outgoing_data_flow(const tile &t) const noexcept Returns a container that contains all tiles that accept information from the given one. Thereby, only outgoing clocked zones (+/- one layer to include crossings) are being considered whose data flow connections are respectively established. That is, the returned container contains all tiles that host nodes that are connected to the one assigned to
t
as fanouts.- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Tile whose outgoing data flow ones are desired.
- Returns:
A container that contains all of
t
’s outgoing data flow tiles.
-
template<bool RespectClocking = true>
inline bool is_incoming_signal(const tile &t, const signal &s) const noexcept Checks whether signal
s
is incoming to tilet
. That is, whether tilet
hosts a node that has a fanin assigned to the tile that signals
points to.- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Base tile.
s – Signal pointing to a potential incoming tile to
t
.
- Returns:
true
iffs
is incoming tot
.
-
template<bool RespectClocking = true>
inline bool has_northern_incoming_signal(const tile &t) const noexcept Checks whether the given tile has an incoming one in northern direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Base tile.
- Returns:
true
iffnorth(t)
is incoming tot
.
-
template<bool RespectClocking = true>
inline bool has_north_eastern_incoming_signal(const tile &t) const noexcept Checks whether the given tile has an incoming one in north-eastern direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Base tile.
- Returns:
true
iffnorth_east(t)
is incoming tot
.
-
template<bool RespectClocking = true>
inline bool has_eastern_incoming_signal(const tile &t) const noexcept Checks whether the given tile has an incoming one in eastern direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Base tile.
- Returns:
true
iffeast(t)
is incoming tot
.
-
template<bool RespectClocking = true>
inline bool has_south_eastern_incoming_signal(const tile &t) const noexcept Checks whether the given tile has an incoming one in south-eastern direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Base tile.
- Returns:
true
iffsouth_east(t)
is incoming tot
.
-
template<bool RespectClocking = true>
inline bool has_southern_incoming_signal(const tile &t) const noexcept Checks whether the given tile has an incoming one in southern direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Base tile.
- Returns:
true
iffsouth(t)
is incoming tot
.
-
template<bool RespectClocking = true>
inline bool has_south_western_incoming_signal(const tile &t) const noexcept Checks whether the given tile has an incoming one in south-western direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Base tile.
- Returns:
true
iffsouth_west(t)
is incoming tot
.
-
template<bool RespectClocking = true>
inline bool has_western_incoming_signal(const tile &t) const noexcept Checks whether the given tile has an incoming one in western direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Base tile.
- Returns:
true
iffwest(t)
is incoming tot
.
-
template<bool RespectClocking = true>
inline bool has_north_western_incoming_signal(const tile &t) const noexcept Checks whether the given tile has an incoming one in north-western direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Base tile.
- Returns:
true
iffnorth_west(t)
is incoming tot
.
-
template<bool RespectClocking = true>
inline bool has_no_incoming_signal(const tile &t) const noexcept Checks whether the given tile has no incoming tiles.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameters:
t – Base tile.
- Returns:
true
ifft
does not have incoming tiles.
-
template<bool RespectClocking = true>
inline bool is_outgoing_signal(const tile &t, const signal &s) const noexcept Checks whether signal
s
is outgoing from tilet
. That is, whether tilet
hosts a node that has a fanout assigned to the tile that signals
points to.- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Base tile.
s – Signal pointing to a potential outgoing tile of
t
.
- Returns:
true
iffs
is outgoing fromt
.
-
template<bool RespectClocking = true>
inline bool has_northern_outgoing_signal(const tile &t) const noexcept Checks whether the given tile has an outgoing one in northern direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Base tile.
- Returns:
true
iffnorth(t)
is outgoing fromt
.
-
template<bool RespectClocking = true>
inline bool has_north_eastern_outgoing_signal(const tile &t) const noexcept Checks whether the given tile has an outgoing one in north-eastern direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Base tile.
- Returns:
true
iffnorth_east(t)
is outgoing fromt
.
-
template<bool RespectClocking = true>
inline bool has_eastern_outgoing_signal(const tile &t) const noexcept Checks whether the given tile has an outgoing one in eastern direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Base tile.
- Returns:
true
iffeast(t)
is outgoing fromt
.
-
template<bool RespectClocking = true>
inline bool has_south_eastern_outgoing_signal(const tile &t) const noexcept Checks whether the given tile has an outgoing one in south-eastern direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Base tile.
- Returns:
true
iffsouth_east(t)
is outgoing fromt
.
-
template<bool RespectClocking = true>
inline bool has_southern_outgoing_signal(const tile &t) const noexcept Checks whether the given tile has an outgoing one in southern direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Base tile.
- Returns:
true
iffsouth(t)
is outgoing fromt
.
-
template<bool RespectClocking = true>
inline bool has_south_western_outgoing_signal(const tile &t) const noexcept Checks whether the given tile has an outgoing one in south-western direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Base tile.
- Returns:
true
iffsouth_west(t)
is outgoing fromt
.
-
template<bool RespectClocking = true>
inline bool has_western_outgoing_signal(const tile &t) const noexcept Checks whether the given tile has an outgoing one in western direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Base tile.
- Returns:
true
iffwest(t)
is outgoing fromt
.
-
template<bool RespectClocking = true>
inline bool has_north_western_outgoing_signal(const tile &t) const noexcept Checks whether the given tile has an outgoing one in north-western direction.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Base tile.
- Returns:
true
iffnorth_west(t)
is outgoing fromt
.
-
template<bool RespectClocking = true>
inline bool has_no_outgoing_signal(const tile &t) const noexcept Checks whether the given tile has no outgoing tiles.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameters:
t – Base tile.
- Returns:
true
ifft
does not have outgoing tiles.
-
template<bool RespectClocking = true>
inline bool has_opposite_incoming_and_outgoing_signals(const tile &t) const noexcept Checks whether the given tile
t
has its incoming and outgoing signals on opposite sides of the tile. For this purpose, the function relies onforeach_adjacent_opposite_coordinates
of the underlyingClockedLayout
.This function is very helpful for many gate libraries to check for (non-)straight gates, which might look different.
- Template Parameters:
RespectClocking – Flag to indicate that the underlying clocking is to be respected when evaluating fanins and fanouts.
- Parameters:
t – Base tile.
- Returns:
true
ifft
has incoming and outgoing signals on opposite sides.
-
template<typename Node, typename Tile>
struct gate_level_layout_storage_data
-
struct gate_level_layout_storage_node : public mockturtle::mixed_fanin_node<2>
gate-level layout node
data[0].h1
: Internal (data-flow independent) fan-out size (MSB indicates dead nodes)data[0].h2
: Application-specific valuedata[1].h1
: Function literal in truth table cachedata[2].h2
: Visited flags
- class mnt.pyfiction.cartesian_gate_layout
A layout type to layer on top of a clocked layout that allows the assignment of gates to clock zones (aka tiles in this context). This class represents a gate-level FCN layout and, thus, adds a notion of Boolean logic. The gate_level_layout class fulfills the requirements of a mockturtle logic network so that it can be used in many of mockturtle’s algorithms. Since a layout has to assign fixed positions to its gates (logic nodes), most generative member functions like create_pi, create_po, create_and, etc. require additional coordinate parameters. Consequently, mockturtle’s algorithms cannot be used to generate gate_level_layout networks. To make the class compliant with the API anyways, these member functions have their parameters defaulted but they are, in fact required to create meaningful layouts.
The following notion is utilized in this implementation: - a node n is an index representing the n`th created gate. All properties of said gate, e.g., its type and position, are stored independently and can be requested from the layout. An empty layout has 2 nodes, namely `const0 and const1 as required by mockturtle. At the moment, they are not used for anything meaningful but could be.
a signal is an unsigned integer representation of a tile, i.e., a
coordinate in the layout. It can be seen as a pointer to a position. Consequently, the utilized coordinates need to be convertible to uint64_t.
the creation of PIs and POs creates nodes (the latter in contrast to
other mockturtle networks) that have a position on the layout.
the creation of buffers (create_buf) creates nodes as well. A
buffer with more than one output is a fanout such that is_fanout will return true on it. However, it is also still a buffer (is_buf returns true as well). Buffers and wires are used interchangeably.
each node has an associated gate function. PIs, POs, and buffers
compute the identity function.
signals (pointers to tiles) cannot be inverting. Thereby, inverter
nodes (gates) have to be created that can be checked for via is_inv.
each create_… function requires a tile parameter that determines
its placement. If the provided tile is dead, the location will not be stored and the node will not count towards number of gates or wires.
a node can be overwritten by creating another node on its location.
This can, however, lead to unwanted effects and should be avoided.
nodes can be moved via the move_node function. This function can
also be used to update their children, i.e., incoming signals.
Most implementation details regarding mockturtle-specific functions are borrowed from mockturtle/networks/klut.hpp. Therefore, mockturtle API functions are only sporadically documented where their behavior might differ. Information on their functionality can be found in mockturtle’s docs.
- Template parameter
ClockedLayout
: The clocked layout that is to be extended by gate functions.
- bounding_box_2d(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) tuple[mnt.pyfiction.pyfiction.offset_coordinate, mnt.pyfiction.pyfiction.offset_coordinate]
Returns the minimum and maximum corner of the bounding box. A 2D bounding box object computes a minimum-sized box around all non-empty coordinates in a given layout. Layouts can be of arbitrary size and, thus, may be larger than their contained elements. Sometimes, it might be necessary to know exactly which space the associated layout internals occupy. A bounding box computes coordinates that span a minimum-sized rectangle that encloses all non- empty layout coordinates.
- Returns:
The minimum and maximum enclosing coordinate in the associated layout.
- clear_tile(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) None
Removes all assigned nodes from the given tile and marks them as dead.
@note This function does not reduce the number of nodes in the layout nor does it reduce the number of PIs that are being returned via num_pis() even if the tile to clear is an input tile. However, the number of POs is reduced if the tile to clear is an output tile. While this seems counter-intuitive and inconsistent, it is in line with mockturtle’s understanding of nodes and primary outputs.
- Parameter
t
: Tile whose nodes are to be removed.
- Parameter
- create_and(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_buf(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_ge(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_gt(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_le(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_lt(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_maj(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, c: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_nand(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_nor(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_not(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_or(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_pi(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, name: str = '', t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_po(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, s: SupportsInt, name: str = '', t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_xnor(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_xor(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- fanin_size(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, n: SupportsInt) int
Returns the number of incoming, adjacently placed, and properly clocked signals to the given node.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
n
: Node to check.
- Returns:
Number of fanins to n.
- Template parameter
- fanins(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) list[mnt.pyfiction.pyfiction.offset_coordinate]
- fanout_size(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, n: SupportsInt) int
Returns the number of outgoing, adjacently placed, and properly clocked signals of the given node.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
n
: Node to check.
- Returns:
Number of fanouts to n.
- Template parameter
- fanouts(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) list[mnt.pyfiction.pyfiction.offset_coordinate]
- gates(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) list[mnt.pyfiction.pyfiction.offset_coordinate]
- get_input_name(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, index: SupportsInt) str
- get_layout_name(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) str
- get_name(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, s: SupportsInt) str
- get_node(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) int
Fetches the node that is placed onto a tile pointed to by a given signal. If no node is placed there, the const0 node is returned.
- Parameter
s
: Pointer to a tile.
- Returns:
Node at position t where s points at t; or 0 if no node is placed at t.
- Parameter
- get_output_name(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, index: SupportsInt) str
- get_tile(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, n: SupportsInt) mnt.pyfiction.pyfiction.offset_coordinate
The inverse function of get_node. Fetches the tile that the provided node is placed on. Returns a default dead tile if the node is not placed.
- Parameter
n
: Node whose location is desired.
- Returns:
Tile at which n is placed or a default dead tile if n is not placed.
- Parameter
- has_eastern_incoming_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff east(t) is incoming to t.
- Template parameter
- has_eastern_outgoing_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff east(t) is outgoing from t.
- Template parameter
- has_no_incoming_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has no incoming tiles.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff t does not have incoming tiles.
- Template parameter
- has_no_outgoing_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has no outgoing tiles.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff t does not have outgoing tiles.
- Template parameter
- has_north_eastern_incoming_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in north-eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff north_east(t) is incoming to t.
- Template parameter
- has_north_eastern_outgoing_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in north-eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff north_east(t) is outgoing from t.
- Template parameter
- has_north_western_incoming_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in north-western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff north_west(t) is incoming to t.
- Template parameter
- has_north_western_outgoing_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in north-western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff north_west(t) is outgoing from t.
- Template parameter
- has_northern_incoming_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in northern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff north(t) is incoming to t.
- Template parameter
- has_northern_outgoing_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in northern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff north(t) is outgoing from t.
- Template parameter
- has_south_eastern_incoming_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in south-eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff south_east(t) is incoming to t.
- Template parameter
- has_south_eastern_outgoing_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in south-eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff south_east(t) is outgoing from t.
- Template parameter
- has_south_western_incoming_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in south-western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff south_west(t) is incoming to t.
- Template parameter
- has_south_western_outgoing_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in south-western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff south_west(t) is outgoing from t.
- Template parameter
- has_southern_incoming_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in southern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff south(t) is incoming to t.
- Template parameter
- has_southern_outgoing_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in southern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff south(t) is outgoing from t.
- Template parameter
- has_western_incoming_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff west(t) is incoming to t.
- Template parameter
- has_western_outgoing_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff west(t) is outgoing from t.
- Template parameter
- is_and(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- is_dead(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, n: SupportsInt) bool
Checks whether a node (not its assigned tile) is dead. Nodes can be dead for a variety of reasons. For instance if they are dangling (see the mockturtle API). In this layout type, nodes are also marked dead when they are not assigned to a tile (which is considered equivalent to dangling).
- Parameter
n
: Node to check for liveliness.
- Returns:
true iff n is dead.
- Parameter
- is_empty(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) bool
Checks whether there are no gates or wires assigned to the layout’s coordinates.
- Returns:
true iff the layout is empty.
- is_empty_tile(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Returns whether t does not have a node assigned to it.
- Parameter
t
: Tile to check.
- Returns:
true iff t is an empty tile.
- Parameter
- is_fanout(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
Returns whether n is a wire and has multiple outputs, thereby, acting as a fanout gate. Note that a fanout will return true for both is_wire and is_fanout.
- Parameter
n
: Node to check.
- Returns:
true iff n is a fanout gate.
- Parameter
- is_gate_tile(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Returns whether the node assigned to t fulfills is_gate (in accordance with mockturtle’s definition of gates).
- Parameter
t
: Tile to check.
- Returns:
true iff t hosts a node that is a neither a constant nor a PI.
- Parameter
- is_ge(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- is_gt(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- is_incoming_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate, s: SupportsInt) bool
Checks whether signal s is incoming to tile t. That is, whether tile t hosts a node that has a fanin assigned to the tile that signal s points to.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Parameter
s
: Signal pointing to a potential incoming tile to t.
- Returns:
true iff s is incoming to t.
- Template parameter
- is_inv(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
Returns whether n computes the binary inversion (NOT gate).
- Parameter
n
: Node to check.
- Returns:
true iff n is a NOT gate.
- Parameter
- is_le(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- is_lt(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- is_maj(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- is_nand(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- is_nor(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- is_or(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- is_outgoing_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate, s: SupportsInt) bool
Checks whether signal s is outgoing from tile t. That is, whether tile t hosts a node that has a fanout assigned to the tile that signal s points to.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Parameter
s
: Signal pointing to a potential outgoing tile of t.
- Returns:
true iff s is outgoing from t.
- Template parameter
- is_pi(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, n: SupportsInt) bool
- is_pi_tile(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Check whether tile t hosts a primary input.
- Parameter
t
: Tile to be checked.
- Returns:
true iff the node located at tile t is a PI.
- Parameter
- is_po(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, n: SupportsInt) bool
- is_po_tile(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Check whether tile t hosts a primary output.
- Parameter
t
: Tile to be checked.
- Returns:
true iff the node located at tile t is a PO.
- Parameter
- is_wire(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
Equivalent to is_buf.
- is_wire_tile(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Returns whether the node assigned to t fulfills is_wire.
- Parameter
t
: Tile to check.
- Returns:
true iff t hosts a node that computes the identity.
- Parameter
- is_xnor(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- is_xor(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, arg0: SupportsInt) bool
- make_signal(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, n: SupportsInt) int
Invokes the same behavior as get_tile(n) but additionally casts the return value to a signal. That is, this function returns the signal representation of the tile that the node n is assigned to.
- Parameter
n
: Node whose signal is desired.
- Returns:
Signal that points to n.
- Parameter
- move_node(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, n: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate, new_children: collections.abc.Sequence[SupportsInt] = []) int
Moves a given node to a new position and also updates its children, i.e., incoming signals.
- Parameter
n
: Node to move.
- Parameter
t
: Tile to move n to.
- Parameter
new_children
: New incoming signals to n.
- Returns:
Signal pointing to n’s new tile.
- Parameter
- num_crossings(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) int
Returns the number of placed nodes in the layout that compute the identity function and cross other nodes.
- Returns:
Number of crossings in the layout.
- num_gates(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) int
Returns the number of placed nodes in the layout that do not compute the identity function.
- Returns:
Number of gates in the layout.
- num_pis(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) int
- num_pos(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) int
- num_wires(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) int
Returns the number of placed nodes in the layout that compute the identity function including PIs and POs.
- Returns:
Number of wires in the layout.
- pis(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) list[mnt.pyfiction.pyfiction.offset_coordinate]
- pos(self: mnt.pyfiction.pyfiction.cartesian_gate_layout) list[mnt.pyfiction.pyfiction.offset_coordinate]
- set_input_name(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, index: SupportsInt, name: str) None
- set_layout_name(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, name: str) None
- set_output_name(self: mnt.pyfiction.pyfiction.cartesian_gate_layout, index: SupportsInt, name: str) None
- class mnt.pyfiction.hexagonal_gate_layout
A layout type to layer on top of a clocked layout that allows the assignment of gates to clock zones (aka tiles in this context). This class represents a gate-level FCN layout and, thus, adds a notion of Boolean logic. The gate_level_layout class fulfills the requirements of a mockturtle logic network so that it can be used in many of mockturtle’s algorithms. Since a layout has to assign fixed positions to its gates (logic nodes), most generative member functions like create_pi, create_po, create_and, etc. require additional coordinate parameters. Consequently, mockturtle’s algorithms cannot be used to generate gate_level_layout networks. To make the class compliant with the API anyways, these member functions have their parameters defaulted but they are, in fact required to create meaningful layouts.
The following notion is utilized in this implementation: - a node n is an index representing the n`th created gate. All properties of said gate, e.g., its type and position, are stored independently and can be requested from the layout. An empty layout has 2 nodes, namely `const0 and const1 as required by mockturtle. At the moment, they are not used for anything meaningful but could be.
a signal is an unsigned integer representation of a tile, i.e., a
coordinate in the layout. It can be seen as a pointer to a position. Consequently, the utilized coordinates need to be convertible to uint64_t.
the creation of PIs and POs creates nodes (the latter in contrast to
other mockturtle networks) that have a position on the layout.
the creation of buffers (create_buf) creates nodes as well. A
buffer with more than one output is a fanout such that is_fanout will return true on it. However, it is also still a buffer (is_buf returns true as well). Buffers and wires are used interchangeably.
each node has an associated gate function. PIs, POs, and buffers
compute the identity function.
signals (pointers to tiles) cannot be inverting. Thereby, inverter
nodes (gates) have to be created that can be checked for via is_inv.
each create_… function requires a tile parameter that determines
its placement. If the provided tile is dead, the location will not be stored and the node will not count towards number of gates or wires.
a node can be overwritten by creating another node on its location.
This can, however, lead to unwanted effects and should be avoided.
nodes can be moved via the move_node function. This function can
also be used to update their children, i.e., incoming signals.
Most implementation details regarding mockturtle-specific functions are borrowed from mockturtle/networks/klut.hpp. Therefore, mockturtle API functions are only sporadically documented where their behavior might differ. Information on their functionality can be found in mockturtle’s docs.
- Template parameter
ClockedLayout
: The clocked layout that is to be extended by gate functions.
- bounding_box_2d(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) tuple[mnt.pyfiction.pyfiction.offset_coordinate, mnt.pyfiction.pyfiction.offset_coordinate]
Returns the minimum and maximum corner of the bounding box. A 2D bounding box object computes a minimum-sized box around all non-empty coordinates in a given layout. Layouts can be of arbitrary size and, thus, may be larger than their contained elements. Sometimes, it might be necessary to know exactly which space the associated layout internals occupy. A bounding box computes coordinates that span a minimum-sized rectangle that encloses all non- empty layout coordinates.
- Returns:
The minimum and maximum enclosing coordinate in the associated layout.
- clear_tile(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) None
Removes all assigned nodes from the given tile and marks them as dead.
@note This function does not reduce the number of nodes in the layout nor does it reduce the number of PIs that are being returned via num_pis() even if the tile to clear is an input tile. However, the number of POs is reduced if the tile to clear is an output tile. While this seems counter-intuitive and inconsistent, it is in line with mockturtle’s understanding of nodes and primary outputs.
- Parameter
t
: Tile whose nodes are to be removed.
- Parameter
- create_and(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_buf(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_ge(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_gt(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_le(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_lt(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_maj(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, c: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_nand(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_nor(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_not(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_or(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_pi(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, name: str = '', t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_po(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, s: SupportsInt, name: str = '', t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_xnor(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- create_xor(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, a: SupportsInt, b: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate = (0, 0, 0)) int
- fanin_size(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, n: SupportsInt) int
Returns the number of incoming, adjacently placed, and properly clocked signals to the given node.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
n
: Node to check.
- Returns:
Number of fanins to n.
- Template parameter
- fanins(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) list[mnt.pyfiction.pyfiction.offset_coordinate]
- fanout_size(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, n: SupportsInt) int
Returns the number of outgoing, adjacently placed, and properly clocked signals of the given node.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
n
: Node to check.
- Returns:
Number of fanouts to n.
- Template parameter
- fanouts(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) list[mnt.pyfiction.pyfiction.offset_coordinate]
- gates(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) list[mnt.pyfiction.pyfiction.offset_coordinate]
- get_input_name(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, index: SupportsInt) str
- get_layout_name(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) str
- get_name(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, s: SupportsInt) str
- get_node(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) int
Fetches the node that is placed onto a tile pointed to by a given signal. If no node is placed there, the const0 node is returned.
- Parameter
s
: Pointer to a tile.
- Returns:
Node at position t where s points at t; or 0 if no node is placed at t.
- Parameter
- get_output_name(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, index: SupportsInt) str
- get_tile(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, n: SupportsInt) mnt.pyfiction.pyfiction.offset_coordinate
The inverse function of get_node. Fetches the tile that the provided node is placed on. Returns a default dead tile if the node is not placed.
- Parameter
n
: Node whose location is desired.
- Returns:
Tile at which n is placed or a default dead tile if n is not placed.
- Parameter
- has_eastern_incoming_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff east(t) is incoming to t.
- Template parameter
- has_eastern_outgoing_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff east(t) is outgoing from t.
- Template parameter
- has_no_incoming_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has no incoming tiles.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff t does not have incoming tiles.
- Template parameter
- has_no_outgoing_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has no outgoing tiles.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff t does not have outgoing tiles.
- Template parameter
- has_north_eastern_incoming_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in north-eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff north_east(t) is incoming to t.
- Template parameter
- has_north_eastern_outgoing_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in north-eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff north_east(t) is outgoing from t.
- Template parameter
- has_north_western_incoming_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in north-western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff north_west(t) is incoming to t.
- Template parameter
- has_north_western_outgoing_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in north-western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff north_west(t) is outgoing from t.
- Template parameter
- has_northern_incoming_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in northern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff north(t) is incoming to t.
- Template parameter
- has_northern_outgoing_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in northern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff north(t) is outgoing from t.
- Template parameter
- has_south_eastern_incoming_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in south-eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff south_east(t) is incoming to t.
- Template parameter
- has_south_eastern_outgoing_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in south-eastern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff south_east(t) is outgoing from t.
- Template parameter
- has_south_western_incoming_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in south-western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff south_west(t) is incoming to t.
- Template parameter
- has_south_western_outgoing_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in south-western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff south_west(t) is outgoing from t.
- Template parameter
- has_southern_incoming_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in southern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff south(t) is incoming to t.
- Template parameter
- has_southern_outgoing_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in southern direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff south(t) is outgoing from t.
- Template parameter
- has_western_incoming_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an incoming one in western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Returns:
true iff west(t) is incoming to t.
- Template parameter
- has_western_outgoing_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Checks whether the given tile has an outgoing one in western direction.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Returns:
true iff west(t) is outgoing from t.
- Template parameter
- is_and(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- is_dead(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, n: SupportsInt) bool
Checks whether a node (not its assigned tile) is dead. Nodes can be dead for a variety of reasons. For instance if they are dangling (see the mockturtle API). In this layout type, nodes are also marked dead when they are not assigned to a tile (which is considered equivalent to dangling).
- Parameter
n
: Node to check for liveliness.
- Returns:
true iff n is dead.
- Parameter
- is_empty(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) bool
Checks whether there are no gates or wires assigned to the layout’s coordinates.
- Returns:
true iff the layout is empty.
- is_empty_tile(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Returns whether t does not have a node assigned to it.
- Parameter
t
: Tile to check.
- Returns:
true iff t is an empty tile.
- Parameter
- is_fanout(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
Returns whether n is a wire and has multiple outputs, thereby, acting as a fanout gate. Note that a fanout will return true for both is_wire and is_fanout.
- Parameter
n
: Node to check.
- Returns:
true iff n is a fanout gate.
- Parameter
- is_gate_tile(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Returns whether the node assigned to t fulfills is_gate (in accordance with mockturtle’s definition of gates).
- Parameter
t
: Tile to check.
- Returns:
true iff t hosts a node that is a neither a constant nor a PI.
- Parameter
- is_ge(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- is_gt(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- is_incoming_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate, s: SupportsInt) bool
Checks whether signal s is incoming to tile t. That is, whether tile t hosts a node that has a fanin assigned to the tile that signal s points to.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanins.
- Parameter
t
: Base tile.
- Parameter
s
: Signal pointing to a potential incoming tile to t.
- Returns:
true iff s is incoming to t.
- Template parameter
- is_inv(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
Returns whether n computes the binary inversion (NOT gate).
- Parameter
n
: Node to check.
- Returns:
true iff n is a NOT gate.
- Parameter
- is_le(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- is_lt(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- is_maj(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- is_nand(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- is_nor(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- is_or(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- is_outgoing_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate, s: SupportsInt) bool
Checks whether signal s is outgoing from tile t. That is, whether tile t hosts a node that has a fanout assigned to the tile that signal s points to.
- Template parameter
RespectClocking
: Flag to indicate that the underlying clocking is to be respected when evaluating fanouts.
- Parameter
t
: Base tile.
- Parameter
s
: Signal pointing to a potential outgoing tile of t.
- Returns:
true iff s is outgoing from t.
- Template parameter
- is_pi(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, n: SupportsInt) bool
- is_pi_tile(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Check whether tile t hosts a primary input.
- Parameter
t
: Tile to be checked.
- Returns:
true iff the node located at tile t is a PI.
- Parameter
- is_po(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, n: SupportsInt) bool
- is_po_tile(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Check whether tile t hosts a primary output.
- Parameter
t
: Tile to be checked.
- Returns:
true iff the node located at tile t is a PO.
- Parameter
- is_wire(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
Equivalent to is_buf.
- is_wire_tile(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, t: mnt.pyfiction.pyfiction.offset_coordinate) bool
Returns whether the node assigned to t fulfills is_wire.
- Parameter
t
: Tile to check.
- Returns:
true iff t hosts a node that computes the identity.
- Parameter
- is_xnor(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- is_xor(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, arg0: SupportsInt) bool
- make_signal(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, n: SupportsInt) int
Invokes the same behavior as get_tile(n) but additionally casts the return value to a signal. That is, this function returns the signal representation of the tile that the node n is assigned to.
- Parameter
n
: Node whose signal is desired.
- Returns:
Signal that points to n.
- Parameter
- move_node(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, n: SupportsInt, t: mnt.pyfiction.pyfiction.offset_coordinate, new_children: collections.abc.Sequence[SupportsInt] = []) int
Moves a given node to a new position and also updates its children, i.e., incoming signals.
- Parameter
n
: Node to move.
- Parameter
t
: Tile to move n to.
- Parameter
new_children
: New incoming signals to n.
- Returns:
Signal pointing to n’s new tile.
- Parameter
- num_crossings(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) int
Returns the number of placed nodes in the layout that compute the identity function and cross other nodes.
- Returns:
Number of crossings in the layout.
- num_gates(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) int
Returns the number of placed nodes in the layout that do not compute the identity function.
- Returns:
Number of gates in the layout.
- num_pis(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) int
- num_pos(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) int
- num_wires(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) int
Returns the number of placed nodes in the layout that compute the identity function including PIs and POs.
- Returns:
Number of wires in the layout.
- pis(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) list[mnt.pyfiction.pyfiction.offset_coordinate]
- pos(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout) list[mnt.pyfiction.pyfiction.offset_coordinate]
- set_input_name(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, index: SupportsInt, name: str) None
- set_layout_name(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, name: str) None
- set_output_name(self: mnt.pyfiction.pyfiction.hexagonal_gate_layout, index: SupportsInt, name: str) None