cxxrtl: fix comment wording. NFC

This commit is contained in:
Catherine 2024-01-05 20:18:36 +00:00
parent 3e358d9bfa
commit f9dc1a2184
1 changed files with 10 additions and 12 deletions

View File

@ -841,24 +841,22 @@ std::ostream &operator<<(std::ostream &os, const value_formatted<Bits> &vf)
return os; return os;
} }
// An object that can be passed to a `commit()` method in order to produce a replay log of every // An object that can be passed to a `commit()` method in order to produce a replay log of every state change in
// state change in the simulation. // the simulation.
struct observer { struct observer {
// Called when a `commit()` method for a wire is about to update the `chunks` chunks at `base` // Called when the `commit()` method for a wire is about to update the `chunks` chunks at `base` with `chunks` chunks
// with `chunks` chunks at `value` that have a different bit pattern. It is guaranteed that // at `value` that have a different bit pattern. It is guaranteed that `chunks` is equal to the wire chunk count and
// `chunks` is equal to the wire chunk count and `base` points to the first chunk. // `base` points to the first chunk.
virtual void on_commit(size_t chunks, const chunk_t *base, const chunk_t *value) = 0; 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 // Called when the `commit()` method for a memory is about to update the `chunks` chunks at `&base[chunks * index]`
// `&base[chunks * index]` with `chunks` chunks at `value` that have a different bit pattern. // with `chunks` chunks at `value` that have a different bit pattern. It is guaranteed that `chunks` is equal to
// It is guaranteed that `chunks` covers is equal to the memory element chunk count and `base` // the memory element chunk count and `base` points to the first chunk of the first element of the memory.
// 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; 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, // The `null_observer` class has the same interface as `observer`, but has no invocation overhead, since its methods
// since its methods are final and have no implementation. This allows the observer feature to be // are final and have no implementation. This allows the observer feature to be zero-cost when not in use.
// zero-cost when not in use.
struct null_observer final: observer { 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) override {}
void on_commit(size_t chunks, const chunk_t *base, const chunk_t *value, size_t index) override {} void on_commit(size_t chunks, const chunk_t *base, const chunk_t *value, size_t index) override {}