Skip to content

Commit

Permalink
Merge branch 'main' into legalization
Browse files Browse the repository at this point in the history
  • Loading branch information
hibenj committed Oct 16, 2024
2 parents b4df1c6 + 2e24360 commit 2d5c70a
Show file tree
Hide file tree
Showing 27 changed files with 387 additions and 98 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ env:
jobs:
analyze:
name: Analyze ${{ matrix.language }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
permissions:
actions: read
contents: read
Expand All @@ -47,7 +47,7 @@ jobs:
fail-fast: false
matrix:
language: [ 'cpp', 'python' ]
compiler: [ clang++-11 ]
compiler: [ clang++-17 ]
build_type: [ Debug ]

steps:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pyfiction-pypi-deployment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
run: echo "CIBW_ARCHS_MACOS=arm64" >> $GITHUB_ENV

- name: Build wheel
uses: pypa/cibuildwheel@v2.20.0
uses: pypa/cibuildwheel@v2.21.3
env:
CIBW_BEFORE_ALL_LINUX: /opt/python/cp39-cp39/bin/pip install z3-solver==${{ env.Z3_VERSION }}
CIBW_BUILD: ${{ matrix.python }}-*
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ exclude: "^libs/|^benchmarks/|bindings/pyfiction/include/pyfiction/pybind11_mkdo
repos:
# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
rev: v5.0.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
Expand Down Expand Up @@ -46,7 +46,7 @@ repos:

# clang-format the C++ part of the code base
- repo: https://github.com/pre-commit/mirrors-clang-format
rev: v18.1.8
rev: v19.1.1
hooks:
- id: clang-format
types_or: [ c++, c ]
Expand Down
22 changes: 22 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Walter"
given-names: "Marcel"
orcid: "0000-0001-5660-9518"
- family-names: "Drewniok"
given-names: "Jan"
orcid: "0000-0002-7545-159X"
- family-names: "Hofmann"
given-names: "Simon"
orcid: "0009-0003-8575-9998"
- family-names: "Hien"
given-names: "Benjamin"
orcid: "0000-0002-6878-8063"
- family-names: "Wille"
given-names: "Robert"
orcid: "0000-0002-4993-7860"
title: "The Munich Nanotech Toolkit (MNT)"
version: 0.6.4
doi: 10.1109/NANO61778.2024.10628747
url: "https://github.com/cda-tum/fiction"
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ inline void graph_oriented_layout_design(pybind11::module& m)
DOC(fiction_graph_oriented_layout_design_params_return_first))
.def_readwrite("planar", &fiction::graph_oriented_layout_design_params::planar,
DOC(fiction_graph_oriented_layout_design_params_planar))

;
.def_readwrite("enable_multithreading", &fiction::graph_oriented_layout_design_params::enable_multithreading,
DOC(fiction_graph_oriented_layout_design_params_enable_multithreading));

py::class_<fiction::graph_oriented_layout_design_stats>(m, "graph_oriented_layout_design_stats",
DOC(fiction_graph_oriented_layout_design_stats))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ void logic_simulation(pybind11::module& m, const std::string& type_name)
const auto store_po_names = [&po_names](const NtkOrLyt& ntk_or_lyt)
{
ntk_or_lyt.foreach_po(
[&ntk_or_lyt, &po_names]([[maybe_unused]] const auto& po, auto i) {
[&ntk_or_lyt, &po_names]([[maybe_unused]] const auto& po, auto i)
{
po_names.emplace_back(ntk_or_lyt.has_output_name(i) ? ntk_or_lyt.get_output_name(i) :
fmt::format("po{}", i));
});
Expand Down
32 changes: 30 additions & 2 deletions bindings/pyfiction/include/pyfiction/pybind11_mkdoc_docstrings.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6166,8 +6166,6 @@ static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_max_pl

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_ntk = R"doc(The network to be placed and routed.)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_num_evaluated_paths = R"doc(Count evaluated paths in the search space graphs.)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_num_search_space_graphs = R"doc(Number of search space graphs.)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_num_search_space_graphs_high_efficiency = R"doc(In high-efficiency mode, only 2 search space graphs are used)doc";
Expand Down Expand Up @@ -6272,6 +6270,14 @@ static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_start

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_timeout = R"doc(Timeout limit (in ms).)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_timeout_limit_reached = R"doc(Timeout limit reached.)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_update_stats =
R"doc(This function updates statistical metrics.

Parameter ``best_lyt``:
The new best layout found.)doc";

static const char *__doc_fiction_detail_graph_oriented_layout_design_impl_valid_layout =
R"doc(Validates the given layout based on the nodes in the network and their
mappings in the node dictionary. It checks if the placement of nodes
Expand Down Expand Up @@ -11291,6 +11297,28 @@ wider exploration increases the chance of finding optimal layouts but
also extends runtime. When a solution is found in any graph, its cost
is used to prune the remaining graphs.)doc";

static const char *__doc_fiction_graph_oriented_layout_design_params_enable_multithreading =
R"doc(BETA feature: Flag to enable or disable multithreading during the
execution of the layout design algorithm.

When set to `true`, the algorithm will utilize multiple threads to
process different search space graphs in parallel, improving
performance by distributing the workload across available CPU cores.
If set to `false`, the algorithm will run sequentially on a single
thread.

