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 98 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
380 changes: 380 additions & 0 deletions bindings/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp

Large diffs are not rendered by default.

214 changes: 214 additions & 0 deletions experiments/legalization/legalization.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,214 @@
//
// Created by benjamin on 8/26/24.
//

#include "experiments.hpp"
#include "fiction/algorithms/network_transformation/fanout_substitution.hpp"
#include "fiction/algorithms/properties/check_planarity_balanced.hpp"
#include "fiction/layouts/cartesian_layout.hpp"
#include "fiction/layouts/clocked_layout.hpp"
#include "fiction/layouts/coordinates.hpp"
#include "fiction/layouts/gate_level_layout.hpp"
#include "fiction/layouts/tile_based_layout.hpp"
#include "fiction_experiments.hpp"
hibenj marked this conversation as resolved.
Show resolved Hide resolved
hibenj marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header network_writer.hpp is not used directly [misc-include-cleaner]

Suggested change
#include "fiction_experiments.hpp"
#include "fiction_experiments.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header network_writer.hpp is not used directly [misc-include-cleaner]

Suggested change
#include "fiction_experiments.hpp"
#include "fiction_experiments.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header network_writer.hpp is not used directly [misc-include-cleaner]

Suggested change
#include "fiction_experiments.hpp"
#include "fiction_experiments.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header network_writer.hpp is not used directly [misc-include-cleaner]

Suggested change
#include "fiction_experiments.hpp"
#include "fiction_experiments.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header network_writer.hpp is not used directly [misc-include-cleaner]

Suggested change
#include "fiction_experiments.hpp"
#include "fiction_experiments.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header network_writer.hpp is not used directly [misc-include-cleaner]

Suggested change
#include "fiction_experiments.hpp"
#include "fiction_experiments.hpp"


#include <fiction/algorithms/network_transformation/network_balancing.hpp>
#include <fiction/algorithms/network_transformation/node_duplication_planarization.hpp>
#include <fiction/algorithms/physical_design/orthogonal.hpp> // scalable heuristic for physical design
#include <fiction/algorithms/verification/design_rule_violations.hpp>
#include <fiction/algorithms/verification/virtual_miter.hpp>
hibenj marked this conversation as resolved.
Show resolved Hide resolved
hibenj marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header equivalence_checking.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/algorithms/verification/virtual_miter.hpp>
#include <fiction/algorithms/verification/virtual_miter.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header equivalence_checking.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/algorithms/verification/virtual_miter.hpp>
#include <fiction/algorithms/verification/virtual_miter.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header equivalence_checking.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/algorithms/verification/virtual_miter.hpp>
#include <fiction/algorithms/verification/virtual_miter.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header equivalence_checking.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/algorithms/verification/virtual_miter.hpp>
#include <fiction/algorithms/verification/virtual_miter.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header equivalence_checking.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/algorithms/verification/virtual_miter.hpp>
#include <fiction/algorithms/verification/virtual_miter.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header equivalence_checking.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/algorithms/verification/virtual_miter.hpp>
#include <fiction/algorithms/verification/virtual_miter.hpp>

#include <fiction/io/network_reader.hpp> // read networks from files
hibenj marked this conversation as resolved.
Show resolved Hide resolved
hibenj marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header dot_drawers.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/io/network_reader.hpp> // read networks from files
#include <fiction/io/network_reader.hpp> // read networks from files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header dot_drawers.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/io/network_reader.hpp> // read networks from files
#include <fiction/io/network_reader.hpp> // read networks from files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header dot_drawers.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/io/network_reader.hpp> // read networks from files
#include <fiction/io/network_reader.hpp> // read networks from files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header dot_drawers.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/io/network_reader.hpp> // read networks from files
#include <fiction/io/network_reader.hpp> // read networks from files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header dot_drawers.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/io/network_reader.hpp> // read networks from files
#include <fiction/io/network_reader.hpp> // read networks from files

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header dot_drawers.hpp is not used directly [misc-include-cleaner]

Suggested change
#include <fiction/io/network_reader.hpp> // read networks from files
#include <fiction/io/network_reader.hpp> // read networks from files

#include <fiction/networks/technology_network.hpp>
#include <fiction/types.hpp>

#include <fmt/core.h>
#include <mockturtle/algorithms/equivalence_checking.hpp>
#include <mockturtle/algorithms/miter.hpp>
#include <mockturtle/networks/klut.hpp>

hibenj marked this conversation as resolved.
Show resolved Hide resolved
hibenj marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header rank_view.hpp is not used directly [misc-include-cleaner]

Suggested change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header rank_view.hpp is not used directly [misc-include-cleaner]

Suggested change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header rank_view.hpp is not used directly [misc-include-cleaner]

