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
orsidb_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
- mnt.pyfiction.write_dot_layout(*args, **kwargs)
Overloaded function.
write_dot_layout(layout: mnt.pyfiction.pyfiction.cartesian_gate_layout, filename: str) -> None
! 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
- Parameter
lyt
: Layout
- Parameter
os
: Output stream
write_dot_layout(layout: mnt.pyfiction.pyfiction.shifted_cartesian_gate_layout, filename: str) -> None
! 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
- Parameter
lyt
: Layout
- Parameter
os
: Output stream
write_dot_layout(layout: mnt.pyfiction.pyfiction.hexagonal_gate_layout, filename: str) -> None
! 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
- Parameter
lyt
: Layout
- Parameter
os
: Output stream
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.
-
bool simple = false
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
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.
-
double lattice_point_size = 0.3
-
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, ————————————————–^
- class mnt.pyfiction.write_qca_layout_svg_params
Parameters for writing SVG QCA layouts.
- property simple
Limit details to create smaller file sizes.
- mnt.pyfiction.write_qca_layout_svg(layout: mnt.pyfiction.pyfiction.qca_layout, filename: str, params: mnt.pyfiction.pyfiction.write_qca_layout_svg_params = <mnt.pyfiction.pyfiction.write_qca_layout_svg_params object at 0x7b94bc73f370>) None
Writes an SVG representation of a cell-level QCA layout into an output stream. Both tile- and cell-based layouts are supported. For tile- based layouts, QCA layouts of tile size \(5 \times 5\) are supported exclusively so far.
The utilized color scheme is based on the standard scheme used in QCADesigner (https://waluslab.ece.ubc.ca/qcadesigner/).
May throw an unsupported_cell_type_exception if it encounters unsupported cell types in the layout.
- Template parameter
Lyt
: Cell-level QCA layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
- Template parameter
- class mnt.pyfiction.write_sidb_layout_svg_params
Parameters for writing SiDB layouts to SVG format.
- property color_background
The color mode of the background for the SVG output.
- property lattice_mode
The lattice mode of the SiDB layout.
- property lattice_point_size
Size of the H-Si lattice points in SVG units.
- property sidb_border_width
Border width of the SiDB.
- property sidb_size
Size of the SiDB in SVG units.
- mnt.pyfiction.write_sidb_layout_svg(*args, **kwargs)
Overloaded function.
write_sidb_layout_svg(layout: mnt.pyfiction.pyfiction.charge_distribution_surface_111, filename: str, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc73fbb0>) -> None
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
write_sidb_layout_svg(layout: mnt.pyfiction.pyfiction.charge_distribution_surface_100, filename: str, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc7184f0>) -> None
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
write_sidb_layout_svg(layout: mnt.pyfiction.pyfiction.charge_distribution_surface, filename: str, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc718570>) -> None
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
write_sidb_layout_svg(layout: mnt.pyfiction.pyfiction.sidb_111_lattice, filename: str, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc771bf0>) -> None
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
write_sidb_layout_svg(layout: mnt.pyfiction.pyfiction.sidb_100_lattice, filename: str, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc8f0370>) -> None
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
write_sidb_layout_svg(layout: mnt.pyfiction.pyfiction.sidb_layout, filename: str, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc8b7430>) -> None
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
- mnt.pyfiction.write_sidb_layout_svg_to_string(*args, **kwargs)
Overloaded function.
write_sidb_layout_svg_to_string(layout: mnt.pyfiction.pyfiction.charge_distribution_surface_111, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc7584f0>) -> str
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
write_sidb_layout_svg_to_string(layout: mnt.pyfiction.pyfiction.charge_distribution_surface_100, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc791930>) -> str
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
write_sidb_layout_svg_to_string(layout: mnt.pyfiction.pyfiction.charge_distribution_surface, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc7676b0>) -> str
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
write_sidb_layout_svg_to_string(layout: mnt.pyfiction.pyfiction.sidb_111_lattice, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc8b7570>) -> str
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
write_sidb_layout_svg_to_string(layout: mnt.pyfiction.pyfiction.sidb_100_lattice, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc8b7330>) -> str
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.
write_sidb_layout_svg_to_string(layout: mnt.pyfiction.pyfiction.sidb_layout, ps: mnt.pyfiction.pyfiction.write_sidb_layout_svg_params = <mnt.pyfiction.pyfiction.write_sidb_layout_svg_params object at 0x7b94bc766e70>) -> str
Writes an SVG representation of an SiDB cell-level SiDB layout into an output stream.
@note SiDB defects are not supported yet.
- Template parameter
Lyt
: SiDB cell-level layout type.
- Parameter
lyt
: The layout to be written.
- Parameter
os
: The output stream to write into.
- Parameter
ps
: Parameters.