Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legalization #476

Open
wants to merge 101 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
0fa1a52
Init files
hibenj Jun 12, 2024
1fab81f
Rank Ntk Setup
hibenj Jun 12, 2024
9f77eda
Compute Delay for H-graph.
hibenj Jun 12, 2024
35a5f6f
:heavy_plus_sign: Compute nodes of the next level choosing the smalle…
hibenj Jun 12, 2024
9d994a0
:art: refactoring for readability
hibenj Jun 12, 2024
4a88b42
:art: Node insertion for computing the next level nodes fixed.
hibenj Jun 13, 2024
fa968ff
:art: Pi propagation and next_level computation fixed.
hibenj Jun 13, 2024
488a588
:art: refactoring for readability
hibenj Jun 13, 2024
fe10893
:heavy_plus_sign: created virtual_pi_network.hpp and virtual_pi_netwo…
hibenj Jun 17, 2024
5319bf4
:art: output iterators adjusted after rmoving virtual PIs. Test cases…
hibenj Jun 18, 2024
93d71c5
:art: redefinition of size() for code consistency
hibenj Jun 18, 2024
cb22aa9
:art: redefinition of functions.
hibenj Jun 18, 2024
2e82517
:heavy_plus_sign: added extended_rank_view.cpp and extended_rank_view…
hibenj Jun 19, 2024
d853052
:art: extended_rank_view is a rank_view with additional modify_rank a…
hibenj Jun 19, 2024
85bf4b4
:art: remove_virtual_input_nodes fixed. Take care of input and output…
hibenj Jul 9, 2024
85dab93
:heavy_plus_sign: network creation added. Only 1-ary and 2-ary functi…
hibenj Jul 9, 2024
4e5b9ba
:art: code cleaned and test case added
hibenj Jul 9, 2024
6f4c78e
:art: changed virt_pi storage to shared_ptr and handle node deletion …
hibenj Jul 15, 2024
eade532
:art: cleaned and documented virtual_pi_network files
hibenj Jul 15, 2024
37f8acc
Merge branch 'cda-tum:main' into legalization
hibenj Jul 15, 2024
326d6a4
:art: cleaned and documented extended_rank_view files
hibenj Jul 16, 2024
d2b1a57
:art: small adjustments to enable extended_rank_view
hibenj Jul 16, 2024
db6a668
:art: rank computation added
hibenj Jul 16, 2024
e94b479
:heavy_plus_sign: planarity check added. The check requires a balance…
hibenj Jul 17, 2024
1b77a89
:art: bugs with gather_fanin_signals removed. Documentation updated.
hibenj Jul 17, 2024
0e2f63d
:art: create_virtualPi_network from levels moved to virtual_pi_networ…
hibenj Jul 17, 2024
0d5dc55
:art: updated documentation check_planarity.hpp
hibenj Jul 17, 2024
afd38fb
:art: small adjustments
hibenj Jul 17, 2024
39433d1
Merge branch 'cda-tum:main' into legalization
hibenj Jul 17, 2024
c22d3c3
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 17, 2024
d6179b8
Merge branch 'cda-tum:main' into legalization
hibenj Jul 29, 2024
3450718
:art: check_planarity.hpp spaw trait removed, since const ntk doesnt …
hibenj Jul 30, 2024
08d6212
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 30, 2024
20da9f7
:memo: Update pyfiction docstrings
actions-user Jul 30, 2024
7e501a6
:heavy_plus_sign: refactored virtual_pi_network.hpp and added virtual…
hibenj Jul 31, 2024
a2cab37
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Jul 31, 2024
7d94449
:memo: Update pyfiction docstrings
actions-user Jul 31, 2024
58ae758
:art: consistency
hibenj Jul 31, 2024
63af40c
Merge remote-tracking branch 'origin/legalization' into legalization
hibenj Jul 31, 2024
d619670
:memo: Update pyfiction docstrings
actions-user Jul 31, 2024
a570640
:art: consistency
hibenj Jul 31, 2024
ca2cc5a
:art: Updated extended_rank_view
hibenj Aug 1, 2024
566ed78
:memo: Update pyfiction docstrings
actions-user Aug 1, 2024
42dd596
:art: Updated node_duplication_planarization
hibenj Aug 1, 2024
3ae7322
Merge remote-tracking branch 'origin/legalization' into legalization
hibenj Aug 1, 2024
d786f43
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Aug 1, 2024
699d4ee
:heavy_plus_sign: added function rank_width to extended_rank_view.hpp
hibenj Aug 13, 2024
39b3a3f
Merge branch 'main' into legalization
hibenj Aug 20, 2024
4f3aab7
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Aug 20, 2024
e431e21
:memo: Update pyfiction docstrings
actions-user Aug 20, 2024
01035ec
:art: bug fixed
hibenj Aug 20, 2024
a1cabbe
:art: multi_output bug fixed
hibenj Aug 21, 2024
ac979e0
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Aug 21, 2024
de1343a
:art: removed unnecessary functions and updated documentation
hibenj Aug 24, 2024
a9a580f
Merge remote-tracking branch 'origin/legalization' into legalization
hibenj Aug 24, 2024
de97080
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Aug 24, 2024
2080f60
:art: updated files for consistency
hibenj Aug 24, 2024
fce406f
Merge remote-tracking branch 'origin/legalization' into legalization
hibenj Aug 24, 2024
f722484
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Aug 24, 2024
3926c47
:memo: Update pyfiction docstrings
actions-user Aug 24, 2024
2094073
:art: updated files for consistency
hibenj Aug 24, 2024
d2f8940
Merge remote-tracking branch 'origin/legalization' into legalization
hibenj Aug 24, 2024
0c97989
:memo: Update pyfiction docstrings
actions-user Aug 24, 2024
7721cc5
:heavy_plus sign: updated documentation and added test
hibenj Aug 26, 2024
8fb957c
Merge remote-tracking branch 'origin/legalization' into legalization
hibenj Aug 26, 2024
e444977
:memo: Update pyfiction docstrings
actions-user Aug 26, 2024
5cda15e
:art: updated readability and documentation
hibenj Aug 26, 2024
3e24f3c
:heavy_plus sign: added experiments legalization.cpp. Fixed bug for t…
hibenj Aug 26, 2024
ce44c85
:art: override foreach_ci in extended_rank_view.hpp
hibenj Aug 26, 2024
e835f30
:art: included size bounds for networks. For to big networks `calcula…
hibenj Aug 26, 2024
7acc132
:art: switched from shared_pointers to raw pointers and fixed the seg…
hibenj Aug 27, 2024
e9bfba9
:art: added ortho to experiment
hibenj Aug 28, 2024
6efc696
Merge branch 'main' into legalization
hibenj Sep 19, 2024
3b56eb8
:art: merged main
hibenj Sep 19, 2024
a427659
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Sep 19, 2024
853e2d7
:art: bug fixes and small changes
hibenj Sep 19, 2024
bb3195a
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Sep 19, 2024
89bb7b2
:memo: Update pyfiction docstrings
actions-user Sep 19, 2024
cbfbd6f
:art: bugfix: reverted changes for pos in node_duplication_legalization
hibenj Sep 20, 2024
ac0ff0f
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Sep 20, 2024
0c7e3ba
:art: refactored po collection in node_duplication_planarization.hpp
hibenj Sep 23, 2024
ad00cf4
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Sep 23, 2024
2851358
:art: fixed tests in check_planarity.cpp
hibenj Sep 23, 2024
04c3f0a
Merge branch 'main' into legalization
hibenj Sep 23, 2024
9f4f59c
:art: placed virtual_pi creation for duplicated nodes into node_dupli…
hibenj Sep 23, 2024
8321362
:memo: Update pyfiction docstrings
actions-user Sep 23, 2024
accd04f
:art: cleaned up some code
hibenj Sep 23, 2024
c838dee
:memo: Update pyfiction docstrings
actions-user Sep 23, 2024
42510ce
:heavy_plus_sign: buffer_removal added.
hibenj Sep 24, 2024
02cb042
Merge remote-tracking branch 'origin/legalization' into legalization
hibenj Sep 24, 2024
60f4038
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Sep 24, 2024
b7a6229
:art: added docstrings
hibenj Sep 24, 2024
b71f5fd
Merge remote-tracking branch 'origin/legalization' into legalization
hibenj Sep 24, 2024
f5e0e49
:art: renamed files
hibenj Oct 14, 2024
ede1ff0
:art: experiments_file_cleaned
hibenj Oct 14, 2024
089be08
🎨 Incorporated pre-commit fixes
pre-commit-ci[bot] Oct 14, 2024
b4df1c6
submodules checked
hibenj Oct 15, 2024
2d5c70a
Merge branch 'main' into legalization
hibenj Oct 16, 2024
42daacb
Merge branch 'main' into legalization
hibenj Dec 3, 2024
df3b9f8
:memo: Update pyfiction docstrings
actions-user Dec 3, 2024
1880f0a
Merge branch 'main' into legalization
hibenj Dec 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
283 changes: 283 additions & 0 deletions bindings/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,32 @@
#endif


static const char *__doc_extended_rank_view =
R"doc(@class extended_rank_view<Ntk, true>

If already a rank_interface exists only the depth_view constructor
gets called.

Template parameter ``Ntk``:
- The network type.)doc";

static const char *__doc_extended_rank_view_2 =
R"doc(Deduction guide for `extended_rank_view'

