From 8f8baccfde62d238025024eb1060ae0aba4c77e3 Mon Sep 17 00:00:00 2001 From: Clifford Wolf Date: Wed, 7 Jun 2017 12:30:24 +0200 Subject: Fix generation of vlogtb output in yosys-smtbmc for "rand reg" and "rand const reg" --- frontends/ast/genrtlil.cc | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'frontends/ast') diff --git a/frontends/ast/genrtlil.cc b/frontends/ast/genrtlil.cc index 78e83e038..6c2eafacd 100644 --- a/frontends/ast/genrtlil.cc +++ b/frontends/ast/genrtlil.cc @@ -1497,6 +1497,13 @@ RTLIL::SigSpec AstNode::genRTLIL(int width_hint, bool sign_hint) cell->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum); cell->parameters["\\WIDTH"] = width; + if (attributes.count("\\reg")) { + auto &attr = attributes.at("\\reg"); + if (attr->type != AST_CONSTANT) + log_error("Attribute `reg' with non-constant value at %s:%d!\n", filename.c_str(), linenum); + cell->attributes["\\reg"] = attr->asAttrConst(); + } + Wire *wire = current_module->addWire(myid + "_wire", width); wire->attributes["\\src"] = stringf("%s:%d", filename.c_str(), linenum); cell->setPort("\\Y", wire); -- cgit v1.2.3