Views

Views are wrappers around network types that add or change certain functionality. For more information, please refer to the mockturtle documentation.

Edge Color View

Header: fiction/networks/views/edge_color_view.hpp

template<typename Ntk>
class out_of_place_edge_color_view : public mockturtle::out_of_place_color_view<Ntk>

A view that extends mockturtle::out_of_place_color_view such that it can color edges, i.e., tuples of nodes as well.

Template Parameters:

Ntk – mockturtle network type.

Public Functions

inline explicit out_of_place_edge_color_view(const Ntk &ntk)

Standard constructor.

Parameters:

ntk – Network to color.

inline void clear_colors() const

Remove all assigned colors.

inline uint32_t edge_color(const edge &e) const

Returns the assigned color of a given edge.

Parameters:

e – Edge whose color is desired.

Returns:

Color of edge e.

inline void paint_edge(const edge &e) const

Paint a given edge with the current color.

Parameters:

e – Edge to paint.

inline void paint_edge(const edge &e, uint32_t clr) const

Paint a given edge with the given color.

Parameters:
  • e – Edge to paint.

  • clr – Color to paint e with.

inline void paint_edge(const edge &e, const edge &other) const

Paint a given edge with the color of another given edge.

Parameters:
  • e – Edge to paint.

  • other – Edge whose color is to be used to paint e.

template<typename Pred>
inline bool eval_edge_color(const edge &e, Pred &&pred) const

Evaluates a predicate on a given edge’s color.

Template Parameters:

Pred – Predicate type.

Parameters:
  • e – Edge whose color is used as a parameter for pred.

  • pred – Predicate to evaluate on e’s color.

Returns:

Return value of pred(color(e)).

template<typename Pred>
inline bool eval_edge_color(const edge &a, const edge &b, Pred &&pred) const

Evaluates a predicate on two given edges’ colors.

Template Parameters:

Pred – Predicate type.

Parameters:
  • a – Edge whose color is used as the first parameter for pred.

  • b – Edge whose color is used as the second parameter for pred.

  • pred – Predicate to evaluate on a’s and b’s colors.

Returns:

Return value of pred(color(a), color(b)).

Static Depth View

Header: fiction/networks/views/static_depth_view.hpp

template<typename Ntk, typename NodeCostFn = mockturtle::unit_cost<Ntk>, bool has_depth_interface = mockturtle::has_depth_v<Ntk> && mockturtle::has_level_v<Ntk> && mockturtle::has_update_levels_v<Ntk>>
class static_depth_view

Provides depth and level methods for networks, similar to mockturtle::static_depth_view. Unlike the mockturtle implementation, this version uses flat hashmaps to store level data instead of mockturtle::node_map. Additionally, the add_event functionality has been removed. As a result, if the underlying network changes, either on_add has to be called when adding a node to the network and keep the current depth information or the update_levels method must be called to refresh the static_depth_view information. These modifications address performance issues encountered with mockturtle::static_depth_view.

This view computes the level of each node and the overall depth of the network. The level and depth methods adhere to the network interface. Levels are calculated during construction and can be updated later by invoking the update_levels method.

Template Parameters:
  • Ntk – The network type.

  • NodeCostFn – Optional cost function applied to nodes. Default is mockturtle::unit_cost<Ntk>.

  • has_depth_interface – Boolean flag checked compile-time, determines if the provided Ntk supports the depth interface.

Subclassed by fiction::mutable_rank_view< Ntk, false >, fiction::mutable_rank_view< Ntk, true >

Mutable Rank View

Header: fiction/networks/views/mutable_rank_view.hpp

template<class Ntk, bool has_rank_interface = mockturtle::has_rank_position_v<Ntk> && mockturtle::has_at_rank_position_v<Ntk> && mockturtle::has_swap_v<Ntk> && mockturtle::has_width_v<Ntk> && mockturtle::has_foreach_node_in_rank_v<Ntk> && mockturtle::has_foreach_gate_in_rank_v<Ntk>>
class mutable_rank_view