Template parameter ``T``:
Network type deduced from the construction context of
`extended_rank_view`.)doc";

static const char *__doc_extended_rank_view_3 =
R"doc(Deduction guide for `extended_rank_view` with two constructor
arguments

Template parameter ``T``:
Network type deduced from the construction context of
`extended_rank_view`.)doc";

static const char *__doc_extended_rank_view_extended_rank_view = R"doc()doc";

static const char *__doc_fiction_a_star =
R"doc(The A* path finding algorithm for shortest loop-less paths between a
given source and target coordinate in a layout. This function
Expand Down Expand Up @@ -1886,6 +1912,46 @@ Parameter ``cs``:
Returns:
Integer representing the SiDB's charge state.)doc";

static const char *__doc_fiction_check_planarity =
R"doc(Checks if a logic network is planar. To perform this check, the
network must have ranks assigned.

If the network is not balanced, an exception is thrown. To balance the
network, insert buffers to divide multi-level edges.

Template parameter ``Ntk``:
Logic network type.

Parameter ``ntk``:
The logic network to check for planarity.

Returns:
`true` if the network is planar, `false` otherwise.

Throws:
std::runtime_error if the network is not balanced.)doc";

static const char *__doc_fiction_check_planarity_impl = R"doc()doc";

static const char *__doc_fiction_check_planarity_impl_check_planarity_impl = R"doc()doc";

