Visualization

Visualization of logic networks and FCN layouts.

Layout Printing

Header: fiction/io/print_layout.hpp

template<typename Lyt>
void fiction::print_gate_level_layout(std::ostream &os, const Lyt &layout, const bool io_color = true, const bool clk_color = false)

Writes a simplified 2D representation of a gate-level layout to an output stream.

Template Parameters:

Lyt – Gate-level layout type.

Parameters:
  • os – Output stream to write into.

  • layout – The gate-level layout to print.

  • io_color – Flag to utilize color escapes for inputs and outputs.

  • clk_color – Flag to utilize color escapes for clock zones.

template<typename Lyt>
void fiction::print_cell_level_layout(std::ostream &os, const Lyt &layout, const bool io_color = true, const bool clk_color = false)

Writes a simplified 2D representation of a cell-level layout to an output stream.

Template Parameters:

Lyt – Cell-level layout type.

Parameters:
  • os – Output stream to write into.

  • layout – The cell-level layout to print.

  • io_color – Flag to utilize color escapes for inputs and outputs.

  • clk_color – Flag to utilize color escapes for clock zones.

template<typename Lyt>
void fiction::print_sidb_layout(std::ostream &os, const Lyt &lyt, const bool lat_color = true, const bool crop_layout = false, const bool draw_lattice = true)

Writes a simplified 2D representation of an SiDB layout (SiDB and defect charges are supported) to an output stream.

Template Parameters:

Lyt – SiDB cell-level layout with charge-information based on SiQAD coordinates or defect-information, e.g., a charge_distribution_surface or sidb_defect_surface.

Parameters:
  • os – Output stream to write into.

  • lyt – The layout of which the information is to be printed.

  • lat_color – Flag to utilize color escapes for the lattice, charge states, and atomic defects.

  • crop_layout – Flag to print the 2D bounding box of the layout, while leaving a maximum padding of one dimer row and two columns.

  • draw_lattice – Flag to enable lattice background drawing.

template<typename Lyt>
void fiction::print_layout(const Lyt &lyt, std::ostream &os = std::cout)

A unified printer of the versions above. Depending on the passed layout type, this function will automatically select the appropriate printer to use. This simplifies printing by enabling the statement print_layout(lyt).

Note

This function will use the respective function’s default settings to print the layout.

Template Parameters:

Lyt – Any coordinate layout type.

Parameters:
  • lyt – The coordinate layout.

  • os – The output stream to write into.

Graphviz (DOT) Drawers

Header: fiction/io/dot_drawers.hpp

template<typename Ntk, bool DrawIndexes = false, bool DrawHexTT = false>
class technology_dot_drawer : public mockturtle::gate_dot_drawer<Ntk>

A DOT drawer that extends mockturtle’s one by several additional gate types.

Template Parameters:
  • Ntk – Logic network type.

  • DrawIndexes – Flag to toggle the drawing of node indices.

  • DrawHexTT – Flag to toggle the representation of truth tables for unknown functions in hexadecimal notation.

Subclassed by fiction::simple_gate_layout_tile_drawer< Lyt, ClockColors, DrawIndexes >

template<typename Ntk, bool DrawIndexes = false>
class color_view_drawer : public mockturtle::default_dot_drawer<Ntk>

A DOT drawer for networks with colored nodes. Node colors represent their painted color instead of their gate type.

Template Parameters:
  • Ntk – Logic network type.

  • DrawIndexes – Flag to toggle the drawing of node indices.

Subclassed by fiction::edge_color_view_drawer< Ntk, DrawIndexes >

template<typename Ntk, bool DrawIndexes = false>
class edge_color_view_drawer : public fiction::color_view_drawer<Ntk, false>

A DOT drawer for networks with colored edges. Node colors represent their painted color instead of their gate type.

Template Parameters:
  • Ntk – Logic network type.

  • DrawIndexes – Flag to toggle the drawing of node indices.

template<typename Lyt, bool ClockColors = false, bool DrawIndexes = false>
class simple_gate_layout_tile_drawer : public fiction::technology_dot_drawer<Lyt, false>

Base class for a simple gate-level layout DOT drawer.

Template Parameters:
  • Lyt – Gate-level layout type.

  • ClockColors – Flag to toggle the drawing of clock colors instead of gate type colors.

  • DrawIndexes – Flag to toggle the drawing of node indices.

Subclassed by fiction::gate_layout_cartesian_drawer< Lyt, ClockColors, DrawIndexes >, fiction::gate_layout_hexagonal_drawer< Lyt, ClockColors, DrawIndexes >, fiction::gate_layout_shifted_cartesian_drawer< Lyt, ClockColors, DrawIndexes >

template<typename Lyt, bool ClockColors = false, bool DrawIndexes = false>
class gate_layout_cartesian_drawer : public fiction::simple_gate_layout_tile_drawer<Lyt, false, false>

An extended gate-level layout DOT drawer for Cartesian layouts.

