From d49322531398208df42f175bd02cc737af314aa3 Mon Sep 17 00:00:00 2001 From: Catherine Date: Thu, 11 Jan 2024 14:10:20 +0000 Subject: [PATCH] write_cxxrtl: reset state value of comb `$print` cells. --- backends/cxxrtl/cxxrtl_backend.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backends/cxxrtl/cxxrtl_backend.cc b/backends/cxxrtl/cxxrtl_backend.cc index 2c35a1943..ac2f756d6 100644 --- a/backends/cxxrtl/cxxrtl_backend.cc +++ b/backends/cxxrtl/cxxrtl_backend.cc @@ -2002,6 +2002,8 @@ struct CxxrtlWorker { } } for (auto cell : module->cells()) { + if (cell->type == ID($print) && !cell->getParam(ID::TRG_ENABLE).as_bool()) + f << indent << mangle(cell) << " = value<" << (1 + cell->getParam(ID::ARGS_WIDTH).as_int()) << ">();\n"; if (is_internal_cell(cell->type)) continue; f << indent << mangle(cell);