static const char *__doc_fiction_check_planarity_impl_ntk = R"doc()doc";

static const char *__doc_fiction_check_planarity_impl_run =
R"doc(Checks if a given network is planar.

This function checks if the network represented by the variable `ntk`
is planar. The network is planar if for any edge with starting point m
and endpoint n (represented by the node ranks), there is never another
edge with starting point m_ > m and endpoint n_ < n, or vice versa.
When iterating through the ranks of one level, the endpoints are
always increasing. Therefore, only the starting points need to be
checked. Thus, the highest connected starting point in the fan-in
gives a border m_max for every subsequent edge.

Returns:
`true` if the network is planar, `false` otherwise.)doc";

static const char *__doc_fiction_check_simulation_results_for_equivalence =
R"doc(This function compares two SiDB simulation results for equivalence.
Two results are considered equivalent if they have the same number of
Expand Down Expand Up @@ -3772,6 +3838,23 @@ Parameter ``to_delete``:
Returns:
A 2D vector representing the calculated offset matrix.)doc";

static const char *__doc_fiction_detail_calculate_pairs =
R"doc(Calculates pairs of nodes from a given vector of nodes.

This function takes a vector of nodes and returns a vector of node
pairs. Each node pair consists of two nodes from the input vector and
an optional vector of middle nodes. The delay of each node pair is
initialized to infinity.

Template parameter ``Ntk``:
The network type.

Parameter ``nodes``:
The vector of nodes.

Returns:
The vector of node pairs.)doc";

static const char *__doc_fiction_detail_color_routing_impl = R"doc()doc";

static const char *__doc_fiction_detail_color_routing_impl_color_routing_impl = R"doc()doc";
Expand Down Expand Up @@ -5717,6 +5800,125 @@ static const char *__doc_fiction_detail_network_balancing_impl_ps = R"doc()doc";

static const char *__doc_fiction_detail_network_balancing_impl_run = R"doc()doc";

static const char *__doc_fiction_detail_node_duplication_planarization_impl = R"doc()doc";

static const char *__doc_fiction_detail_node_duplication_planarization_impl_check_final_level =
R"doc(Checks if the given vector of nodes contains any non-primary inputs.

This function iterates through each node in the vector and checks if
it is a primary input. If a non-primary input is found, the
`f_final_level` parameter is set to false and the loop is exited.

Parameter ``v_next_level``:
The vector of nodes to be checked

Parameter ``f_final_level``:
A reference to a boolean indicating if the vector contains only
primary inputs)doc";