Suggested change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header rank_view.hpp is not used directly [misc-include-cleaner]

Suggested change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header rank_view.hpp is not used directly [misc-include-cleaner]

Suggested change

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header rank_view.hpp is not used directly [misc-include-cleaner]

Suggested change

#include <cassert>
#include <cstdint>
#include <filesystem>
#include <sstream>
#include <string>

template <typename Ntk>
Ntk read_ntk(const std::string& name)
{
fmt::print("[i] processing {}\n", name);

std::ostringstream os{};

fiction::network_reader<fiction::tec_ptr> reader{fiction_experiments::benchmark_path(name), os};

const auto nets = reader.get_networks();

return *nets.front();
}

int main() // NOLINT
{
experiments::experiment<std::string, std::uint32_t, std::uint32_t, std::uint32_t, std::uint32_t, std::uint32_t,
std::uint32_t, bool, bool, bool>
wiring_reduction_exp{"planarization", "benchmark", "inputs", "virt_inputs",
"outputs", "initial nodes", "nodes buffered", "nodes planarized",
"is_planar", "equivalent(ntk)", "equivalent(lyt)"};

for (const auto& entry :
std::filesystem::directory_iterator("/home/benjamin/Documents/Repositories/working/fiction/benchmarks/IWLS93"))
hibenj marked this conversation as resolved.
Show resolved Hide resolved
hibenj marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::filesystem::directory_iterator" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:32:

- #include <sstream>
+ #include <filesystem>
+ #include <sstream>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::filesystem::directory_iterator" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:32:

- #include <sstream>
+ #include <filesystem>
+ #include <sstream>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::filesystem::directory_iterator" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:32:

- #include <sstream>
+ #include <filesystem>
+ #include <sstream>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::filesystem::directory_iterator" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:32:

- #include <sstream>
+ #include <filesystem>
+ #include <sstream>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::filesystem::directory_iterator" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:32:

- #include <sstream>
+ #include <filesystem>
+ #include <sstream>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::filesystem::directory_iterator" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:32:

- #include <sstream>
+ #include <filesystem>
+ #include <sstream>

{
continue;
fmt::print("[i] processing {}\n", entry.path().filename().string());

/*if ( "sqrt8ml.v" != entry.path().filename().string())
{
continue;
}*/
/*if ( "C1355.v" != entry.path().filename().string())
{
continue;
}*/
if ("C432.v" == entry.path().filename().string())
{
continue;
}
if ("ex4p.v" == entry.path().filename().string())
{
continue;
}
if ("apex1.v" == entry.path().filename().string())
{
continue;
}

std::ostringstream os{};

fiction::network_reader<fiction::tec_ptr> reader{entry.path().string(), os};

const auto nets = reader.get_networks();

auto benchmark_network = *nets.front();

fiction::network_balancing_params ps;
ps.unify_outputs = true;

const auto b = fiction::network_balancing<fiction::technology_network>(
fiction::fanout_substitution<fiction::technology_network>(benchmark_network), ps);

// happens with exp4.v
/*const auto fc = fanins(_b, 9213);

std::cout << "Node 9213: " << fc.fanin_nodes.size() << std::endl;
std::cout << "Node 9213: " << _b.is_buf(9213) << std::endl;*/

// happens with apex1.v
/*const auto fc = fanins(_b, 8771);

std::cout << "Node 9213: " << fc.fanin_nodes.size() << std::endl;
std::cout << "Node 9213: " << _b.is_buf(8771) << std::endl;*/

if (b.size() > 10000)
{
continue;
}

const auto planarized_b = fiction::node_duplication_planarization<fiction::technology_network>(b);
const auto is_planar = fiction::check_planarity(planarized_b);
if (planarized_b.size() > 20000)
{
continue;
}
mockturtle::equivalence_checking_stats st;
const auto cec_m = mockturtle::equivalence_checking(
*fiction::virtual_miter<fiction::technology_network>(benchmark_network, planarized_b), {}, &st);
hibenj marked this conversation as resolved.
Show resolved Hide resolved
assert(cec_m.has_value());

fiction::orthogonal_physical_design_stats stats{};
using gate_layout = fiction::gate_level_layout<
fiction::clocked_layout<fiction::tile_based_layout<fiction::cartesian_layout<fiction::offset::ucoord_t>>>>;
hibenj marked this conversation as resolved.
Show resolved Hide resolved
hibenj marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fiction::offset::ucoord_t" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:7:

- #include "fiction/utils/debug/network_writer.hpp"
+ #include "fiction/layouts/coordinates.hpp"
+ #include "fiction/utils/debug/network_writer.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fiction::offset::ucoord_t" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:7:

- #include "fiction/utils/debug/network_writer.hpp"
+ #include "fiction/layouts/coordinates.hpp"
+ #include "fiction/utils/debug/network_writer.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fiction::offset::ucoord_t" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:7:

- #include "fiction/utils/debug/network_writer.hpp"
+ #include "fiction/layouts/coordinates.hpp"
+ #include "fiction/utils/debug/network_writer.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fiction::offset::ucoord_t" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:7:

- #include "fiction/utils/debug/network_writer.hpp"
+ #include "fiction/layouts/coordinates.hpp"
+ #include "fiction/utils/debug/network_writer.hpp"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fiction::offset::ucoord_t" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:7:

- #include "fiction/utils/debug/network_writer.hpp"
+ #include "fiction/layouts/coordinates.hpp"
+ #include "fiction/utils/debug/network_writer.hpp"

hibenj marked this conversation as resolved.
Show resolved Hide resolved
auto layout = fiction::orthogonal<gate_layout>(planarized_b, {}, &stats);

const fiction::gate_level_drv_params ps_d{};
fiction::gate_level_drv_stats st_d{};

fiction::gate_level_drvs(layout, ps_d, &st_d);
hibenj marked this conversation as resolved.
Show resolved Hide resolved
hibenj marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fiction::gate_level_drvs" is directly included [misc-include-cleaner]

        fiction::gate_level_drvs(layout, ps_d, &st_d);
                 ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fiction::gate_level_drvs" is directly included [misc-include-cleaner]

        fiction::gate_level_drvs(layout, ps_d, &st_d);
                 ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fiction::gate_level_drvs" is directly included [misc-include-cleaner]

        fiction::gate_level_drvs(layout, ps_d, &st_d);
                 ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fiction::gate_level_drvs" is directly included [misc-include-cleaner]

        fiction::gate_level_drvs(layout, ps_d, &st_d);
                 ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "fiction::gate_level_drvs" is directly included [misc-include-cleaner]

        fiction::gate_level_drvs(layout, ps_d, &st_d);
                 ^

hibenj marked this conversation as resolved.
Show resolved Hide resolved

const auto miter = mockturtle::miter<mockturtle::klut_network>(planarized_b, layout);
hibenj marked this conversation as resolved.
Show resolved Hide resolved
hibenj marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "mockturtle::klut_network" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:26:

- #include <mockturtle/utils/stopwatch.hpp>
+ #include <mockturtle/networks/klut.hpp>
+ #include <mockturtle/utils/stopwatch.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "mockturtle::miter" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:25:

- #include <mockturtle/networks/aig.hpp>
+ #include <mockturtle/algorithms/miter.hpp>
+ #include <mockturtle/networks/aig.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "mockturtle::klut_network" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:26:

- #include <mockturtle/utils/stopwatch.hpp>
+ #include <mockturtle/networks/klut.hpp>
+ #include <mockturtle/utils/stopwatch.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "mockturtle::miter" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:25:

- #include <mockturtle/networks/aig.hpp>
+ #include <mockturtle/algorithms/miter.hpp>
+ #include <mockturtle/networks/aig.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "mockturtle::klut_network" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:26:

- #include <mockturtle/utils/stopwatch.hpp>
+ #include <mockturtle/networks/klut.hpp>
+ #include <mockturtle/utils/stopwatch.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "mockturtle::miter" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:25:

- #include <mockturtle/networks/aig.hpp>
+ #include <mockturtle/algorithms/miter.hpp>
+ #include <mockturtle/networks/aig.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "mockturtle::klut_network" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:26:

- #include <mockturtle/utils/stopwatch.hpp>
+ #include <mockturtle/networks/klut.hpp>
+ #include <mockturtle/utils/stopwatch.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "mockturtle::miter" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:25:

- #include <mockturtle/networks/aig.hpp>
+ #include <mockturtle/algorithms/miter.hpp>
+ #include <mockturtle/networks/aig.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "mockturtle::klut_network" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:26:

- #include <mockturtle/utils/stopwatch.hpp>
+ #include <mockturtle/networks/klut.hpp>
+ #include <mockturtle/utils/stopwatch.hpp>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "mockturtle::miter" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:25:

- #include <mockturtle/networks/aig.hpp>
+ #include <mockturtle/algorithms/miter.hpp>
+ #include <mockturtle/networks/aig.hpp>

hibenj marked this conversation as resolved.
Show resolved Hide resolved
hibenj marked this conversation as resolved.
Show resolved Hide resolved
bool eq = false;
if (miter)
{
mockturtle::equivalence_checking_stats st_o;

const auto ce = mockturtle::equivalence_checking(*miter, {}, &st_o);
eq = ce.value();
}
wiring_reduction_exp(entry.path().filename().string(), benchmark_network.num_pis(),
planarized_b.num_virtual_pis(), benchmark_network.num_pos(), benchmark_network.num_gates(),
b.num_gates(), planarized_b.num_gates(), is_planar, cec_m.value(), eq);
wiring_reduction_exp.save();
wiring_reduction_exp.table();
}

static constexpr const std::uint64_t bench_select =
(fiction_experiments::trindade16 | fiction_experiments::fontes18);
for (const auto& benchmark : fiction_experiments::all_benchmarks(bench_select))
{
const auto benchmark_network = read_ntk<fiction::tec_nt>(benchmark);

fiction::network_balancing_params ps;
ps.unify_outputs = true;

const auto b = fiction::network_balancing<fiction::technology_network>(
fiction::fanout_substitution<fiction::technology_network>(benchmark_network), ps);

const auto planarized_b = fiction::node_duplication_planarization<fiction::technology_network>(b);

const auto is_planar = fiction::check_planarity(planarized_b);

if (planarized_b.size() > 20000)
{
wiring_reduction_exp(benchmark, benchmark_network.num_pis(), planarized_b.num_virtual_pis(),
benchmark_network.num_pos(), benchmark_network.num_gates(), b.num_gates(),
planarized_b.num_gates(), is_planar, false, false);
wiring_reduction_exp.save();
wiring_reduction_exp.table();
continue;
}

// check equivalence
mockturtle::equivalence_checking_stats st;
const auto cec_m = mockturtle::equivalence_checking(
*fiction::virtual_miter<fiction::technology_network>(benchmark_network, planarized_b), {}, &st);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

            *fiction::virtual_miter<fiction::technology_network>(benchmark_network, planarized_b), {}, &st);
             ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

            *fiction::virtual_miter<fiction::technology_network>(benchmark_network, planarized_b), {}, &st);
             ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

            *fiction::virtual_miter<fiction::technology_network>(benchmark_network, planarized_b), {}, &st);
             ^