Only recommended for `HIGH_EFFORT` and `HIGHEST_EFFORT` modes and
complex networks (> 100 nodes).

Enabling multithreading can significantly speed up the algorithm,
especially when using multiple search space graphs and dealing with
complex networks, by concurrently expanding them. However, it may
introduce additional overhead for thread synchronization and can
increase memory usage. It is therefore not recommended for small input
networks.

Default value: `false`)doc";

static const char *__doc_fiction_graph_oriented_layout_design_params_mode = R"doc(The effort mode used. Defaults to HIGH_EFFORT.)doc";

static const char *__doc_fiction_graph_oriented_layout_design_params_num_vertex_expansions =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,8 @@ void charge_distribution_surface_layout(pybind11::module& m, const std::string&
"increase_charge_index_by_one",
[](py_cds& cds, fiction::dependent_cell_mode dependent_cell_fixed,
fiction::energy_calculation recompute_system_energy,
fiction::charge_distribution_history consider_history, fiction::exact_sidb_simulation_engine engine) {
fiction::charge_distribution_history consider_history, fiction::exact_sidb_simulation_engine engine)
{
return cds.increase_charge_index_by_one(dependent_cell_fixed, recompute_system_energy, consider_history,
engine);
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def test_graph_oriented_layout_design_with_different_parameters(self):
params.num_vertex_expansions = 5
params.planar = False
params.cost = gold_cost_objective.WIRES
params.enable_multithreading = False

layout = graph_oriented_layout_design(network, params)

Expand All @@ -76,5 +77,17 @@ def custom_cost_objective(layout):

self.assertNotEqual(equivalence_checking(network, layout), eq_type.NO)

def test_graph_oriented_layout_design_with_multithreading(self):
network = read_technology_network(dir_path + "/../../resources/mux21.v")

params = graph_oriented_layout_design_params()
params.return_first = True
params.mode = gold_effort_mode.HIGH_EFFORT
params.enable_multithreading = True

layout = graph_oriented_layout_design(network, params)

self.assertNotEqual(equivalence_checking(network, layout), eq_type.NO)

if __name__ == '__main__':
unittest.main()
1 change: 1 addition & 0 deletions cli/cmd/physical_design/gold.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class gold_command : public command
add_flag("--return_first,-r", ps.return_first,
"Terminate on the first found layout; reduces runtime but might sacrifice result quality");
add_flag("--planar,-p", ps.planar, "Enable planar layout generation");
add_flag("--multithreading,-m", ps.enable_multithreading, "Enable multithreading (beta feature)");
add_flag("--verbose,-v", ps.verbose, "Be verbose");
}

Expand Down
14 changes: 4 additions & 10 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,8 @@ All notable changes to this project will be documented in this file.

The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_.

Unreleased```
-------------

Added
#####
- Experiments:
- Script to conduct 3-state physical simulation of SiDB layouts.

Unreleased```
-------------
Unreleased
----------

Added
#####
Expand All @@ -23,6 +15,7 @@ Added
- Algorithms:
- Added support for different ways of implementing input information in SiDB technology to the BDL input iterator


v0.6.4 - 2024-08-30
-------------------

Expand All @@ -44,6 +37,7 @@ Fixed
- Fixed several typos and docstrings in the codebase
- Addressed some ``clang-tidy`` warnings


v0.6.3 - 2024-08-22
-------------------

Expand Down
6 changes: 3 additions & 3 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
sphinx==8.0.2
sphinx==8.1.0
breathe==4.35.0
sphinx-rtd-theme==3.0.0rc1
sphinx-tabs==3.4.5
sphinx-rtd-theme==3.0.1
sphinx-tabs==3.4.7
z3-solver>=4.8.0
12 changes: 8 additions & 4 deletions include/fiction/algorithms/physical_design/exact.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,8 @@ class exact_impl
{
layout.foreach_outgoing_clocked_zone(
t,
[this, &t, &disj, &tgt, &ae](const auto& at) {
[this, &t, &disj, &tgt, &ae](const auto& at)
{
disj.push_back((get_tn(at, tgt) || get_te(at, ae)) &&
get_tc(t, at));
});
Expand Down Expand Up @@ -1180,7 +1181,8 @@ class exact_impl
{
layout.foreach_incoming_clocked_zone(
t,
[this, &t, &disj, &src, &iae](const auto& iat) {
[this, &t, &disj, &src, &iae](const auto& iat)
{
disj.push_back((get_tn(iat, src) || get_te(iat, iae)) &&
get_tc(iat, t));
});
Expand Down Expand Up @@ -1528,7 +1530,8 @@ class exact_impl
else
{
network.foreach_pi(
[this, &restrict_2ddwave_entry_tiles](const auto& pi) {
[this, &restrict_2ddwave_entry_tiles](const auto& pi)
{
network.foreach_fanout(pi, [&restrict_2ddwave_entry_tiles](const auto& fn)
{ restrict_2ddwave_entry_tiles(fn); });
});
Expand All @@ -1549,7 +1552,8 @@ class exact_impl
else
{
network.foreach_po(
[this, &define_length](const auto& po) {
[this, &define_length](const auto& po)
{
network.foreach_fanin(po, [this, &define_length](const auto& fi)
{ define_length(network.get_node(fi)); });
});
Expand Down
Loading

0 comments on commit 2d5c70a

Please sign in to comment.