static const char *__doc_fiction_detail_node_duplication_planarization_impl_compute_node_order_next_level =
R"doc(Computes the order of nodes in the next level based on delay

Parameter ``next_level``:
The vector to store the nodes in the next level

This function computes the order of nodes in the next level based on
their delay in the H-graph of the level. It selects the path with the
least delay from the current level pairs and follows it via fanin
relations. The nodes are inserted into the next level vector in the
order they are encountered.)doc";

static const char *__doc_fiction_detail_node_duplication_planarization_impl_compute_slice_delays =
R"doc(Computes the delay in a given slice (each possible order of
node_pairs) of an H-graph

Parameter ``nd``:
Node in the H-graph

Parameter ``border_pis``:
A boolean indicating whether the input PIs (Primary Inputs) should
be propagated to the next level

This function iterates over the fanins of the given node and computes
the delay for all possible orders of these nodes that form a
node_pair. The delay computation depends on the node's connections and
position within the graph. If there is a connection between two
node_pairs, the delay is incremented by 1. If not, the delay is
incremented by 2. Default delay for the first node is 1. If a
node_pair doesn't have a connection and its delay (when increased by
two) is less than the existing delay, then this node_pair's delay is
updated.

The processed node_pairs are pushed back to the 'lvl_pairs' data
member for subsequent delay calculations.

Throws:
std::runtime_error if no combinations (possible node_pairs) are
found, which might suggest a dangling node)doc";

static const char *__doc_fiction_detail_node_duplication_planarization_impl_insert_if_unique =
R"doc(Inserts a node into a vector if it is unique

This function inserts a node into a vector only if the vector is empty
or the node is not equal to the first element of the vector. If the
vector is not empty and the node is equal to the first element, it
does nothing.

Template parameter ``Ntk``:
The network type

Parameter ``node``:
The node to be inserted

Parameter ``vec``:
The vector to insert the node into)doc";

static const char *__doc_fiction_detail_node_duplication_planarization_impl_lvl_pairs = R"doc()doc";

static const char *__doc_fiction_detail_node_duplication_planarization_impl_node_duplication_planarization_impl = R"doc()doc";

static const char *__doc_fiction_detail_node_duplication_planarization_impl_ntk = R"doc()doc";

static const char *__doc_fiction_detail_node_duplication_planarization_impl_ps = R"doc()doc";

static const char *__doc_fiction_detail_node_duplication_planarization_impl_run = R"doc()doc";

static const char *__doc_fiction_detail_node_pair =
R"doc(A structure representing a pair of nodes in an H-graph

Template parameter ``Ntk``:
Network type for the nodes in the pair

The nodes stored in this struct describe the fanin-edges of a node in
an H-graph. A node pair object holds two nodes, which are saved in the
member 'pair'. These two outer nodes are connected through zero or
more 'middle_nodes'. The fanin order starts with the first node in
'pair', then proceeds through the 'middle_nodes', and ends with the
second node in 'pair'. The order of 'middle_nodes' is arbitrary as
they cannot be further connected to any other nodes. For the
planarization, only the nodes inside the 'pair' are relevant.

@note The edges connecting to the nodes in 'pair' effectively block
the 'middle_nodes'.)doc";

static const char *__doc_fiction_detail_node_pair_delay = R"doc(Specifies the delay value for the node)doc";

static const char *__doc_fiction_detail_node_pair_fanin_pair =
R"doc(Shared pointer to another instance of node_pair detailing fanin-edge
alignment)doc";

static const char *__doc_fiction_detail_node_pair_node_pair =
R"doc(node_pair constructor

Parameter ``node1``:
The first node of the fanin-edged node

Parameter ``node2``:
The second node of the fanin-edged node

Parameter ``delayValue``:
The delay value for the node)doc";

static const char *__doc_fiction_detail_operational_domain_impl = R"doc()doc";

static const char *__doc_fiction_detail_operational_domain_impl_contour_tracing =
Expand Down Expand Up @@ -10171,10 +10373,14 @@ static const char *__doc_fiction_has_north_east = R"doc()doc";

static const char *__doc_fiction_has_north_west = R"doc()doc";

static const char *__doc_fiction_has_num_real_pis = R"doc()doc";

static const char *__doc_fiction_has_ordinal_operations = R"doc()doc";

static const char *__doc_fiction_has_post_layout_optimization = R"doc()doc";

static const char *__doc_fiction_has_remove_virtual_input_nodes = R"doc()doc";

