From f31fb95963507d6ddd00cd25a2eaa90d6a191ae7 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Thu, 11 Jan 2024 15:18:37 +0100 Subject: [PATCH] Ignore $scopeinfo in write_verilog --- backends/verilog/verilog_backend.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backends/verilog/verilog_backend.cc b/backends/verilog/verilog_backend.cc index 988eef658..05b7c6c40 100644 --- a/backends/verilog/verilog_backend.cc +++ b/backends/verilog/verilog_backend.cc @@ -1871,6 +1871,13 @@ bool dump_cell_expr(std::ostream &f, std::string indent, RTLIL::Cell *cell) void dump_cell(std::ostream &f, std::string indent, RTLIL::Cell *cell) { + // To keep the output compatible with other tools we ignore $scopeinfo + // cells that exist only to hold metadata. If in the future that metadata + // should be exposed as part of the write_verilog output it should be + // opt-in and/or represented as something else than a $scopeinfo cell. + if (cell->type == ID($scopeinfo)) + return; + // Handled by dump_memory if (cell->is_mem_cell()) return;