mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-05 09:04:08 +00:00
cxxrtl: make blackbox commit()
possible to override.
This fixes a regression introduced when commit observers were added.
This commit is contained in:
parent
84116c9a38
commit
569a6d7fea
|
@ -2511,14 +2511,13 @@ struct CxxrtlWorker {
|
|||
dump_eval_method(module);
|
||||
f << indent << "}\n";
|
||||
f << "\n";
|
||||
f << indent << "template<class ObserverT>\n";
|
||||
f << indent << "bool commit(ObserverT &observer) {\n";
|
||||
f << indent << "virtual bool commit(observer &observer) {\n";
|
||||
dump_commit_method(module);
|
||||
f << indent << "}\n";
|
||||
f << "\n";
|
||||
f << indent << "bool commit() override {\n";
|
||||
f << indent << indent << "observer observer;\n";
|
||||
f << indent << indent << "return commit<>(observer);\n";
|
||||
f << indent << indent << "return commit(observer);\n";
|
||||
f << indent << "}\n";
|
||||
if (debug_info) {
|
||||
f << "\n";
|
||||
|
@ -3421,8 +3420,7 @@ struct CxxrtlBackend : public Backend {
|
|||
log(" wire<8> p_o_data;\n");
|
||||
log("\n");
|
||||
log(" bool eval(performer *performer) override;\n");
|
||||
log(" template<class ObserverT>\n");
|
||||
log(" bool commit(ObserverT &observer);\n");
|
||||
log(" virtual bool commit(observer &observer);\n");
|
||||
log(" bool commit() override;\n");
|
||||
log("\n");
|
||||
log(" static std::unique_ptr<bb_p_debug>\n");
|
||||
|
|
|
@ -556,7 +556,7 @@ public:
|
|||
bool record_incremental(ModuleT &module) {
|
||||
assert(streaming);
|
||||
|
||||
struct {
|
||||
struct : observer {
|
||||
std::unordered_map<const chunk_t*, spool::ident_t> *ident_lookup;
|
||||
spool::writer *writer;
|
||||
|
||||
|
@ -569,7 +569,9 @@ public:
|
|||
void on_update(size_t chunks, const chunk_t *base, const chunk_t *value, size_t index) {
|
||||
writer->write_change(ident_lookup->at(base), chunks, value, index);
|
||||
}
|
||||
} record_observer = { &ident_lookup, &writer };
|
||||
} record_observer;
|
||||
record_observer.ident_lookup = &ident_lookup;
|
||||
record_observer.writer = &writer;
|
||||
|
||||
writer.write_sample(/*incremental=*/true, pointer++, timestamp);
|
||||
for (auto input_index : inputs) {
|
||||
|
|
Loading…
Reference in a new issue