Template Parameters:
  • Lyt – Cartesian gate-level layout type.

  • ClockColors – Flag to toggle the drawing of clock colors instead of gate type colors.

  • DrawIndexes – Flag to toggle the drawing of node indices.

template<typename Lyt, bool ClockColors = false, bool DrawIndexes = false>
class gate_layout_shifted_cartesian_drawer : public fiction::simple_gate_layout_tile_drawer<Lyt, false, false>

An extended gate-level layout DOT drawer for shifted Cartesian layouts.

Template Parameters:
  • Lyt – Shifted Cartesian gate-level layout type.

  • ClockColors – Flag to toggle the drawing of clock colors instead of gate type colors.

  • DrawIndexes – Flag to toggle the drawing of node indices.

template<typename Lyt, bool ClockColors = false, bool DrawIndexes = false>
class gate_layout_hexagonal_drawer : public fiction::simple_gate_layout_tile_drawer<Lyt, false, false>

An extended gate-level layout DOT drawer for hexagonal layouts.

Template Parameters:
  • Lyt – Hexagonal gate-level layout type.

  • ClockColors – Flag to toggle the drawing of clock colors instead of gate type colors.

  • DrawIndexes – Flag to toggle the drawing of node indices.

template<class Lyt, class Drawer>
void fiction::write_dot_layout(const Lyt &lyt, std::ostream &os, const Drawer &drawer = {})

Writes layout in DOT format into output stream.

An overloaded variant exists that writes the layout into a file.

Required network functions:

  • is_pi

  • foreach_node

  • foreach_fanin

Parameters:
  • lyt – Layout

  • os – Output stream

template<class Lyt, class Drawer>
void fiction::write_dot_layout(const Lyt &lyt, const std::string_view &filename, const Drawer &drawer = {})

Writes layout in DOT format into a file.

Required network functions:

  • is_pi

  • foreach_node

  • foreach_fanin

Parameters:
  • lyt – Layout

  • filename – Filename

SVG Images

Header: fiction/io/write_svg_layout.hpp

struct write_qca_layout_svg_params

Parameters for writing SVG QCA layouts.

Public Members

bool simple = false

Limit details to create smaller file sizes.

Warning

doxygenfunction: Unable to resolve function “fiction::write_qca_layout_svg” with arguments (const Lyt&, std::ostream&, write_qca_layout_svg_params) in doxygen xml output for project “fiction” from directory: doxyxml/xml. Potential matches:

- template<typename Lyt> void write_qca_layout_svg(const Lyt &lyt, const std::string_view &filename, const write_qca_layout_svg_params &ps = {})
- template<typename Lyt> void write_qca_layout_svg(const Lyt &lyt, std::ostream &os, const write_qca_layout_svg_params &ps = {})

Warning

doxygenfunction: Unable to resolve function “fiction::write_qca_layout_svg” with arguments (const Lyt&, const std::string_view&, write_qca_layout_svg_params) in doxygen xml output for project “fiction” from directory: doxyxml/xml. Potential matches:

- template<typename Lyt> void write_qca_layout_svg(const Lyt &lyt, const std::string_view &filename, const write_qca_layout_svg_params &ps = {})
- template<typename Lyt> void write_qca_layout_svg(const Lyt &lyt, std::ostream &os, const write_qca_layout_svg_params &ps = {})
template<typename Coordinate>
class unsupported_cell_type_exception : public std::exception
struct write_sidb_layout_svg_params

Parameters for writing SiDB layouts to SVG format.

Public Types

enum class color_mode : uint8_t

Enumeration to specify the color mode for the SVG output.

Values:

enumerator DARK

Dark mode.

enumerator LIGHT

Light mode.

enum class sidb_lattice_mode : uint8_t

Enumeration to specify if the H-Si lattice is plotted in addition to SiDBs.

Values:

enumerator HIDE_LATTICE

Lattice is hidden. Only SiDBs are shown.

enumerator SHOW_LATTICE

Lattice is shown.

Public Members

double lattice_point_size = 0.3

Size of the H-Si lattice points in SVG units.

double sidb_size = 0.9

Size of the SiDB in SVG units.

double sidb_border_width = 0.3

Border width of the SiDB.

color_mode color_background = color_mode::DARK

The color mode of the background for the SVG output.

sidb_lattice_mode lattice_mode = sidb_lattice_mode::SHOW_LATTICE

The lattice mode of the SiDB layout.

template<typename Lyt>
void fiction::write_sidb_layout_svg(const Lyt &lyt, std::ostream &os, const write_sidb_layout_svg_params &ps = {})

Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.

Note

SiDB defects are not supported yet.

Template Parameters:

Lyt – SiDB cell-level layout type.

Parameters:
  • lyt – The layout to be written.

  • os – The output stream to write into.

  • ps – Parameters.

Warning

doxygenfunction: Unable to resolve function “fiction::write_sidb_layout_svg” with arguments “(const Lyt& lyt, const std::string_view& filename,”. Could not parse arguments. Parsing error is Invalid C++ declaration: Expected identifier in nested name. [error at 50] (const Lyt& lyt, const std::string_view& filename, ————————————————–^