static const char *__doc_fiction_has_set_layout_name = R"doc()doc";

static const char *__doc_fiction_has_south = R"doc()doc";
Expand Down Expand Up @@ -11647,6 +11853,20 @@ static const char *__doc_fiction_missing_sidb_position_exception_missing_sidb_po

static const char *__doc_fiction_missing_sidb_position_exception_where = R"doc()doc";

static const char *__doc_fiction_miter =
R"doc(! Creates a combinational miter from two networks.

This method combines two networks that have the same number of primary
inputs and the same number of primary outputs into a miter. The miter
has the same number of inputs and one primary output. This output is
the OR of XORs of all primary output pairs. In other words, the miter
outputs 1 for all input assignments in which the two input networks
differ.

All networks may have different types. The method returns an optional,
which is `nullopt`, whenever the two input networks don't match in
their number of primary inputs and primary outputs.)doc";

static const char *__doc_fiction_network_balancing =
R"doc(Balances a logic network with buffer nodes that compute the identity
function. For this purpose, `create_buf` is utilized. Therefore,
Expand Down Expand Up @@ -11731,6 +11951,49 @@ Parameter ``file``:
Parameter ``rfun``:
The actual parsing function.)doc";

static const char *__doc_fiction_node_duplication_params = R"doc(Parameters for the node duplication algorithm.)doc";

static const char *__doc_fiction_node_duplication_params_random_output_order =
R"doc(The output order determines the starting layer for this algorithm. If
this option is turned off, the output order remains the same as in the
provided network. If it is turned on, the outputs are ordered
randomly.)doc";

static const char *__doc_fiction_node_duplication_planarization =
R"doc(Implements a planarization mechanism for networks using a H-Graph
strategy for node duplication.

Template parameter ``NtkDest``:
Destination network type

Template parameter ``NtkSrc``:
Source network type

Parameter ``ntk_src``:
Source network to be utilized for the planarization

Parameter ``ps``:
Node duplication parameters used in the computation

The planarization achieved by this function solves the Node
Duplication Crossing Minimization (NDCE) problem by finding the
shortest x-y path in the H-graph for every level in the network. An
H-graph describes edge relations between two levels in a network, with
one level assumed as fixed, starting at the Primary Outputs (POs). By
finding the shortest path from the source (x) to the sink (y) in this
H-graph, an optimal solution for the NDCE problem is found. The
function constructs an H-graph that captures edge relations between
two levels within the graph and computes the shortest x-y paths on the
H-graph, traversing from the POs towards the Primary Inputs (PIs).

Returns:
A view of the planarized virtual_pi_network created in the format
of extended_rank_view

Throws:
std::runtime_error if input network not balanced, if no node
combinations are found or if the created network is non-planar)doc";

static const char *__doc_fiction_normalize_layout_coordinates =
R"doc(A new layout is constructed and returned that is equivalent to the
given cell-level layout. However, its coordinates are normalized,
Expand Down Expand Up @@ -15449,6 +15712,26 @@ static const char *__doc_fiction_vertical_shift_cartesian =
R"doc(\verbatim +-------+ | | | +-------+ | | | +-------+ | | | +-------+
\endverbatim)doc";

static const char *__doc_fiction_virtual_pi_network = R"doc()doc";

static const char *__doc_fiction_virtual_pi_network_virtual_pi_network =
R"doc(Default constructor for the `virtual_pi_network` class. Initializes
`_storage` as a shared pointer.)doc";

static const char *__doc_fiction_virtual_pi_network_virtual_pi_network_2 =
R"doc(Copy constructor for the `virtual_pi_network` class. Given a network
`ntk`, constructs a new `virtual_pi_network` as a clone of `ntk`.
Initializes `_storage` as a shared pointer.

Parameter ``ntk``:
The network to clone into this object.)doc";

static const char *__doc_fiction_virtual_storage = R"doc()doc";

static const char *__doc_fiction_virtual_storage_map_virt_to_real_pi = R"doc(Map from virtual_pis to real_pis.)doc";

static const char *__doc_fiction_virtual_storage_virtual_inputs = R"doc(Shared pointer vector storage for virtual_inputs.)doc";

static const char *__doc_fiction_volume =
R"doc(Computes the volume of a given coordinate assuming its origin is (0,
0, 0). Calculates :math:`(|x| + 1) \cdot (|y| + 1) \cdot (|z| + 1)` by
Expand Down
Loading
Loading