assert(cec_m.has_value());

fiction::orthogonal_physical_design_stats stats{};
using gate_layout = fiction::gate_level_layout<
fiction::clocked_layout<fiction::tile_based_layout<fiction::cartesian_layout<fiction::offset::ucoord_t>>>>;
auto layout = fiction::orthogonal<gate_layout>(planarized_b, {}, &stats);

fiction::gate_level_drv_params ps_d{};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'ps_d' of type 'fiction::gate_level_drv_params' can be declared 'const' [misc-const-correctness]

Suggested change
fiction::gate_level_drv_params ps_d{};
fiction::gate_level_drv_params const ps_d{};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'ps_d' of type 'fiction::gate_level_drv_params' can be declared 'const' [misc-const-correctness]

Suggested change
fiction::gate_level_drv_params ps_d{};
fiction::gate_level_drv_params const ps_d{};

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'ps_d' of type 'fiction::gate_level_drv_params' can be declared 'const' [misc-const-correctness]

Suggested change
fiction::gate_level_drv_params ps_d{};
fiction::gate_level_drv_params const ps_d{};

fiction::gate_level_drv_stats st_d{};

fiction::gate_level_drvs(layout, ps_d, &st_d);

const auto miter = mockturtle::miter<mockturtle::klut_network>(planarized_b, layout);
bool eq = false;
if (miter)
{
mockturtle::equivalence_checking_stats st_o;

const auto ce = mockturtle::equivalence_checking(*miter, {}, &st_o);
eq = ce.value();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

            eq            = ce.value();
                            ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

            eq            = ce.value();
                            ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

            eq            = ce.value();
                            ^

}

// log results
wiring_reduction_exp(benchmark, benchmark_network.num_pis(), planarized_b.num_virtual_pis(),
benchmark_network.num_pos(), benchmark_network.num_gates(), b.num_gates(),
planarized_b.num_gates(), is_planar, cec_m.value(), eq);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

                             planarized_b.num_gates(), is_planar, cec_m.value(), eq);
                                                                  ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

                             planarized_b.num_gates(), is_planar, cec_m.value(), eq);
                                                                  ^

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: unchecked access to optional value [bugprone-unchecked-optional-access]

                             planarized_b.num_gates(), is_planar, cec_m.value(), eq);
                                                                  ^


wiring_reduction_exp.save();
wiring_reduction_exp.table();
}

return EXIT_SUCCESS;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "EXIT_SUCCESS" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:30:

- #include <filesystem>
+ #include <cstdlib>
+ #include <filesystem>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "EXIT_SUCCESS" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:30:

- #include <filesystem>
+ #include <cstdlib>
+ #include <filesystem>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "EXIT_SUCCESS" is directly included [misc-include-cleaner]

experiments/legalization/legalization.cpp:30:

- #include <filesystem>
+ #include <cstdlib>
+ #include <filesystem>

}
Loading
Loading