Clocking Schemes¶
Header: fiction/layouts/clocking_scheme.hpp
Clocking is one of the most important differences between conventional CMOS technologies and the FCN domain. Clocking directs information flow and provides a notion of timing for both combinational and sequential circuits alike. Usually, clocking information is assigned to the coordinates of a layout by the means of a clocking scheme.
This header provides the clocking::scheme value type, which assigns a clock number to every tile position
\((x, y)\) of a gate-level or tile-clocked cell-level layout by repeating a rectangular cutout in all directions, as well
as pre-defined schemes from the literature. Schemes can be copied, assigned, and compared, and individual clock numbers
can be overridden.
Scheme Types¶
-
class unsupported_scheme_exception : public std::exception¶
Exception to be thrown when an unsupported clocking scheme is requested.
-
class scheme¶
Clocking scheme that assigns a clock number to every tile position \((x, y)\). Clocking schemes are owned by gate and tile-clocked cell layouts. A clock zone spans every layer, so a scheme has no z-coordinate.
A clocking scheme is defined by a rectangular cutout that repeats seamlessly in all directions, including negative coordinates. Clock numbers can be overridden per tile. Many regular clocking schemes have been proposed in the literature; the factories below construct them.
Schemes are values: they can be copied, assigned, and compared. Two schemes are equal iff their names, phase counts, degrees, cutouts, regularity, and overridden clock numbers are equal.
Public Types
-
using clock_number = uint8_t¶
Clock phase index.
-
using degree = uint8_t¶
Number of inputs or outputs of a clock zone.
Public Functions
-
scheme() noexcept = default¶
Creates a four-phase OPEN scheme without allocating storage.
-
inline scheme(std::string n, const std::vector<std::vector<clock_number>> &cutout, const clock_number num_clocks, const degree max_in_degree, const degree max_out_degree, const bool regular = true)¶
Standard constructor.
- Parameters:
n – The clocking scheme’s stored name. Construction does not register the scheme with
get_scheme.cutout – Rows of clock numbers. Row
y, columnxholds the clock number of every tile \((x + i \cdot w, y + j \cdot h)\) for all integers \(i, j\), where \(w\) and \(h\) are the width and height ofcutout.num_clocks – Number of clock phases that make up one clock cycle. Must be 3 or 4.
max_in_degree – Maximum number of inputs the scheme supports per clock zone.
max_out_degree – Maximum number of outputs the scheme supports per clock zone.
regular – Flag to identify the scheme as regular.
- Throws:
std::invalid_argument – if
cutoutis empty or not rectangular, ifnum_clocksis neither 3 nor 4, or if an entry ofcutoutis not belownum_clocks.
-
inline scheme &operator=(const scheme &other)¶
Replaces the scheme with an independent copy. Copy failure preserves this scheme.
- Parameters:
other – Scheme to copy.
- Throws:
std::bad_alloc – If allocation fails.
- Returns:
This scheme.
-
~scheme() = default¶
Releases owned clocking state.
-
inline clock_number operator()(const int64_t x, const int64_t y) const noexcept¶
Returns the clock number of the tile at \((x, y)\): its overridden clock number if one exists, and the repeated cutout entry otherwise.
- Parameters:
x – x-coordinate of the tile.
y – y-coordinate of the tile.
- Returns:
Clock number of \((x, y)\).
-
inline void override_clock_number(const int64_t x, const int64_t y, const clock_number cn)¶
Overrides the clock number of the tile at \((x, y)\). An overridden scheme is irregular.
- Parameters:
x – x-coordinate of the tile.
y – y-coordinate of the tile.
cn – Clock number to assign. The scheme stores
cn % num_clocks().
- Throws:
std::bad_alloc – If allocation fails.
-
inline bool is_regular() const noexcept¶
Checks for the clocking scheme’s regularity.
- Returns:
trueiff the scheme is regular and no clock number is overridden.
-
inline std::string_view name() const noexcept¶
Name of the clocking scheme.
The view borrows storage from this scheme. Keep the scheme alive and unchanged while using the view, or copy it with
std::string{scheme.name()}.- Returns:
The name supplied at construction, or
"OPEN"for a default-constructed scheme. Catalog factories use canonical names, e.g.,"2DDWAVE", without a phase-count suffix.
-
inline clock_number num_clocks() const noexcept¶
Number of clock phases in this scheme.
- Returns:
3 or 4.
-
inline degree max_in_degree() const noexcept¶
Maximum number of inputs the scheme supports per clock zone.
- Returns:
Maximum in-degree, or
UNBOUNDED.
-
inline degree max_out_degree() const noexcept¶
Maximum number of outputs the scheme supports per clock zone.
- Returns:
Maximum out-degree, or
UNBOUNDED.
-
using clock_number = uint8_t¶
-
enum class fiction::layouts::clocking::num_clks : uint8_t¶
Number of clock phases of a clocking scheme.
Values:
-
enumerator THREE¶
Three clocks.
-
enumerator FOUR¶
Four clocks.
-
enumerator THREE¶
The Hexagonal Layout page documents the arrangement type.
Pre-Defined Schemes¶
Open¶
-
inline scheme fiction::layouts::clocking::open(const num_clks n = num_clks::FOUR)¶
Returns an irregular clocking that maps every tile to clock number 0. It is intended to be overridden. Its degrees are
scheme::UNBOUNDED, i.e., only the layout topology bounds them.- Parameters:
n – Number of clocks.
- Returns:
Irregular clocking scheme.
Columnar¶
-
inline scheme fiction::layouts::clocking::columnar(const num_clks n = num_clks::FOUR)¶
Returns a linear 1D clocking as originally introduced in “A device architecture for computing with quantum dots” by C. S. Lent and P. D. Tougaw in the Proceedings of the IEEE 1997.
- Parameters:
n – Number of clocks.
- Returns:
Columnar clocking scheme.
Row¶
-
inline scheme fiction::layouts::clocking::row(const num_clks n = num_clks::FOUR)¶
Returns a 90° rotated linear 1D clocking based on the one originally introduced in “A device architecture for computing with quantum dots” by C. S. Lent and P. D. Tougaw in the Proceedings of the IEEE 1997.
- Parameters:
n – Number of clocks.
- Returns:
Row-based clocking scheme.
2DDWave¶
-
inline scheme fiction::layouts::clocking::twoddwave(const num_clks n = num_clks::FOUR)¶
Returns the 2DDWave clocking as defined in “Clocking and Cell Placement for QCA” by V. Vankamamidi, M. Ottavi, and F. Lombardi in IEEE Conference on Nanotechnology 2006.
- Parameters:
n – Number of clocks.
- Returns:
2DDWave clocking scheme.
-
inline scheme fiction::layouts::clocking::twoddwave_hex(const arrangement a, const num_clks n = num_clks::FOUR)¶
Returns a hexagonal variation of the 2DDWave clocking as originally defined in “Clocking and Cell Placement for QCA” by V. Vankamamidi, M. Ottavi, and F. Lombardi in IEEE Conference on Nanotechnology 2006.
- Parameters:
a – Arrangement of the hexagonal layout’s shifted rows or columns.
n – Number of clocks.
- Returns:
Hexagonal 2DDWave clocking scheme.
USE¶
RES¶
-
inline scheme fiction::layouts::clocking::res()¶
Returns the RES clocking as defined in “An efficient clocking scheme for quantum-dot cellular automata” by Mrinal Goswami, Anindan Mondal, Mahabub Hasan Mahalat, Bibhash Sen, and Biplab K. Sikdar in International Journal of Electronics Letters 2019.
- Returns:
RES clocking scheme.
ESR¶
-
inline scheme fiction::layouts::clocking::esr()¶
Returns the ESR clocking as defined in “An efficient, scalable, regular clocking scheme based on quantum dot cellular automata” by Jayanta Pal, Amit Kumar Pramanik, Jyotirmoy Sil Sharma, Apu Kumar Saha, and Bibhash Sen in Analog Integrated Circuits and Signal Processing 2021.
- Returns:
ESR clocking scheme.
CFE¶
-
inline scheme fiction::layouts::clocking::cfe()¶
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.
- Returns:
CFE clocking scheme.
Ripple¶
SRS¶
-
inline scheme fiction::layouts::clocking::srs()¶
Returns the SRS clocking as defined in “Simple, robust and systematic QCA clocking scheme for area-efficient nanocircuits” by Mrinal Goswami, Tonmoy Jyoti Sharma, and Arpita Nath Boruah in International Journal of Electronics Letters 2025.
- Returns:
SRS clocking scheme.
BANCS¶
Utility Functions¶
-
inline bool fiction::layouts::clocking::is_linear(const scheme &scm) noexcept¶
Checks whether a given clocking scheme is registered as a cycle-free one. These currently are
COLUMNAR
ROW
2DDWAVE
2DDWAVEHEX
- Parameters:
scm – Clocking scheme to check.
- Returns:
trueiffscmis listed as one of the linear clocking schemes.
-
inline std::optional<scheme> fiction::layouts::clocking::get_scheme(const std::string_view scheme_name, const std::optional<arrangement> hex = std::nullopt)¶
Returns a catalog clocking scheme by name. The lookup ignores case and accepts a trailing
3or4that selects the phase count of a scheme that supports it. Without a suffix, a scheme has its default phase count: 3 for BANCS and 4 for all others.2DDWAVEHEXrequires a hexagonal arrangement and falls back to2DDWAVEwithout one.- Parameters:
scheme_name – Name of the desired clocking scheme.
hex – Arrangement of the hexagonal layout the scheme is for, or
std::nulloptfor a non-hexagonal layout.
- Returns:
Clocking scheme that matches
scheme_name, orstd::nulloptif no clocking scheme by that name exists or the scheme does not support the requested phase count.