Skip to content

Commit d640157

Browse files
committed
fix some cases of hdlname being added to objects with private names
1 parent 17d4579 commit d640157

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

frontends/verific/verific.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1464,7 +1464,8 @@ void VerificImporter::import_netlist(RTLIL::Design *design, Netlist *nl, std::ma
14641464
log("Importing module %s.\n", RTLIL::id2cstr(module->name));
14651465
}
14661466
import_attributes(module->attributes, nl, nl);
1467-
module->set_string_attribute(ID::hdlname, nl->CellBaseName());
1467+
if (module->name.isPublic())
1468+
module->set_string_attribute(ID::hdlname, nl->CellBaseName());
14681469
module->set_string_attribute(ID(library), nl->Owner()->Owner()->Name());
14691470
#ifdef VERIFIC_VHDL_SUPPORT
14701471
if (nl->IsFromVhdl()) {

passes/fsm/fsm_extract.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,10 @@ static void extract_fsm(RTLIL::Wire *wire)
377377
fsm_cell->setPort(ID::CTRL_OUT, ctrl_out);
378378
fsm_cell->parameters[ID::NAME] = RTLIL::Const(wire->name.str());
379379
fsm_cell->attributes = wire->attributes;
380+
if(fsm_cell->attributes.count(ID::hdlname)) {
381+
fsm_cell->attributes[ID(scopename)] = fsm_cell->attributes[ID::hdlname];
382+
fsm_cell->attributes.erase(ID::hdlname);
383+
}
380384
fsm_data.copy_to_cell(fsm_cell);
381385

382386
// rename original state wire
@@ -385,6 +389,10 @@ static void extract_fsm(RTLIL::Wire *wire)
385389
wire->attributes.erase(ID::fsm_encoding);
386390
wire->name = stringf("$fsm$oldstate%s", wire->name.c_str());
387391
module->wires_[wire->name] = wire;
392+
if(wire->attributes.count(ID::hdlname)) {
393+
wire->attributes[ID(scopename)] = wire->attributes[ID::hdlname];
394+
wire->attributes.erase(ID::hdlname);
395+
}
388396

389397
// unconnect control outputs from old drivers
390398

0 commit comments

Comments
 (0)