Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cxxrtl: fix comment wording. NFC #4109

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 10 additions & 12 deletions backends/cxxrtl/runtime/cxxrtl/cxxrtl.h
Original file line number Diff line number Diff line change
Expand Up @@ -841,24 +841,22 @@ std::ostream &operator<<(std::ostream &os, const value_formatted<Bits> &vf)
return os;
}

// An object that can be passed to a `commit()` method in order to produce a replay log of every
// state change in the simulation.
// An object that can be passed to a `commit()` method in order to produce a replay log of every state change in
// the simulation.
struct observer {
// Called when a `commit()` method for a wire is about to update the `chunks` chunks at `base`
// with `chunks` chunks at `value` that have a different bit pattern. It is guaranteed that
// `chunks` is equal to the wire chunk count and `base` points to the first chunk.
// Called when the `commit()` method for a wire is about to update the `chunks` chunks at `base` with `chunks` chunks
// at `value` that have a different bit pattern. It is guaranteed that `chunks` is equal to the wire chunk count and
// `base` points to the first chunk.
virtual void on_commit(size_t chunks, const chunk_t *base, const chunk_t *value) = 0;

// Called when a `commit()` method for a memory is about to update the `chunks` chunks at
// `&base[chunks * index]` with `chunks` chunks at `value` that have a different bit pattern.
// It is guaranteed that `chunks` covers is equal to the memory element chunk count and `base`
// points to the first chunk of the first element of the memory.
// Called when the `commit()` method for a memory is about to update the `chunks` chunks at `&base[chunks * index]`
// with `chunks` chunks at `value` that have a different bit pattern. It is guaranteed that `chunks` is equal to
// the memory element chunk count and `base` points to the first chunk of the first element of the memory.
virtual void on_commit(size_t chunks, const chunk_t *base, const chunk_t *value, size_t index) = 0;
};

// The `null_observer` class has the same interface as `observer`, but has no invocation overhead,
// since its methods are final and have no implementation. This allows the observer feature to be
// zero-cost when not in use.
// The `null_observer` class has the same interface as `observer`, but has no invocation overhead, since its methods
// are final and have no implementation. This allows the observer feature to be zero-cost when not in use.
struct null_observer final: observer {
void on_commit(size_t chunks, const chunk_t *base, const chunk_t *value) override {}
void on_commit(size_t chunks, const chunk_t *base, const chunk_t *value, size_t index) override {}
Expand Down
Loading