SILICON
Loading...
Searching...
No Matches
fstWrapper.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"
20#include <core/fstWrapper.hpp>
21#include <core/gates.hpp>
22#include <core/siliconFst.hpp>
23#include <core/simulator.hpp>
24
25#include <algorithm>
26#include <cstdio>
27#include <map>
28#include <stdexcept>
29#include <string>
30#include <vector>
31
32using namespace SILICON::core;
33using namespace SILICON::simulation;
34using namespace SILICON::waveform;
35using namespace SILICON::waveform::fst;
36
37// --- Helper Utilities ------------------------------------------------------------------
38
39// RAII helper to clean up generated test files
41 std::string filename;
42 ~FileCleanup() { std::remove(filename.c_str()); }
43};
44
45// Represents a captured waveform event for verification
46struct WaveEvent {
47 uint64_t time;
48 fstHandle handle;
49 std::string value;
50
51 bool operator==(const WaveEvent& other) const
52 {
53 return time == other.time && handle == other.handle && value == other.value;
54 }
55};
56
57// GTest printer for elegant diagnostic output instead of raw bytes
58inline void PrintTo(const WaveEvent& ev, std::ostream* os)
59{
60 *os << "{time: " << ev.time << ", handle: " << ev.handle << ", val: '" << ev.value
61 << "'}";
62}
63
64// --- Tests -----------------------------------------------------------------------------
65
66TEST(FstWrapperTest, ThrowsOnMissingFile)
67{
68 EXPECT_THROW(Reader("nonexistent_path_12345.fst"), std::runtime_error);
69}
70
71TEST(FstWrapperTest, MetadataAndBasicIO)
72{
73 const std::string filename = "test_metadata.fst";
74 FileCleanup cleanup{filename};
75
76 fstHandle h_clk, h_rst;
77
78 {
79 HierarchyBuilder builder(filename);
80 builder.setTimeScale(-9); // nanoseconds
81 builder.setDate("2026-01-01");
82 builder.setVersion("FST Wrapper Test");
83
84 builder.setScope(FST_ST_VCD_MODULE, "TestBench");
85 h_clk = builder.createVar(FST_VT_VCD_WIRE, FST_VD_IMPLICIT, 1, "clk");
86 h_rst = builder.createVar(FST_VT_VCD_WIRE, FST_VD_IMPLICIT, 1, "rst");
87 builder.upScope();
88
89 auto writer = std::move(builder).finish();
90
91 writer.emitTimeChange(0);
92 writer.emitValueChange(h_rst, "1");
93 writer.emitValueChange(h_clk, "0");
94
95 writer.emitTimeChange(10);
96 writer.emitValueChange(h_rst, "0");
97 writer.emitValueChange(h_clk, "1");
98 }
99
100 Reader reader(filename);
101
102 EXPECT_EQ(reader.getTimescale(), -9);
103 EXPECT_EQ(reader.getDate(), "2026-01-01");
104 EXPECT_EQ(reader.getVersion(), "FST Wrapper Test");
105 EXPECT_EQ(reader.getStartTime(), 0);
106 EXPECT_EQ(reader.getEndTime(), 10);
107 EXPECT_EQ(reader.getVarCount(), 2);
108 EXPECT_EQ(reader.getScopeCount(), 1);
109
110 std::vector<WaveEvent> events;
111 reader.setFacProcessMaskAll();
112
113 reader.readIterateBlocks(
114 [&](uint64_t t, fstHandle h, std::string_view v, uint32_t len) {
115 events.push_back({t, h, std::string(v)});
116 });
117
118 // libfst iteration yields events grouped by signal/block, not strictly by time.
119 // We sort them chronologically (then by handle) to ensure safe predictable comparisons.
120 std::sort(events.begin(), events.end(), [](const WaveEvent& a, const WaveEvent& b) {
121 if (a.time != b.time)
122 return a.time < b.time;
123 return a.handle < b.handle;
124 });
125
126 ASSERT_EQ(events.size(), 4);
127 EXPECT_EQ(events[0], (WaveEvent{0, h_clk, "0"}));
128 EXPECT_EQ(events[1], (WaveEvent{0, h_rst, "1"}));
129 EXPECT_EQ(events[2], (WaveEvent{10, h_clk, "1"}));
130 EXPECT_EQ(events[3], (WaveEvent{10, h_rst, "0"}));
131}
132
133TEST(FstWrapperTest, HierarchyTreeConstruction)
134{
135 const std::string filename = "test_hierarchy.fst";
136 FileCleanup cleanup{filename};
137
138 {
139 HierarchyBuilder builder(filename);
140
141 builder.setScope(FST_ST_VCD_MODULE, "Top");
142 builder.createVar(FST_VT_VCD_WIRE, FST_VD_INPUT, 1, "clk");
143
144 builder.setScope(FST_ST_VCD_TASK, "TaskA", "CompA");
145 builder.createVar(FST_VT_VCD_REG, FST_VD_OUTPUT, 8, "data");
146 builder.upScope();
147 builder.upScope();
148
149 auto writer = std::move(builder).finish();
150 }
151
152 Reader reader(filename);
153 auto top = reader.buildHierarchyTree();
154
155 EXPECT_EQ(top.name, "Top");
156 EXPECT_EQ(top.type, FST_ST_VCD_MODULE);
157 ASSERT_EQ(top.vars.size(), 1);
158 EXPECT_EQ(top.vars[0].name, "clk");
159 EXPECT_EQ(top.vars[0].length, 1);
160
161 ASSERT_EQ(top.children.size(), 1);
162 const auto& task = top.children[0];
163 EXPECT_EQ(task.name, "TaskA");
164 EXPECT_EQ(task.component, "CompA");
165 EXPECT_EQ(task.type, FST_ST_VCD_TASK);
166 ASSERT_EQ(task.vars.size(), 1);
167 EXPECT_EQ(task.vars[0].name, "data");
168}
169
170TEST(FstWrapperTest, NumericAndVariableLengthEmissions)
171{
172 const std::string filename = "test_emissions.fst";
173 FileCleanup cleanup{filename};
174
175 fstHandle h_32, h_64, h_varlen;
176
177 {
178 HierarchyBuilder builder(filename);
179 builder.setScope(FST_ST_VCD_MODULE, "Core");
180 h_32 = builder.createVar(FST_VT_VCD_INTEGER, FST_VD_IMPLICIT, 4, "val32");
181 h_64 = builder.createVar(FST_VT_VCD_INTEGER, FST_VD_IMPLICIT, 4, "val64");
182 h_varlen = builder.createVar(FST_VT_GEN_STRING, FST_VD_IMPLICIT, 0, "valstr");
183 auto writer = std::move(builder).finish();
184
185 writer.emitTimeChange(5);
186 writer.emitValue32(h_32, 4, 0xA);
187 writer.emitValue64(h_64, 4, 0x5);
188 writer.emitVariableLengthValueChange(h_varlen, "Hello_FST");
189 }
190
191 Reader reader(filename);
192 reader.setFacProcessMaskAll();
193
194 std::map<fstHandle, std::string> latest_vals;
195 reader.readIterateBlocks([&](uint64_t t, fstHandle h, std::string_view v,
196 uint32_t len) { latest_vals[h] = std::string(v); });
197
198 EXPECT_EQ(latest_vals[h_32], "1010");
199 EXPECT_EQ(latest_vals[h_64], "0101");
200 EXPECT_EQ(latest_vals[h_varlen], "Hello_FST");
201}
202
203TEST(FstWrapperTest, TimeRangeFiltering)
204{
205 const std::string filename = "test_timerange.fst";
206 FileCleanup cleanup{filename};
207
208 fstHandle h_clk;
209 {
210 HierarchyBuilder builder(filename);
211 builder.setScope(FST_ST_VCD_MODULE, "TB");
212 h_clk = builder.createVar(FST_VT_VCD_WIRE, FST_VD_IMPLICIT, 1, "clk");
213 auto writer = std::move(builder).finish();
214
215 // Generate a trace from time 10 to 50
216 for (uint64_t t = 10; t <= 50; t += 10) {
217 writer.emitTimeChange(t);
218 writer.emitValueChange(h_clk, (t % 20 == 0) ? "1" : "0");
219 }
220 }
221
222 Reader reader(filename);
223 reader.setFacProcessMaskAll();
224
225 // Set reading limit completely outside the bounds of the file's min/max.
226 // This verifies `libfst` respects the bound and securely drops out-of-range blocks.
227 reader.setLimitTimeRange(5000, 6000);
228
229 std::vector<uint64_t> times;
230 reader.readIterateBlocks([&](uint64_t t, fstHandle h, std::string_view v,
231 uint32_t len) { times.push_back(t); });
232
233 EXPECT_TRUE(times.empty())
234 << "Time out of absolute bounds should result in zero callbacks.";
235
236 // Clear limits, should read all 5 time steps
237 reader.setUnlimitedTimeRange();
238 times.clear();
239 reader.readIterateBlocks([&](uint64_t t, fstHandle h, std::string_view v,
240 uint32_t len) { times.push_back(t); });
241 EXPECT_EQ(times.size(), 5) << "Clearing the time range should restore all blocks.";
242}
243
244TEST(FstWrapperTest, FacilityMaskFiltering)
245{
246 const std::string filename = "test_facmask.fst";
247 FileCleanup cleanup{filename};
248
249 fstHandle h_v1, h_v2;
250 {
251 HierarchyBuilder builder(filename);
252 builder.setScope(FST_ST_VCD_MODULE, "TB");
253 h_v1 = builder.createVar(FST_VT_VCD_WIRE, FST_VD_IMPLICIT, 1, "v1");
254 h_v2 = builder.createVar(FST_VT_VCD_WIRE, FST_VD_IMPLICIT, 1, "v2");
255 auto writer = std::move(builder).finish();
256
257 writer.emitTimeChange(10);
258 writer.emitValueChange(h_v1, "1");
259 writer.emitValueChange(h_v2, "1");
260 }
261
262 Reader reader(filename);
263
264 reader.clearFacProcessMaskAll();
265 reader.setFacProcessMask(h_v2);
266
267 std::vector<fstHandle> handles;
268 reader.readIterateBlocks([&](uint64_t t, fstHandle h, std::string_view v,
269 uint32_t len) { handles.push_back(h); });
270
271 ASSERT_EQ(handles.size(), 1);
272 EXPECT_EQ(handles[0], h_v2);
273}
274
275TEST(FstWrapperTest, EnumTables)
276{
277 const std::string filename = "test_enums.fst";
278 FileCleanup cleanup{filename};
279
280 {
281 HierarchyBuilder builder(filename);
282
283 // 1. Declare the scope first!
284 builder.setScope(FST_ST_VCD_MODULE, "Core");
285
286 auto enumHandle =
287 builder.createEnumTable("StateEnum", 2, {{"IDLE", "00"}, {"BUSY", "01"}});
288
289 // 2. The reference must precede the variable it modifies WITHOUT any other scope
290 // changes.
291 builder.emitEnumTableRef(enumHandle);
292 builder.createVar(FST_VT_VCD_WIRE, FST_VD_IMPLICIT, 2, "state");
293
294 auto writer = std::move(builder).finish();
295 }
296
297 Reader reader(filename);
298 std::string captured_enum_str;
299
300 // Search the raw hierarchy attributes to extract the encoded payload.
301 reader.iterateHierarchy([&](const fstHier* h) {
302 if (h->htyp == FST_HT_ATTRBEGIN && h->u.attr.name) {
303 std::string attr_name(h->u.attr.name, h->u.attr.name_length);
304 // FST places the enum name in the payload header.
305 if (attr_name.find("StateEnum") != std::string::npos) {
306 captured_enum_str = attr_name;
307 }
308 }
309 });
310
311 ASSERT_FALSE(captured_enum_str.empty())
312 << "Failed to locate dynamic enum payload in generated FST attributes.";
313
314 // Decode the raw payload using the wrapper tool
315 auto [name, mapping] = Reader::parseEnumTable(captured_enum_str);
316
317 EXPECT_EQ(name, "StateEnum");
318 ASSERT_EQ(mapping.size(), 2);
319
320 EXPECT_EQ(mapping[0].first, "IDLE");
321 EXPECT_EQ(mapping[0].second, "00");
322
323 EXPECT_EQ(mapping[1].first, "BUSY");
324 EXPECT_EQ(mapping[1].second, "01");
325}
326
327TEST(FstWrapperTest, ThrowsOnMultipleRoots)
328{
329 const std::string filename = "test_multiroots.fst";
330 FileCleanup cleanup{filename};
331
332 {
333 HierarchyBuilder builder(filename);
334 builder.setScope(FST_ST_VCD_MODULE, "RootA");
335 builder.upScope();
336 builder.setScope(FST_ST_VCD_MODULE, "RootB");
337 builder.upScope();
338 std::move(builder).finish();
339 }
340
341 Reader reader(filename);
342 EXPECT_THROW(auto a = reader.buildHierarchyTree(), std::runtime_error);
343}
344
345TEST(FstTraceWriterTest, RegistersSignalsAndEmitsSnapshots)
346{
347 const std::string filename = "test_trace_writer.fst";
348 FileCleanup cleanup{filename};
349
350 fstHandle h_scalar, h_bus;
351
352 {
353 TraceWriter writer(filename, {{"scalar", 1}, {"bus", 4}, {"ignored_zero_width", 0}},
354 {.topScopeName = "Trace"});
355
356 EXPECT_EQ(writer.signalCount(), 2);
357 ASSERT_TRUE(writer.handleForSignal("scalar").has_value());
358 ASSERT_TRUE(writer.handleForSignal("bus").has_value());
359 EXPECT_FALSE(writer.handleForSignal("ignored_zero_width").has_value());
360
361 h_scalar = *writer.handleForSignal("scalar");
362 h_bus = *writer.handleForSignal("bus");
363
364 const std::vector<std::string> firstValues{"1", "1010", "1"};
365 const std::vector<std::string> secondValues{"0", "x1"};
366 writer.emitSnapshot(0, firstValues);
367 writer.emitSnapshot(5, secondValues);
368 }
369
370 Reader reader(filename);
371
372 EXPECT_EQ(reader.getTimescale(), -9);
373 EXPECT_EQ(reader.getVarCount(), 2);
374
375 const auto hierarchy = reader.buildHierarchyTree();
376 EXPECT_EQ(hierarchy.name, "Trace");
377 ASSERT_EQ(hierarchy.vars.size(), 2);
378 EXPECT_EQ(hierarchy.vars[0].name, "scalar");
379 EXPECT_EQ(hierarchy.vars[0].length, 1);
380 EXPECT_EQ(hierarchy.vars[1].name, "bus");
381 EXPECT_EQ(hierarchy.vars[1].length, 4);
382
383 std::map<std::pair<uint64_t, fstHandle>, std::string> values;
384 reader.setFacProcessMaskAll();
385 reader.readIterateBlocks([&values](uint64_t t, fstHandle h, std::string_view v,
386 uint32_t len) { values[{t, h}] = std::string(v); });
387
388 EXPECT_EQ((values[{0, h_scalar}]), "1");
389 EXPECT_EQ((values[{0, h_bus}]), "1010");
390 EXPECT_EQ((values[{5, h_scalar}]), "0");
391 EXPECT_EQ((values[{5, h_bus}]), "xxx1");
392}
393
394TEST(FstTraceWriterTest, NormalizesSampledValues)
395{
396 const std::string filename = "test_trace_writer_normalize.fst";
397 FileCleanup cleanup{filename};
398
399 fstHandle h_wide, h_empty, h_invalid, h_missing;
400
401 {
402 TraceWriter writer(filename,
403 {{"wide", 3}, {"empty", 2}, {"invalid", 2}, {"missing", 2}},
404 {.topScopeName = "Trace"});
405
406 h_wide = *writer.handleForSignal("wide");
407 h_empty = *writer.handleForSignal("empty");
408 h_invalid = *writer.handleForSignal("invalid");
409 h_missing = *writer.handleForSignal("missing");
410
411 const std::vector<std::string> values{"10101", "", "2z"};
412 writer.emitSnapshot(0, values);
413 }
414
415 Reader reader(filename);
416
417 std::map<std::pair<uint64_t, fstHandle>, std::string> values;
418 reader.setFacProcessMaskAll();
419 reader.readIterateBlocks([&values](uint64_t t, fstHandle h, std::string_view v,
420 uint32_t len) { values[{t, h}] = std::string(v); });
421
422 EXPECT_EQ((values[{0, h_wide}]), "101");
423 EXPECT_EQ((values[{0, h_empty}]), "xx");
424 EXPECT_EQ((values[{0, h_invalid}]), "xz");
425 EXPECT_EQ((values[{0, h_missing}]), "xx");
426}
427
428TEST(SiliconFstWriterTest, RegistersCircuitBusesAndEmitsSnapshots)
429{
430 const std::string filename = "test_silicon_writer.fst";
431 FileCleanup cleanup{filename};
432
433 auto a = std::make_shared<Wire>(State::LOW);
434 auto b = std::make_shared<Wire>(State::HIGH);
435 auto c = std::make_shared<Wire>(State::LOW);
436 auto d = std::make_shared<Wire>(State::HIGH);
437 auto o = std::make_shared<Wire>(State::UNKNOWN);
438
439 auto gate = std::make_shared<AndGate>(std::vector<Wire_ptr>{a, b}, o);
440 gate->setProperty("bitwise", true);
441 gate->setProperty("size", 2);
442 gate->setOutput(0, Bus({o}));
443 gate->setInput(0, Bus({a, b}));
444 gate->setInput(1, Bus({c, d}));
445 Circuit circuit(gate, false);
446
447 fstHandle h_input0, h_input1, h_output0;
448
449 {
450 CircuitWriter writer(filename, circuit, {.topScopeName = "Trace"});
451
452 EXPECT_EQ(writer.busCount(), 3);
453 ASSERT_TRUE(writer.handleForBus("input_0").has_value());
454 ASSERT_TRUE(writer.handleForBus("input_1").has_value());
455 ASSERT_TRUE(writer.handleForBus("output_0").has_value());
456
457 h_input0 = *writer.handleForBus("input_0");
458 h_input1 = *writer.handleForBus("input_1");
459 h_output0 = *writer.handleForBus("output_0");
460
461 writer.emitSnapshot(0);
462
463 a->forceSetCurrentState(State::HIGH);
464 b->forceSetCurrentState(State::LOW);
465 c->forceSetCurrentState(State::UNKNOWN);
466 d->forceSetCurrentState(State::ERROR);
467 o->forceSetCurrentState(State::ERROR);
468
469 writer.emitSnapshot(5);
470 }
471
472 Reader reader(filename);
473
474 EXPECT_EQ(reader.getTimescale(), -9);
475 EXPECT_EQ(reader.getVarCount(), 3);
476
477 const auto hierarchy = reader.buildHierarchyTree();
478 EXPECT_EQ(hierarchy.name, "Trace");
479 ASSERT_EQ(hierarchy.vars.size(), 3);
480 EXPECT_EQ(hierarchy.vars[0].name, "input_0");
481 EXPECT_EQ(hierarchy.vars[0].length, 2);
482 EXPECT_EQ(hierarchy.vars[1].name, "input_1");
483 EXPECT_EQ(hierarchy.vars[1].length, 2);
484 EXPECT_EQ(hierarchy.vars[2].name, "output_0");
485 EXPECT_EQ(hierarchy.vars[2].length, 1);
486
487 std::map<std::pair<uint64_t, fstHandle>, std::string> values;
488 reader.setFacProcessMaskAll();
489 reader.readIterateBlocks([&values](uint64_t t, fstHandle h, std::string_view v,
490 uint32_t len) { values[{t, h}] = std::string(v); });
491
492 EXPECT_EQ((values[{0, h_input0}]), "10");
493 EXPECT_EQ((values[{0, h_input1}]), "10");
494 EXPECT_EQ((values[{0, h_output0}]), "x");
495
496 EXPECT_EQ((values[{5, h_input0}]), "01");
497 EXPECT_EQ((values[{5, h_input1}]), "zx");
498 EXPECT_EQ((values[{5, h_output0}]), "z");
499}
500
501TEST(SiliconFstWriterTest, SimulatorFstTraceUsesConfiguredBusNames)
502{
503 const std::string filename = "test_simulator_trace.fst";
504 FileCleanup cleanup{filename};
505
506 auto a = std::make_shared<Wire>(State::LOW);
507 auto b = std::make_shared<Wire>(State::HIGH);
508 auto o = std::make_shared<Wire>(State::UNKNOWN);
509
510 auto gate = std::make_shared<AndGate>(std::vector<Wire_ptr>{a, b}, o);
511 auto circuit = std::make_shared<Circuit>(gate, false);
512
513 {
514 Simulator simulator(circuit);
515 simulator.setTraceBuses({
516 {"clock", Bus({a})},
517 {"enable", Bus({b})},
518 {"result", Bus({o})},
519 });
520 simulator.enableFstTracing(filename, {.topScopeName = "SimTrace"});
521 simulator.setBus(Bus({a}), valueFor(Bus({a}), 1));
522 simulator.run(5);
523 }
524
525 Reader reader(filename);
526 const auto hierarchy = reader.buildHierarchyTree();
527
528 EXPECT_EQ(hierarchy.name, "SimTrace");
529 ASSERT_EQ(hierarchy.vars.size(), 3);
530
531 std::map<std::string, fstHandle> handles;
532 for (const auto& var : hierarchy.vars)
533 handles[var.name] = var.handle;
534
535 ASSERT_TRUE(handles.contains("clock"));
536 ASSERT_TRUE(handles.contains("enable"));
537 ASSERT_TRUE(handles.contains("result"));
538
539 std::map<std::pair<uint64_t, fstHandle>, std::string> values;
540 reader.setFacProcessMaskAll();
541 reader.readIterateBlocks([&values](uint64_t t, fstHandle h, std::string_view v,
542 uint32_t len) { values[{t, h}] = std::string(v); });
543
544 EXPECT_EQ((values[{0, handles["clock"]}]), "1");
545 EXPECT_EQ((values[{0, handles["enable"]}]), "1");
546 EXPECT_EQ((values[{5, handles["result"]}]), "1");
547}
Represents a digital circuit as a directed graph of components.
Definition circuit.hpp:125
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.
void enableFstTracing(std::string_view fileName, CircuitWriter::Options options={})
Enables FST tracing for this simulator.
void setTraceBuses(std::vector< CircuitWriter::NamedBus > buses)
Configures bus-level waveform snapshots emitted by the simulator.
SILICON-aware adapter over the generic FST writer wrapper.
Typestate phase for static topology construction.
void upScope()
Pops one hierarchy level. Must match a preceding setScope().
fstEnumHandle createEnumTable(std::string_view name, unsigned int min_valbits, const std::vector< std::pair< const std::string, const std::string > > &values)
Creates a symbolic enum mapping table.
void setDate(std::string_view date)
void setVersion(std::string_view version)
void setScope(fstScopeType scope_type, std::string_view scope_name, std::string_view scope_comp="")
Pushes a new scope onto the writer hierarchy stack.
fstHandle createVar(fstVarType var_type, fstVarDir var_dir, uint32_t len, std::string_view name, fstHandle aliasHandle=0)
Creates a waveform variable.
void emitEnumTableRef(fstEnumHandle handle)
Associates a previously created enum table with subsequent variables.
High-level zero-overhead wrapper around libfst reader APIs.
void readIterateBlocks(Func &&callback)
Iterates waveform blocks and forwards value changes to a callback.
void setFacProcessMaskAll()
Enables processing for all signals.
void setUnlimitedTimeRange()
Removes any previously configured time restrictions.
std::string getVersion() const
void iterateHierarchy(Func &&callback)
Generic hierarchy iterator.
FstScopeNode buildHierarchyTree()
Reconstructs hierarchy into a recursive tree structure.
std::string getDate() const
static EnumTable parseEnumTable(std::string_view enumString)
Parses a textual enum encoding into structured data.
void setFacProcessMask(fstHandle facidx)
Enables a specific signal for processing.
void setLimitTimeRange(uint64_t start_time, uint64_t end_time)
Restricts waveform iteration to a bounded time window.
void clearFacProcessMaskAll()
Disables processing for all signals.
int8_t getTimescale() const
Returns the exponent used by the timescale.
Writes named vector signals from already-sampled FST value strings.
std::optional< fstHandle > handleForSignal(std::string_view name) const
Returns the libfst handle associated with a registered signal name.
std::string filename
bool operator==(const WaveEvent &other) const
std::string value
uint64_t time
fstHandle handle
TEST(FstWrapperTest, ThrowsOnMissingFile)
void PrintTo(const WaveEvent &ev, std::ostream *os)
BusValue valueFor(const Bus &bus, const std::uint64_t value)
Definition tests.hpp:11