|
CIRCT 24.0.0git
|
#include <BMCTrace.h>

Classes | |
| struct | Signal |
| Metadata for a tracked signal in the trace. More... | |
Public Types | |
| using | Handle = const void * |
| Opaque per-signal value reference recorded for a specific cycle. | |
| using | Evaluator |
| Callback used to materialize a recorded handle into a concrete value when formatting a trace. | |
| using | ModelEval |
| Z3 API callbacks passed in by JIT-compiled code. | |
| using | GetNumeralBinaryString = const char *(*)(Handle context, Handle value) |
Public Member Functions | |
| BMCTrace (llvm::StringRef topName="bmc") | |
| Create an empty trace for the given top-level design/module name. | |
| size_t | addSignal (llvm::StringRef name, unsigned width) |
| Register a signal to be tracked and return its stable index. | |
| void | record (size_t step, size_t signal, Handle handle) |
| Record the value handle for a tracked signal at the given cycle. | |
| void | record (size_t step, llvm::StringRef name, unsigned width, Handle handle) |
| Register a signal by name if necessary and record its value handle at the given cycle. | |
| llvm::StringRef | getTopName () const |
| llvm::ArrayRef< Signal > | getSignals () const |
| size_t | getNumSteps () const |
| std::optional< Handle > | lookup (size_t step, size_t signal) const |
| Return the recorded handle for a signal at a given cycle, if present. | |
| bool | printTextTrace (llvm::raw_ostream &os, Evaluator evaluate) const |
| Render the trace as cycle-by-cycle text using the provided evaluator to materialize values from recorded handles. | |
| bool | printTextTrace (llvm::raw_ostream &os, Handle context, Handle model, ModelEval modelEval, GetNumeralBinaryString getNumeralBinaryString) const |
| Render the trace by evaluating its recorded Z3 ASTs in a satisfying model. | |
Private Types | |
| using | Step = std::vector<std::optional<Handle>> |
| Per-cycle storage for all tracked signals. | |
Private Member Functions | |
| void | ensureStep (size_t step) |
Private Attributes | |
| std::string | topName |
| std::vector< Signal > | signals |
| llvm::StringMap< size_t > | signalIndices |
| std::vector< Step > | recorded |
Definition at line 30 of file BMCTrace.h.
Callback used to materialize a recorded handle into a concrete value when formatting a trace.
The provided width is the declared width of the signal, which may be zero for i0 values.
Definition at line 37 of file BMCTrace.h.
| using circt::bmc::BMCTrace::GetNumeralBinaryString = const char *(*)(Handle context, Handle value) |
Definition at line 44 of file BMCTrace.h.
| using circt::bmc::BMCTrace::Handle = const void * |
Opaque per-signal value reference recorded for a specific cycle.
Definition at line 33 of file BMCTrace.h.
Z3 API callbacks passed in by JIT-compiled code.
Keeping these as opaque function pointers avoids making the runtime library depend on Z3 headers or a particular Z3 shared library at link time.
Definition at line 42 of file BMCTrace.h.
|
private |
Per-cycle storage for all tracked signals.
Definition at line 81 of file BMCTrace.h.
|
explicit |
Create an empty trace for the given top-level design/module name.
Definition at line 15 of file BMCTrace.cpp.
References topName.
| size_t circt::bmc::BMCTrace::addSignal | ( | llvm::StringRef | name, |
| unsigned | width ) |
Register a signal to be tracked and return its stable index.
Signals may have zero width to represent i0 values.
Definition at line 17 of file BMCTrace.cpp.
References assert(), recorded, signalIndices, and signals.
Referenced by record().
|
private |
Definition at line 26 of file BMCTrace.cpp.
References recorded, and signals.
Referenced by record().
|
inline |
Definition at line 66 of file BMCTrace.h.
References recorded.
|
inline |
Definition at line 65 of file BMCTrace.h.
References signals.
|
inline |
Definition at line 64 of file BMCTrace.h.
References topName.
| std::optional< circt::bmc::BMCTrace::Handle > circt::bmc::BMCTrace::lookup | ( | size_t | step, |
| size_t | signal ) const |
Return the recorded handle for a signal at a given cycle, if present.
Definition at line 51 of file BMCTrace.cpp.
| bool circt::bmc::BMCTrace::printTextTrace | ( | llvm::raw_ostream & | os, |
| Evaluator | evaluate ) const |
Render the trace as cycle-by-cycle text using the provided evaluator to materialize values from recorded handles.
Definition at line 57 of file BMCTrace.cpp.
References recorded, signals, and topName.
Referenced by circt::bmc::circt_bmc_print_trace(), and printTextTrace().
| bool circt::bmc::BMCTrace::printTextTrace | ( | llvm::raw_ostream & | os, |
| Handle | context, | ||
| Handle | model, | ||
| ModelEval | modelEval, | ||
| GetNumeralBinaryString | getNumeralBinaryString ) const |
Render the trace by evaluating its recorded Z3 ASTs in a satisfying model.
This must run before the owning Z3 context is destroyed.
Definition at line 79 of file BMCTrace.cpp.
References context, and printTextTrace().
| void circt::bmc::BMCTrace::record | ( | size_t | step, |
| llvm::StringRef | name, | ||
| unsigned | width, | ||
| Handle | handle ) |
Register a signal by name if necessary and record its value handle at the given cycle.
Definition at line 37 of file BMCTrace.cpp.
References addSignal(), assert(), record(), signalIndices, and signals.
| void circt::bmc::BMCTrace::record | ( | size_t | step, |
| size_t | signal, | ||
| Handle | handle ) |
Record the value handle for a tracked signal at the given cycle.
Definition at line 31 of file BMCTrace.cpp.
References assert(), ensureStep(), recorded, and signals.
Referenced by circt::bmc::circt_bmc_record_trace(), and record().
|
private |
Definition at line 88 of file BMCTrace.h.
Referenced by addSignal(), ensureStep(), getNumSteps(), lookup(), printTextTrace(), and record().
|
private |
Definition at line 87 of file BMCTrace.h.
Referenced by addSignal(), and record().
|
private |
Definition at line 86 of file BMCTrace.h.
Referenced by addSignal(), ensureStep(), getSignals(), lookup(), printTextTrace(), record(), and record().
|
private |
Definition at line 85 of file BMCTrace.h.
Referenced by BMCTrace(), getTopName(), and printTextTrace().