diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml
index 172a106b2..d7f840ba0 100644
--- a/.github/workflows/coverage.yml
+++ b/.github/workflows/coverage.yml
@@ -68,7 +68,7 @@ jobs:
- name: Build
working-directory: ${{github.workspace}}/build
- run: cmake --build . --config $BUILD_TYPE -j2
+ run: cmake --build . --config $BUILD_TYPE
- name: Test
working-directory: ${{github.workspace}}/build
diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml
index ab6c3cb8e..9e5bf0bbb 100644
--- a/.github/workflows/macos.yml
+++ b/.github/workflows/macos.yml
@@ -7,40 +7,40 @@ defaults:
shell: bash
env:
- Z3_GIT_TAG: z3-4.8.12
+ Z3_GIT_TAG: z3-4.10.0
jobs:
build_and_test:
strategy:
matrix:
- os: [ macos-10.15 ] # macos-11 when supported
- compiler: [ g++-9, g++-10, clang++ ] # clang++12
+ os: [ macos-11, macos-12 ]
+ compiler: [ g++-11, clang++ ]
build_type: [ Debug, Release ]
include:
- - compiler: g++-9
- ccompiler: gcc
- - compiler: g++-10
- ccompiler: gcc
- compiler: clang++
ccompiler: clang
+ - compiler: g++-11
+ ccompiler: gcc
+ - os: macos-11
+ compiler: g++-9
+ build_type: Debug
+ - os: macos-11
+ compiler: g++-9
+ build_type: Release
+ ccompiler: gcc
+ - os: macos-11
+ compiler: g++-10
+ ccompiler: gcc
+ build_type: Debug
+ - os: macos-11
+ compiler: g++-10
+ ccompiler: gcc
+ build_type: Release
name: ${{matrix.os}} with ${{matrix.compiler}} (${{matrix.build_type}} mode)
runs-on: ${{matrix.os}}
steps:
- - name: Setup Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.9.x'
-
- - name: Install pip packages
- uses: BSFishy/pip-action@v1
- with:
- packages: |
- graphviz
- python-sat==0.1.6.dev6
- wrapt_timeout_decorator
-
- name: Clone Repository
uses: actions/checkout@v3
with:
@@ -67,7 +67,7 @@ jobs:
- name: Configure CMake
working-directory: ${{github.workspace}}/build
- run: cmake ${{github.workspace}} -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DFICTION_CLI=ON -DFICTION_TEST=ON -DFICTION_Z3=ON -DFICTION_Z3_SEARCH_PATHS=${{github.workspace}}/z3lib -DFICTION_ENABLE_MUGEN=ON -DFICTION_PROGRESS_BARS=OFF -DMOCKTURTLE_EXAMPLES=OFF -DWARNINGS_AS_ERRORS=OFF
+ run: cmake ${{github.workspace}} -DCMAKE_CXX_COMPILER=${{matrix.compiler}} -DCMAKE_BUILD_TYPE=${{matrix.build_type}} -DFICTION_CLI=ON -DFICTION_TEST=ON -DFICTION_Z3=ON -DFICTION_Z3_SEARCH_PATHS=${{github.workspace}}/z3lib -DFICTION_PROGRESS_BARS=OFF -DMOCKTURTLE_EXAMPLES=OFF -DWARNINGS_AS_ERRORS=OFF
- name: Build
working-directory: ${{github.workspace}}/build
diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml
index 091643536..face0d8ba 100644
--- a/.github/workflows/ubuntu.yml
+++ b/.github/workflows/ubuntu.yml
@@ -7,18 +7,32 @@ defaults:
shell: bash
env:
- Z3_GIT_TAG: z3-4.8.12
+ Z3_GIT_TAG: z3-4.10.0
jobs:
build_and_test:
strategy:
matrix:
- os: [ ubuntu-20.04, ubuntu-18.04 ]
- compiler: [ g++-9, g++-10, clang++-9, clang++-10 ]
+ os: [ ubuntu-18.04, ubuntu-20.04, ubuntu-22.04 ]
+ compiler: [ g++-9, g++-10, clang++-10, clang++-11, clang++-12 ]
build_type: [ Debug, Release ]
+ exclude:
+ - os: ubuntu-18.04
+ compiler: clang++-11
+ - os: ubuntu-18.04
+ compiler: clang++-12
+ - os: ubuntu-22.04
+ compiler: clang++-10
include:
+ - os: ubuntu-18.04
+ compiler: clang++-9
+ build_type: Debug
+ - os: ubuntu-18.04
+ compiler: clang++-9
+ build_type: Release
- os: ubuntu-20.04
compiler: g++-10
+ build_type: Release
cppstandard: -DFICTION_CXX_STANDARD=20
cppname: C++20
@@ -34,19 +48,16 @@ jobs:
with:
python-version: '3.9.x'
- - name: Install pip packages
- uses: BSFishy/pip-action@v1
- with:
- packages: |
- graphviz
- python-sat==0.1.6.dev6
- wrapt_timeout_decorator
-
- name: Clone Repository
uses: actions/checkout@v3
with:
submodules: recursive
+ - name: Install pip packages
+ uses: BSFishy/pip-action@v1
+ with:
+ requirements: ${{github.workspace}}/libs/mugen/requirements.txt
+
- name: Cache Z3 Solver
id: cache-z3-solver
uses: actions/cache@v3
diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml
index d165d176b..d8286bb7a 100644
--- a/.github/workflows/windows.yml
+++ b/.github/workflows/windows.yml
@@ -7,28 +7,25 @@ defaults:
shell: pwsh # use pwsh as directory handling does not seem to work with bash
env:
- Z3_GIT_TAG: z3-4.8.12
+ Z3_GIT_TAG: z3-4.10.0
jobs:
build_and_test:
strategy:
matrix:
- os: [ windows-2019 ]
+ os: [ windows-2019, windows-2022 ]
toolset: [ v142, ClangCL ]
build_type: [ Debug, Release ]
include:
- os: windows-2019
env: "Visual Studio 16 2019"
+ - os: windows-2022
+ env: "Visual Studio 17 2022"
name: ${{matrix.os}} with ${{matrix.env}} and ${{matrix.toolset}} toolset (${{matrix.build_type}} mode)
runs-on: ${{matrix.os}}
steps:
- - name: Setup Python
- uses: actions/setup-python@v4
- with:
- python-version: '3.9.x'
-
- name: Clone Repository
uses: actions/checkout@v3
with:
diff --git a/README.md b/README.md
index 9b5127f25..431a04753 100644
--- a/README.md
+++ b/README.md
@@ -124,9 +124,9 @@ Built-in schemes are
|:--------------------------------------------------------:|:------------------------------------------------------------------------:|:-------------------------------------------------------------------------:|
| | | |
-| [BANCS](https://ieeexplore.ieee.org/document/8533251) |
-|:------------------------------------------------------------:|
-| |
+| [CFE](https://ietresearch.onlinelibrary.wiley.com/doi/10.1049/iet-cds.2019.0096) | [BANCS](https://ieeexplore.ieee.org/document/8533251) |
+|:------------------------------------------------------------------------------------:|:------------------------------------------------------------:|
+| | |
plus the mentioned irregular open clocking that works via a clock map instead of a regular extrapolated cutout.
diff --git a/cli/cmd/physical_design/exact.hpp b/cli/cmd/physical_design/exact.hpp
index 498c7ca8d..0431542e6 100644
--- a/cli/cmd/physical_design/exact.hpp
+++ b/cli/cmd/physical_design/exact.hpp
@@ -38,7 +38,7 @@ class exact_command : public command
{
add_option("--clk_scheme,-s", clocking,
"Clocking scheme to use {OPEN[3|4], COLUMNAR[3|4], ROW[3|4] 2DDWAVE[3|4], 2DDWAVEHEX[3|4], USE, "
- "RES, ESP, BANCS}",
+ "RES, ESP, CFE, BANCS}",
true);
add_option("--upper_bound,-u", ps.upper_bound, "Number of FCN gate tiles to use at maximum");
add_option("--fixed_size,-f", ps.fixed_size, "Execute only one iteration with the given number of tiles");
diff --git a/cli/cmd/physical_design/onepass.hpp b/cli/cmd/physical_design/onepass.hpp
index 623679c1f..12fea14e2 100644
--- a/cli/cmd/physical_design/onepass.hpp
+++ b/cli/cmd/physical_design/onepass.hpp
@@ -48,7 +48,8 @@ class onepass_command : public command
"resulting from this approach might be desynchronized. I/Os are always located at the "
"layout's borders.")
{
- add_option("--clk_scheme,-s", clocking, "Clocking scheme to use {2DDWAVE[3|4], USE, RES, ESP, BANCS}", true);
+ add_option("--clk_scheme,-s", clocking, "Clocking scheme to use {2DDWAVE[3|4], USE, RES, ESP, CFE, BANCS}",
+ true);
add_option("--upper_bound,-u", ps.upper_bound, "Number of FCN gate tiles to use at maximum");
add_option("--fixed_size,-f", ps.fixed_size, "Execute only one iteration with the given number of tiles");
add_option("--timeout,-t", ps.timeout, "Timeout in seconds");
diff --git a/docs/_static/cfe.png b/docs/_static/cfe.png
new file mode 100644
index 000000000..11238c0c4
Binary files /dev/null and b/docs/_static/cfe.png differ
diff --git a/docs/getting_started.rst b/docs/getting_started.rst
index 6824db203..99a82054b 100644
--- a/docs/getting_started.rst
+++ b/docs/getting_started.rst
@@ -101,7 +101,7 @@ It has some further Python dependencies that can be installed via ``pip3``::
pip3 install python-sat==0.1.6.dev6 wrapt_timeout_decorator graphviz
The Python3 integration is experimental and may cause issues on some systems. It is currently not available on Windows
-due to issues with ``python-sat``. Mugen requires at least Python 3.7!
+and some macOS versions due to issues with ``python-sat``. Mugen requires at least Python 3.7!
Finally, before building *fiction*, pass ``-DFICTION_ENABLE_MUGEN=ON`` to the ``cmake`` call.
diff --git a/docs/layouts/clocking_scheme.rst b/docs/layouts/clocking_scheme.rst
index 7a5106ade..f80c6a659 100644
--- a/docs/layouts/clocking_scheme.rst
+++ b/docs/layouts/clocking_scheme.rst
@@ -72,6 +72,14 @@ ESP
.. doxygenfunction:: fiction::esp_clocking
+CFE
+###
+
+.. figure:: /_static/cfe.png
+ :width: 200
+
+.. doxygenfunction:: fiction::cfe_clocking
+
BANCS
#####
diff --git a/include/fiction/layouts/clocking_scheme.hpp b/include/fiction/layouts/clocking_scheme.hpp
index bfb6681a1..714b44c20 100644
--- a/include/fiction/layouts/clocking_scheme.hpp
+++ b/include/fiction/layouts/clocking_scheme.hpp
@@ -158,6 +158,7 @@ static constexpr const char* twoddwave_hex = "2DDWAVEHEX";
static constexpr const char* use = "USE";
static constexpr const char* res = "RES";
static constexpr const char* esp = "ESP";
+static constexpr const char* cfe = "CFE";
static constexpr const char* bancs = "BANCS";
} // namespace clock_name
@@ -349,11 +350,23 @@ static auto twoddwave_clocking(const num_clks& n = num_clks::FOUR) noexcept
template
static auto twoddwave_hex_clocking(const num_clks& n = num_clks::FOUR) noexcept
{
+ // clang-format off
+
static constexpr std::array>::clock_number, 3u>, 6u>
- odd_3_cutout{{{{0, 1, 2}}, {{1, 2, 0}}, {{1, 2, 0}}, {{2, 0, 1}}, {{2, 0, 1}}, {{0, 1, 2}}}};
+ odd_3_cutout{{{{0, 1, 2}},
+ {{1, 2, 0}},
+ {{1, 2, 0}},
+ {{2, 0, 1}},
+ {{2, 0, 1}},
+ {{0, 1, 2}}}};
static constexpr std::array>::clock_number, 3u>, 6u>
- even_3_cutout{{{{0, 1, 2}}, {{0, 1, 2}}, {{1, 2, 0}}, {{1, 2, 0}}, {{2, 0, 1}}, {{2, 0, 1}}}};
+ even_3_cutout{{{{0, 1, 2}},
+ {{0, 1, 2}},
+ {{1, 2, 0}},
+ {{1, 2, 0}},
+ {{2, 0, 1}},
+ {{2, 0, 1}}}};
static constexpr std::array>::clock_number, 4u>, 8u>
odd_4_cutout{{{{0, 1, 2, 3}},
@@ -375,6 +388,8 @@ static auto twoddwave_hex_clocking(const num_clks& n = num_clks::FOUR) noexcept
{{3, 0, 1, 2}},
{{3, 0, 1, 2}}}};
+ // clang-format on
+
static const typename clocking_scheme>::clock_function odd_row_twoddwave_hex_3_clock_function =
[](const clock_zone& cz) noexcept { return odd_3_cutout[cz.y % 6ul][cz.x % 3ul]; };
@@ -516,16 +531,23 @@ static auto twoddwave_hex_clocking(const num_clks& n = num_clks::FOUR) noexcept
template
static auto use_clocking() noexcept
{
+ // clang-format off
+
static const typename clocking_scheme>::clock_function use_clock_function =
[](const clock_zone& cz) noexcept
{
constexpr std::array>::clock_number, 4u>, 4u> cutout{
- {{{0, 1, 2, 3}}, {{3, 2, 1, 0}}, {{2, 3, 0, 1}}, {{1, 0, 3, 2}}}};
+ {{{0, 1, 2, 3}},
+ {{3, 2, 1, 0}},
+ {{2, 3, 0, 1}},
+ {{1, 0, 3, 2}}}};
return cutout[cz.y % 4ul][cz.x % 4ul];
};
return clocking_scheme{clock_name::use, use_clock_function, std::min(Lyt::max_fanin_size, 2u), 2u, 4u, true};
+
+ // clang-format on
}
/**
* Returns the RES clocking as defined in "An efficient clocking scheme for quantum-dot cellular automata" by
@@ -538,16 +560,23 @@ static auto use_clocking() noexcept
template
static auto res_clocking() noexcept
{
+ // clang-format off
+
static const typename clocking_scheme>::clock_function res_clock_function =
[](const clock_zone& cz) noexcept
{
constexpr std::array>::clock_number, 4u>, 4u> cutout{
- {{{3, 0, 1, 2}}, {{0, 1, 0, 3}}, {{1, 2, 3, 0}}, {{0, 3, 2, 1}}}};
+ {{{3, 0, 1, 2}},
+ {{0, 1, 0, 3}},
+ {{1, 2, 3, 0}},
+ {{0, 3, 2, 1}}}};
return cutout[cz.y % 4ul][cz.x % 4ul];
};
return clocking_scheme{clock_name::res, res_clock_function, std::min(Lyt::max_fanin_size, 3u), 3u, 4u, true};
+
+ // clang-format on
}
/**
* Returns the ESP (Zig-Zag) clocking as defined in "Regular Clocking based Emerging Technique in QCA Targeting Low
@@ -560,16 +589,52 @@ static auto res_clocking() noexcept
template
static auto esp_clocking() noexcept
{
+ // clang-format off
+
static const typename clocking_scheme>::clock_function esp_clock_function =
[](const clock_zone& cz) noexcept
{
constexpr std::array>::clock_number, 4u>, 4u> cutout{
- {{{3, 0, 1, 2}}, {{0, 1, 2, 3}}, {{1, 2, 3, 0}}, {{0, 3, 2, 1}}}};
+ {{{3, 0, 1, 2}},
+ {{0, 1, 2, 3}},
+ {{1, 2, 3, 0}},
+ {{0, 3, 2, 1}}}};
return cutout[cz.y % 4ul][cz.x % 4ul];
};
return clocking_scheme{clock_name::esp, esp_clock_function, std::min(Lyt::max_fanin_size, 3u), 3u, 4u, true};
+
+ // clang-format on
+}
+/**
+ * Returns the CFE clocking as defined in "CFE: a convenient, flexible, and efficient clocking scheme for quantum-dot
+ * cellular automata" by Feifei Deng, Guang-Jun Xie, Xin Cheng, Zhang Zhang, and Yongqiang Zhang in IET Circuits,
+ * Devices & Systems 2020.
+ *
+ * @tparam Lyt Clocked layout type.
+ * @return CFE clocking scheme.
+ */
+template
+static auto cfe_clocking() noexcept
+{
+ // clang-format off
+
+ static const typename clocking_scheme>::clock_function cfe_clock_function =
+ [](const clock_zone& cz) noexcept
+ {
+ constexpr std::array>::clock_number, 4u>, 4u> cutout{
+ {{{0, 1, 0, 1}},
+ {{3, 2, 3, 2}},
+ {{0, 1, 0, 1}},
+ {{3, 2, 3, 2}}}};
+
+ return cutout[cz.y % 4ul][cz.x % 4ul];
+ };
+
+ return clocking_scheme{clock_name::cfe, cfe_clock_function, std::min(Lyt::max_fanin_size, 3u), 3u, 4u, true};
+
+ // clang-format on
}
/**
* Returns the BANCS clocking as defined in "BANCS: Bidirectional Alternating Nanomagnetic Clocking Scheme" by
@@ -581,16 +646,25 @@ static auto esp_clocking() noexcept
template
static auto bancs_clocking() noexcept
{
+ // clang-format off
+
static const typename clocking_scheme>::clock_function bancs_clock_function =
[](const clock_zone& cz) noexcept
{
constexpr std::array>::clock_number, 3u>, 6u> cutout{
- {{{0, 1, 2}}, {{2, 1, 0}}, {{2, 0, 1}}, {{1, 0, 2}}, {{1, 2, 0}}, {{0, 2, 1}}}};
+ {{{0, 1, 2}},
+ {{2, 1, 0}},
+ {{2, 0, 1}},
+ {{1, 0, 2}},
+ {{1, 2, 0}},
+ {{0, 2, 1}}}};
return cutout[cz.y % 6ul][cz.x % 3ul];
};
return clocking_scheme{clock_name::bancs, bancs_clock_function, std::min(Lyt::max_fanin_size, 2u), 2u, 3u, true};
+
+ // clang-format on
}
/**
* Returns a smart pointer to the given scheme.
@@ -655,6 +729,7 @@ std::optional>> get_clocking_scheme(const std::s
{clock_name::use, use_clocking()},
{clock_name::res, res_clocking()},
{clock_name::esp, esp_clocking()},
+ {clock_name::cfe, cfe_clocking()},
{clock_name::bancs, bancs_clocking()}};
auto upper_name = name;
diff --git a/libs/mugen/requirements.txt b/libs/mugen/requirements.txt
new file mode 100644
index 000000000..e692a27c0
--- /dev/null
+++ b/libs/mugen/requirements.txt
@@ -0,0 +1,3 @@
+python-sat==0.1.6.dev6
+wrapt_timeout_decorator
+graphviz
diff --git a/test/algorithms/physical_design/exact.cpp b/test/algorithms/physical_design/exact.cpp
index b4ac014ce..69d780866 100644
--- a/test/algorithms/physical_design/exact.cpp
+++ b/test/algorithms/physical_design/exact.cpp
@@ -84,6 +84,22 @@ exact_physical_design_params&& res(exact_physical_design_params&& ps)
return std::move(ps);
}
+template
+exact_physical_design_params&& esp(exact_physical_design_params&& ps) noexcept
+{
+ ps.scheme = std::make_shared>>(esp_clocking());
+
+ return std::move(ps);
+}
+
+template
+exact_physical_design_params&& cfe(exact_physical_design_params&& ps) noexcept
+{
+ ps.scheme = std::make_shared>>(cfe_clocking());
+
+ return std::move(ps);
+}
+
template
exact_physical_design_params&& crossings(exact_physical_design_params&& ps) noexcept
{
@@ -279,6 +295,16 @@ TEST_CASE("Exact Cartesian physical design", "[exact]")
check_with_gate_library(
blueprints::and_or_network(), res(crossings(configuration())));
}
+ SECTION("ESP clocking")
+ {
+ check_with_gate_library(
+ blueprints::and_or_network(), esp(crossings(configuration())));
+ }
+ SECTION("CFE clocking")
+ {
+ check_with_gate_library(
+ blueprints::and_or_network(), cfe(crossings(configuration())));
+ }
SECTION("Border I/O")
{
check_with_gate_library(
diff --git a/test/layouts/clocking_scheme.cpp b/test/layouts/clocking_scheme.cpp
index 28243cde1..fa541240d 100644
--- a/test/layouts/clocking_scheme.cpp
+++ b/test/layouts/clocking_scheme.cpp
@@ -1617,6 +1617,86 @@ TEST_CASE("4-phase RES", "[clocking-scheme]")
CHECK(res4({3 + 4, 3 + 4}) == 1);
}
+TEST_CASE("4-phase CFE", "[clocking-scheme]")
+{
+ using clk_lyt = clocked_layout>;
+
+ const auto cfe4 = cfe_clocking();
+
+ CHECK(cfe4.num_clocks == 4u);
+ CHECK(cfe4.max_in_degree == 3u);
+ CHECK(cfe4.max_out_degree == 3u);
+ CHECK(cfe4.is_regular());
+
+ CHECK(cfe4({0, 0}) == 0);
+ CHECK(cfe4({0, 1}) == 3);
+ CHECK(cfe4({0, 2}) == 0);
+ CHECK(cfe4({0, 3}) == 3);
+ CHECK(cfe4({1, 0}) == 1);
+ CHECK(cfe4({1, 1}) == 2);
+ CHECK(cfe4({1, 2}) == 1);
+ CHECK(cfe4({1, 3}) == 2);
+ CHECK(cfe4({2, 0}) == 0);
+ CHECK(cfe4({2, 1}) == 3);
+ CHECK(cfe4({2, 2}) == 0);
+ CHECK(cfe4({2, 3}) == 3);
+ CHECK(cfe4({3, 0}) == 1);
+ CHECK(cfe4({3, 1}) == 2);
+ CHECK(cfe4({3, 2}) == 1);
+ CHECK(cfe4({3, 3}) == 2);
+
+ CHECK(cfe4({0 + 4, 0}) == 0);
+ CHECK(cfe4({0 + 4, 1}) == 3);
+ CHECK(cfe4({0 + 4, 2}) == 0);
+ CHECK(cfe4({0 + 4, 3}) == 3);
+ CHECK(cfe4({1 + 4, 0}) == 1);
+ CHECK(cfe4({1 + 4, 1}) == 2);
+ CHECK(cfe4({1 + 4, 2}) == 1);
+ CHECK(cfe4({1 + 4, 3}) == 2);
+ CHECK(cfe4({2 + 4, 0}) == 0);
+ CHECK(cfe4({2 + 4, 1}) == 3);
+ CHECK(cfe4({2 + 4, 2}) == 0);
+ CHECK(cfe4({2 + 4, 3}) == 3);
+ CHECK(cfe4({3 + 4, 0}) == 1);
+ CHECK(cfe4({3 + 4, 1}) == 2);
+ CHECK(cfe4({3 + 4, 2}) == 1);
+ CHECK(cfe4({3 + 4, 3}) == 2);
+
+ CHECK(cfe4({0, 0 + 4}) == 0);
+ CHECK(cfe4({0, 1 + 4}) == 3);
+ CHECK(cfe4({0, 2 + 4}) == 0);
+ CHECK(cfe4({0, 3 + 4}) == 3);
+ CHECK(cfe4({1, 0 + 4}) == 1);
+ CHECK(cfe4({1, 1 + 4}) == 2);
+ CHECK(cfe4({1, 2 + 4}) == 1);
+ CHECK(cfe4({1, 3 + 4}) == 2);
+ CHECK(cfe4({2, 0 + 4}) == 0);
+ CHECK(cfe4({2, 1 + 4}) == 3);
+ CHECK(cfe4({2, 2 + 4}) == 0);
+ CHECK(cfe4({2, 3 + 4}) == 3);
+ CHECK(cfe4({3, 0 + 4}) == 1);
+ CHECK(cfe4({3, 1 + 4}) == 2);
+ CHECK(cfe4({3, 2 + 4}) == 1);
+ CHECK(cfe4({3, 3 + 4}) == 2);
+
+ CHECK(cfe4({0 + 4, 0 + 4}) == 0);
+ CHECK(cfe4({0 + 4, 1 + 4}) == 3);
+ CHECK(cfe4({0 + 4, 2 + 4}) == 0);
+ CHECK(cfe4({0 + 4, 3 + 4}) == 3);
+ CHECK(cfe4({1 + 4, 0 + 4}) == 1);
+ CHECK(cfe4({1 + 4, 1 + 4}) == 2);
+ CHECK(cfe4({1 + 4, 2 + 4}) == 1);
+ CHECK(cfe4({1 + 4, 3 + 4}) == 2);
+ CHECK(cfe4({2 + 4, 0 + 4}) == 0);
+ CHECK(cfe4({2 + 4, 1 + 4}) == 3);
+ CHECK(cfe4({2 + 4, 2 + 4}) == 0);
+ CHECK(cfe4({2 + 4, 3 + 4}) == 3);
+ CHECK(cfe4({3 + 4, 0 + 4}) == 1);
+ CHECK(cfe4({3 + 4, 1 + 4}) == 2);
+ CHECK(cfe4({3 + 4, 2 + 4}) == 1);
+ CHECK(cfe4({3 + 4, 3 + 4}) == 2);
+}
+
TEST_CASE("3-phase BANCS", "[clocking-scheme]")
{
using clk_lyt = clocked_layout>;
@@ -1847,6 +1927,7 @@ TEST_CASE("Clocking lookup", "[clocking-scheme]")
check({"use", "USE", "uSe", "UsE"}, clock_name::use);
check({"res", "RES", "rEs", "ReS"}, clock_name::res);
check({"esp", "ESP", "eSp", "EsP"}, clock_name::esp);
+ check({"cfe", "CFE", "cFe", "CfE"}, clock_name::cfe);
check({"bancs", "BANCS", "BaNCs", "banCS"}, clock_name::bancs);
CHECK(!get_clocking_scheme("").has_value());
@@ -1857,6 +1938,7 @@ TEST_CASE("Clocking lookup", "[clocking-scheme]")
CHECK(!get_clocking_scheme("SUE").has_value());
CHECK(!get_clocking_scheme("ERS").has_value());
CHECK(!get_clocking_scheme("EPS").has_value());
+ CHECK(!get_clocking_scheme("CEF").has_value());
CHECK(!get_clocking_scheme("BNCS").has_value());
}
@@ -1872,6 +1954,7 @@ TEST_CASE("Linear schemes", "[clocking-scheme]")
CHECK(!is_linear_scheme(*get_clocking_scheme(clock_name::open)));
CHECK(!is_linear_scheme(*get_clocking_scheme(clock_name::use)));
CHECK(!is_linear_scheme(*get_clocking_scheme(clock_name::res)));
- CHECK(!is_linear_scheme(*get_clocking_scheme(clock_name::bancs)));
CHECK(!is_linear_scheme(*get_clocking_scheme(clock_name::esp)));
+ CHECK(!is_linear_scheme(*get_clocking_scheme(clock_name::cfe)));
+ CHECK(!is_linear_scheme(*get_clocking_scheme(clock_name::bancs)));
}