SILICON
Loading...
Searching...
No Matches
arithmetic.cpp
Go to the documentation of this file.
1/*
2 Copyright (c) 2026. Giulio Cocconi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
16 */
17
18#include "tests.hpp"
19#include <core/circuit.hpp>
20#include <core/simulator.hpp>
22#include <stdexcept>
23#include <utility>
24#include <vector>
25
26using namespace SILICON::core;
27using namespace SILICON::extra;
28using namespace SILICON::simulation;
29using namespace SILICON::waveform;
30
31TEST(ArithmeticTest, HalfAdderCase)
32{
33 auto a = std::make_shared<Wire>(State::LOW);
34 auto b = std::make_shared<Wire>(State::LOW);
35 auto sum = std::make_shared<Wire>();
36 auto cout = std::make_shared<Wire>();
37
38 auto ha = std::make_shared<HalfAdder>(std::array<Wire_ptr, 2>{a, b}, sum, cout);
39 auto circ = std::make_shared<Circuit>(Component_set{ha});
40 Simulator sim(circ);
41 sim.run(20);
42
43 EXPECT_EQ(sum->getCurrentState(), State::LOW);
44 EXPECT_EQ(cout->getCurrentState(), State::LOW);
45
46 sim.setBus(Bus{b}, valueFor(Bus{b}, 1));
47 sim.run(20);
48 EXPECT_EQ(sum->getCurrentState(), State::HIGH);
49 EXPECT_EQ(cout->getCurrentState(), State::LOW);
50
51 sim.setBus(Bus{a}, valueFor(Bus{a}, 1));
52 sim.run(20);
53 EXPECT_EQ(sum->getCurrentState(), State::LOW);
54 EXPECT_EQ(cout->getCurrentState(), State::HIGH);
55}
56
57TEST(ArithmeticTest, ExtenderSupportsUnsignedSignedAndNarrowingModes)
58{
59 const auto evaluate = [](const unsigned short inSize, const unsigned short outSize,
60 const std::string& mode, const unsigned int value) {
61 auto input = Bus(inSize);
62 auto output = Bus(outSize);
63 auto extender = std::make_shared<Extender>(input, output, mode);
64 auto circuit = std::make_shared<Circuit>(Component_set{extender});
65 Simulator simulator(circuit);
66 simulator.setBus(input, valueFor(input, value));
67 if (simulator.runUntilIdle() != Simulator::RunResult::Completed)
68 throw std::runtime_error("Extender simulation did not complete");
69 return output.getCurrentValue();
70 };
71
72 EXPECT_EQ(evaluate(3, 5, std::string(Extender::UNSIGNED_MODE), 6), valueFor(5, 6));
73 EXPECT_EQ(evaluate(3, 5, std::string(Extender::SIGNED_MODE), 6), valueFor(5, 30));
74 EXPECT_EQ(evaluate(5, 3, std::string(Extender::SIGNED_MODE), 29), valueFor(3, 5));
75}
76
77TEST(ArithmeticTest, ShifterUsesBusValueShiftSemantics)
78{
79 Bus value(4), amount(8), output(4);
80 auto shifter = std::make_shared<Shifter>(value, amount, output);
81 Simulator sim(std::make_shared<Circuit>(Component_set{shifter}));
82 sim.setBus(value, valueFor(value, 9));
83 sim.setBus(amount, valueFor(amount, 1));
84 ASSERT_EQ(sim.runUntilIdle(), Simulator::RunResult::Completed);
85 EXPECT_EQ(output.getCurrentValue(), valueFor(output, 4));
86
87 shifter->setProperty("signed", true);
88 sim.setBus(amount, valueFor(amount, 2));
89 ASSERT_EQ(sim.runUntilIdle(), Simulator::RunResult::Completed);
90 EXPECT_EQ(output.getCurrentValue(), valueFor(output, 14));
91
92 shifter->setProperty("mode", std::string(Shifter::LEFT_MODE));
93 sim.setBus(amount, valueFor(amount, 1));
94 ASSERT_EQ(sim.runUntilIdle(), Simulator::RunResult::Completed);
95 EXPECT_EQ(output.getCurrentValue(), valueFor(output, 2));
96
97 sim.setBus(amount, valueFor(amount, 255));
98 ASSERT_EQ(sim.runUntilIdle(), Simulator::RunResult::Completed);
99 EXPECT_EQ(output.getCurrentValue(), valueFor(output, 0));
100}
101
102TEST(ArithmeticTest, ShifterValidatesAndResizesBuses)
103{
104 auto shifter = std::make_shared<Shifter>(Bus(4), Bus(3), Bus(4));
105 EXPECT_EQ(shifter->getPropertyValue<bool>("signed"), false);
106 EXPECT_EQ(shifter->getPropertyValue<int>("amountSize"), 3);
107 shifter->setProperty("size", 6);
108 shifter->setProperty("amountSize", 5);
109 EXPECT_EQ(shifter->inputBuses()[0].size(), 6);
110 EXPECT_EQ(shifter->inputBuses()[1].size(), 5);
111 EXPECT_EQ(shifter->outputBuses()[0].size(), 6);
112 EXPECT_THROW(shifter->setProperty("size", 0), std::invalid_argument);
113 EXPECT_THROW(shifter->setProperty("amountSize", 0), std::invalid_argument);
114 EXPECT_THROW(shifter->setProperty("mode", std::string("invalid")), std::invalid_argument);
115 EXPECT_THROW((void)Shifter(Bus(4), Bus(2), Bus(3)), std::invalid_argument);
116}
117
118TEST(ArithmeticTest, ExtenderPropertiesValidateAndReshapeBuses)
119{
120 auto extender = std::make_shared<Extender>();
121 EXPECT_EQ(extender->getPropertyValue<int>("inSize"), 4);
122 EXPECT_EQ(extender->getPropertyValue<int>("outSize"), 8);
123 EXPECT_EQ(extender->getPropertyValue<std::string>("mode"),
124 std::string(Extender::UNSIGNED_MODE));
125 EXPECT_TRUE(extender->getInputs().empty());
126 EXPECT_TRUE(extender->getOutputs().empty());
127 EXPECT_THROW(extender->setProperty("inSize", 0), std::invalid_argument);
128 EXPECT_THROW(extender->setProperty("outSize", -1), std::invalid_argument);
129 EXPECT_THROW(extender->setProperty("mode", std::string("invalid")),
130 std::invalid_argument);
131 EXPECT_THROW((void)Extender(Bus(), Bus(4)), std::invalid_argument);
132
133 extender =
134 std::make_shared<Extender>(Bus(3), Bus(5), std::string(Extender::SIGNED_MODE));
135 EXPECT_EQ(extender->getPropertyValue<int>("inSize"), 3);
136 EXPECT_EQ(extender->getPropertyValue<int>("outSize"), 5);
137 EXPECT_EQ(extender->getPropertyValue<std::string>("mode"),
138 std::string(Extender::SIGNED_MODE));
139
140 extender->setProperty("inSize", 4);
141 extender->setProperty("outSize", 7);
142 EXPECT_EQ(extender->getInputs()[0].size(), 4);
143 EXPECT_EQ(extender->getOutputs()[0].size(), 7);
144}
145
146TEST(ArithmeticTest, ComplementerComputesFixedWidthTwosComplement)
147{
148 auto input = Bus(4);
149 auto output = Bus(4);
150 auto complementer = std::make_shared<Complementer>(input, output);
151 auto circuit = std::make_shared<Circuit>(Component_set{complementer});
152 Simulator simulator(circuit);
153
154 for (const auto [value, expected] : std::vector<std::pair<unsigned int, unsigned int>>{
155 {0, 0}, {1, 15}, {3, 13}, {8, 8}, {15, 1}}) {
156 simulator.setBus(input, valueFor(input, value));
157 ASSERT_EQ(simulator.runUntilIdle(), Simulator::RunResult::Completed);
158 EXPECT_EQ(output.getCurrentValue(), valueFor(output, expected));
159 }
160}
161
162TEST(ArithmeticTest, ComplementerValidatesAndReshapesItsWidth)
163{
164 auto complementer = std::make_shared<Complementer>();
165 EXPECT_EQ(complementer->getPropertyValue<int>("size"), 4);
166 EXPECT_TRUE(complementer->getInputs().empty());
167 EXPECT_TRUE(complementer->getOutputs().empty());
168 EXPECT_THROW(complementer->setProperty("size", 0), std::invalid_argument);
169 EXPECT_THROW(complementer->setProperty("size", -1), std::invalid_argument);
170
171 EXPECT_THROW((void)Complementer(Bus(), Bus()), std::invalid_argument);
172 EXPECT_THROW((void)Complementer(Bus(3), Bus(4)), std::invalid_argument);
173
174 complementer = std::make_shared<Complementer>(Bus(5), Bus(5));
175 EXPECT_EQ(complementer->getPropertyValue<int>("size"), 5);
176 complementer->setProperty("size", 8);
177 EXPECT_EQ(complementer->getInputs()[0].size(), 8);
178 EXPECT_EQ(complementer->getOutputs()[0].size(), 8);
179}
180
181TEST(ArithmeticTest, AdderNBitsFromComponents)
182{
183 auto a = Bus(4);
184 auto b = Bus(4);
185 auto sum = Bus(4);
186
187 auto partialCarryWires = Bus(5);
188
189 Component_set comps;
190
191 Wire_ptr cout = partialCarryWires[4];
192
193 for (int i = 0; i < 5; i++) {
194 partialCarryWires[i]->forceSetCurrentState(State::LOW);
195 }
196
197 a.forceSetCurrentValue(valueFor(a, 0));
198 b.forceSetCurrentValue(valueFor(b, 0));
199 sum.forceSetCurrentValue(valueFor(sum, 0));
200
201 for (int i = 0; i < 4; i++) {
202 auto fa = std::make_shared<FullAdder>(std::array<Wire_ptr, 2>{a[i], b[i]},
203 partialCarryWires[i], sum[i],
204 partialCarryWires[i + 1]);
205 comps.insert(fa);
206 }
207
208 auto circ = std::make_shared<Circuit>(comps);
209 Simulator sim(circ);
210
211 sim.setBus(a, valueFor(a, 0));
212 sim.setBus(b, valueFor(b, 0));
213 sim.run(100);
214
215 EXPECT_EQ(cout->getCurrentState(), State::LOW);
216 EXPECT_EQ(sum.getCurrentValue(), valueFor(sum, 0));
217
218 sim.setBus(a, valueFor(a, 0b1100));
219 sim.setBus(b, valueFor(b, 0b0011));
220 sim.run(100);
221
222 EXPECT_EQ(cout->getCurrentState(), State::LOW);
223 EXPECT_EQ(sum.getCurrentValue(), valueFor(sum, 0b1111));
224
225 sim.setBus(b, valueFor(b, 0b1100));
226 sim.setBus(a, valueFor(a, 0b0011));
227 sim.run(100);
228
229 EXPECT_EQ(cout->getCurrentState(), State::LOW);
230 EXPECT_EQ(sum.getCurrentValue(), valueFor(sum, 0b1111));
231
232 sim.setBus(a, valueFor(a, 0b1111));
233 sim.setBus(b, valueFor(b, 0b0001));
234 sim.run(100);
235
236 EXPECT_EQ(cout->getCurrentState(), State::HIGH);
237 EXPECT_EQ(sum.getCurrentValue(), valueFor(sum, 0));
238}
239
240TEST(ArithmeticTest, AdderNBitsAtomic)
241{
242 auto a = Bus(4);
243 auto b = Bus(4);
244 auto sum = Bus(4);
245 auto cout = std::make_shared<Wire>();
246
247 auto adder = std::make_shared<AdderNBits>(std::array<Bus, 2>{a, b}, sum, cout);
248 auto circ = std::make_shared<Circuit>(Component_set{adder});
249 Simulator sim(circ);
250
251 sim.setBus(a, valueFor(a, 0));
252 sim.setBus(b, valueFor(b, 0));
253 sim.run(100);
254
255 EXPECT_EQ(cout->getCurrentState(), State::LOW);
256 EXPECT_EQ(sum.getCurrentValue(), valueFor(sum, 0));
257
258 sim.setBus(a, valueFor(a, 0b1100));
259 sim.setBus(b, valueFor(b, 0b0011));
260 sim.run(100);
261
262 EXPECT_EQ(cout->getCurrentState(), State::LOW);
263 EXPECT_EQ(sum.getCurrentValue(), valueFor(sum, 0b1111));
264
265 sim.setBus(b, valueFor(b, 0b1100));
266 sim.setBus(a, valueFor(a, 0b0011));
267 sim.run(100);
268
269 EXPECT_EQ(cout->getCurrentState(), State::LOW);
270 EXPECT_EQ(sum.getCurrentValue(), valueFor(sum, 0b1111));
271
272 sim.setBus(a, valueFor(a, 0b1111));
273 sim.setBus(b, valueFor(b, 0b0001));
274 sim.run(100);
275
276 EXPECT_EQ(cout->getCurrentState(), State::HIGH);
277 EXPECT_EQ(sum.getCurrentValue(), valueFor(sum, 0));
278}
279
280TEST(ArithmeticTest, DelayedAdderReschedulesUnchangedOutputBits)
281{
282 auto a = Bus(4);
283 auto b = Bus(4);
284 auto sum = Bus(4);
285 auto cout = std::make_shared<Wire>();
286
287 auto adder = std::make_shared<AdderNBits>(std::array<Bus, 2>{a, b}, sum, cout);
288 adder->setProperty("delay", 5);
289
290 auto circ = std::make_shared<Circuit>(Component_set{adder});
291 Simulator sim(circ);
292
293 const std::vector<Sample> inputSnapshots{
294 {0, {busValueFromBits("0000"), busValueFromBits("0000")}},
295 {2, {busValueFromBits("0100"), busValueFromBits("0101")}},
296 };
297 const std::vector<Simulator::WaveformInputDriver> inputDrivers{
298 {a, {}},
299 {b, {}},
300 };
301
302 EXPECT_EQ(sim.simulateWaveform(6, inputSnapshots, inputDrivers),
304 for (const auto& wire : sum)
305 EXPECT_EQ(wire->getCurrentState(), State::UNKNOWN);
306
307 EXPECT_EQ(sim.run(1), Simulator::RunResult::Completed);
308 EXPECT_EQ(sum.getCurrentValue(), valueFor(sum, 0b1001));
309}
310
311TEST(ArithmeticTest, AdderNBitsSizePropertyDefaultsAndValidation)
312{
313 auto adder = std::make_shared<AdderNBits>();
314
315 EXPECT_EQ(adder->getPropertyValue<int>("size"), 4);
316 EXPECT_TRUE(adder->getInputs().empty());
317 EXPECT_TRUE(adder->getOutputs().empty());
318
319 EXPECT_THROW(adder->setProperty("size", 0), std::invalid_argument);
320 EXPECT_THROW(adder->setProperty("size", -1), std::invalid_argument);
321}
322
323TEST(ArithmeticTest, AdderNBitsSizePropertyReshapesIO)
324{
325 auto adder = std::make_shared<AdderNBits>(std::array<Bus, 2>{Bus(4), Bus(4)}, Bus(4),
326 std::make_shared<Wire>());
327
328 ASSERT_EQ(adder->getInputs().size(), 2);
329 ASSERT_EQ(adder->getOutputs().size(), 2);
330 EXPECT_EQ(adder->getPropertyValue<int>("size"), 4);
331
332 adder->setProperty("size", 8);
333
334 EXPECT_EQ(adder->getPropertyValue<int>("size"), 8);
335 EXPECT_EQ(adder->getInputs()[0].size(), 8);
336 EXPECT_EQ(adder->getInputs()[1].size(), 8);
337 EXPECT_EQ(adder->getOutputs()[0].size(), 8);
338 EXPECT_EQ(adder->getOutputs()[1].size(), 1);
339}
340
341TEST(ArithmeticTest, MultiplierAndDividerComputeSignedAndUnsignedResults)
342{
343 for (const bool sign : {false, true}) {
344 Bus a(4), b(4), product(4), quotient(4), remainder(4);
345 auto multiplier = std::make_shared<Multiplier>(std::array<Bus, 2>{a, b}, product);
346 auto divider =
347 std::make_shared<Divider>(std::array<Bus, 2>{a, b}, quotient, remainder);
348 multiplier->setProperty("signed", sign);
349 divider->setProperty("signed", sign);
350 Simulator sim(std::make_shared<Circuit>(Component_set{multiplier, divider}));
351 for (unsigned av = 0; av < 16; ++av) {
352 for (unsigned bv = 0; bv < 16; ++bv) {
353 SCOPED_TRACE(::testing::Message() << sign << ": " << av << ", " << bv);
354 sim.setBus(a, valueFor(a, av));
355 sim.setBus(b, valueFor(b, bv));
356 ASSERT_EQ(sim.runUntilIdle(), Simulator::RunResult::Completed);
357 const int lhs = sign && av >= 8 ? static_cast<int>(av) - 16 : av;
358 const int rhs = sign && bv >= 8 ? static_cast<int>(bv) - 16 : bv;
359 EXPECT_EQ(product.getCurrentValue(), valueFor(product, (lhs * rhs) & 15));
360 if (rhs == 0) {
361 EXPECT_EQ(quotient.getCurrentValue(), BusValue(4, State::UNKNOWN));
362 EXPECT_EQ(remainder.getCurrentValue(), BusValue(4, State::UNKNOWN));
363 } else {
364 EXPECT_EQ(quotient.getCurrentValue(), valueFor(quotient, (lhs / rhs) & 15));
365 EXPECT_EQ(remainder.getCurrentValue(), valueFor(remainder, (lhs % rhs) & 15));
366 }
367 }
368 }
369 }
370}
371
372TEST(ArithmeticTest, MultiplierAndDividerSupportWideBuses)
373{
374 Bus a(128), b(128), product(128), quotient(128), remainder(128);
375 auto multiplier = std::make_shared<Multiplier>(std::array<Bus, 2>{a, b}, product);
376 auto divider = std::make_shared<Divider>(std::array<Bus, 2>{a, b}, quotient, remainder);
377 Simulator sim(std::make_shared<Circuit>(Component_set{multiplier, divider}));
378 const BigInt lhs = (BigInt(1) << 100) + 5;
379 const BigInt rhs = (BigInt(1) << 70) + 3;
380 sim.setBus(a, busValueFromInteger(lhs, 128));
381 sim.setBus(b, busValueFromInteger(rhs, 128));
382 ASSERT_EQ(sim.runUntilIdle(), Simulator::RunResult::Completed);
383 EXPECT_EQ(product.getCurrentValue(), busValueFromInteger(lhs * rhs, 128));
384 EXPECT_EQ(quotient.getCurrentValue(), busValueFromInteger(lhs / rhs, 128));
385 EXPECT_EQ(remainder.getCurrentValue(), busValueFromInteger(lhs % rhs, 128));
386}
387
388TEST(ArithmeticTest, MultiplierAndDividerPropagateNonBinaryInputs)
389{
390 Bus a(4), b(4), product(4), quotient(4), remainder(4);
391 auto multiplier = std::make_shared<Multiplier>(std::array<Bus, 2>{a, b}, product);
392 auto divider = std::make_shared<Divider>(std::array<Bus, 2>{a, b}, quotient, remainder);
393 Simulator sim(std::make_shared<Circuit>(Component_set{multiplier, divider}));
394 for (const auto state : {State::UNKNOWN, State::ERROR}) {
395 sim.setBus(a, BusValue(4, state));
396 sim.setBus(b, valueFor(b, 1));
397 ASSERT_EQ(sim.runUntilIdle(), Simulator::RunResult::Completed);
398 EXPECT_EQ(product.getCurrentValue(), BusValue(4, state));
399 EXPECT_EQ(quotient.getCurrentValue(), BusValue(4, state));
400 EXPECT_EQ(remainder.getCurrentValue(), BusValue(4, state));
401 }
402 // A known zero divisor produces X even when the dividend contains an error.
403 sim.setBus(b, valueFor(b, 0));
404 ASSERT_EQ(sim.runUntilIdle(), Simulator::RunResult::Completed);
405 EXPECT_EQ(quotient.getCurrentValue(), BusValue(4, State::UNKNOWN));
406 EXPECT_EQ(remainder.getCurrentValue(), BusValue(4, State::UNKNOWN));
407}
408
409TEST(ArithmeticTest, MultiplierAndDividerValidateAndResizeProperties)
410{
411 std::vector<Component_ptr> components{
412 std::make_shared<Multiplier>(std::array<Bus, 2>{Bus(4), Bus(4)}, Bus(4)),
413 std::make_shared<Divider>(std::array<Bus, 2>{Bus(4), Bus(4)}, Bus(4), Bus(4))};
414 for (const auto& component : components) {
415 EXPECT_EQ(component->getPropertyValue<bool>("signed"), false);
416 component->setProperty("size", 7);
417 for (const auto& bus : component->inputBuses())
418 EXPECT_EQ(bus.size(), 7);
419 for (const auto& bus : component->outputBuses())
420 EXPECT_EQ(bus.size(), 7);
421 EXPECT_THROW(component->setProperty("size", 0), std::invalid_argument);
422 EXPECT_THROW(component->setProperty("size", 65536), std::invalid_argument);
423 EXPECT_THROW(component->setProperty("delay", -1), std::invalid_argument);
424 }
425 EXPECT_THROW((void)Multiplier({Bus(3), Bus(4)}, Bus(4)), std::invalid_argument);
426 EXPECT_THROW((void)Multiplier({Bus(), Bus()}, Bus()), std::invalid_argument);
427 EXPECT_THROW((void)Divider({Bus(4), Bus(4)}, Bus(4), Bus(3)), std::invalid_argument);
428 EXPECT_THROW((void)Divider({Bus(), Bus()}, Bus(), Bus()), std::invalid_argument);
429}
430
431TEST(ArithmeticTest, MultiplierAndDividerApplyPropagationDelay)
432{
433 Bus a(4), b(4), product(4), quotient(4), remainder(4);
434 auto multiplier = std::make_shared<Multiplier>(std::array<Bus, 2>{a, b}, product);
435 auto divider = std::make_shared<Divider>(std::array<Bus, 2>{a, b}, quotient, remainder);
436 multiplier->setProperty("delay", 5);
437 divider->setProperty("delay", 5);
438 Simulator sim(std::make_shared<Circuit>(Component_set{multiplier, divider}));
439 sim.setBus(a, valueFor(a, 7));
440 sim.setBus(b, valueFor(b, 2));
441 ASSERT_EQ(sim.run(4), Simulator::RunResult::Completed);
442 EXPECT_EQ(product.getCurrentValue(), BusValue(4, State::UNKNOWN));
443 EXPECT_EQ(quotient.getCurrentValue(), BusValue(4, State::UNKNOWN));
444 EXPECT_EQ(remainder.getCurrentValue(), BusValue(4, State::UNKNOWN));
445 ASSERT_EQ(sim.run(1), Simulator::RunResult::Completed);
446 EXPECT_EQ(product.getCurrentValue(), valueFor(product, 14));
447 EXPECT_EQ(quotient.getCurrentValue(), valueFor(quotient, 3));
448 EXPECT_EQ(remainder.getCurrentValue(), valueFor(remainder, 1));
449}
BusValue getCurrentValue() const
Definition wire.cpp:530
Gives the two's complement of a number.
Changes a bus width using signed or unsigned extension.
static constexpr std::string_view UNSIGNED_MODE
static constexpr std::string_view SIGNED_MODE
static constexpr std::string_view LEFT_MODE
Executes event-driven simulation of a Circuit.
Definition simulator.hpp:74
RunResult setBus(Bus bus, BusValue value, CancellationCheck isCancelled={})
Forces a bus to a specific value and propagates the change through the circuit.
RunResult run(uint64_t duration, CancellationCheck isCancelled={})
Executes the simulation for a specified duration.
std::shared_ptr< Wire > Wire_ptr
Definition wire.hpp:116
boost::multiprecision::cpp_int BigInt
std::set< Component_ptr, std::owner_less< Component_ptr > > Component_set
Definition wire.hpp:54
BusValue busValueFromBits(const std::string_view bits)
Strictly decodes an MSB-first raw string containing 0, 1, X, or E.
BusValue busValueFromInteger(const BigInt &value, const std::size_t width)
Builds an LSB-first BusValue from the low width bits of an integer. Negative values use two's complem...
std::vector< State > BusValue
Definition wire.hpp:120
TEST(ArithmeticTest, HalfAdderCase)
BusValue valueFor(const Bus &bus, const std::uint64_t value)
Definition tests.hpp:11