Skip to content

Commit c1ca957

Browse files
committed
Fix nits regarding hdlname
1 parent 92802c8 commit c1ca957

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/slang_frontend.cc

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2230,7 +2230,7 @@ struct PopulateNetlist : public TimingPatternInterpretor, public ast::ASTVisitor
22302230
// blackboxes get special handling no matter the hierarchy mode
22312231
if (sym.isModule() && netlist.is_blackbox(sym.body.getDefinition())) {
22322232
RTLIL::Cell *cell = netlist.canvas->addCell(netlist.id(sym), RTLIL::escape_id(std::string(sym.body.name)));
2233-
cell->set_string_attribute(RTLIL::ID::hdlname, netlist.hdlname(sym));
2233+
cell->set_string_attribute(ID::hdlname, netlist.hdlname(sym));
22342234

22352235
for (auto *conn : sym.getPortConnections()) {
22362236
switch (conn->port.kind) {
@@ -2342,7 +2342,7 @@ struct PopulateNetlist : public TimingPatternInterpretor, public ast::ASTVisitor
23422342
auto [submodule, inserted] = queue.get_or_emplace(ref_body, netlist, *ref_body->parentInstance);
23432343

23442344
RTLIL::Cell *cell = netlist.canvas->addCell(netlist.id(sym), module_type_id(*ref_body));
2345-
cell->set_string_attribute(RTLIL::ID::hdlname, netlist.hdlname(sym));
2345+
cell->set_string_attribute(ID::hdlname, netlist.hdlname(sym));
23462346
for (auto *conn : sym.getPortConnections()) {
23472347
slang::SourceLocation loc;
23482348
if (auto expr = conn->getExpression())
@@ -2562,7 +2562,7 @@ struct PopulateNetlist : public TimingPatternInterpretor, public ast::ASTVisitor
25622562

25632563
if (netlist.is_inferred_memory(sym)) {
25642564
RTLIL::Memory *m = new RTLIL::Memory;
2565-
m->set_string_attribute(RTLIL::ID::hdlname, netlist.hdlname(sym));
2565+
m->set_string_attribute(ID::hdlname, netlist.hdlname(sym));
25662566
transfer_attrs(sym, m);
25672567
m->name = netlist.id(sym);
25682568
m->width = sym.getType().getArrayElementType()->getBitstreamWidth();
@@ -2628,7 +2628,6 @@ struct PopulateNetlist : public TimingPatternInterpretor, public ast::ASTVisitor
26282628
if (netlist.is_inferred_memory(sym)) {
26292629
RTLIL::IdString id = netlist.id(sym);
26302630
RTLIL::Memory *m = netlist.canvas->memories.at(id);
2631-
m->set_string_attribute(RTLIL::ID::hdlname, netlist.hdlname(sym));
26322631
RTLIL::Cell *meminit = netlist.canvas->addCell(netlist.new_id(), ID($meminit_v2));
26332632
int abits = 32;
26342633
ast_invariant(sym, m->width * m->size == const_.size());
@@ -2644,7 +2643,7 @@ struct PopulateNetlist : public TimingPatternInterpretor, public ast::ASTVisitor
26442643
} else {
26452644
auto wire = netlist.wire(sym);
26462645
log_assert(wire);
2647-
wire->attributes[RTLIL::ID::init] = const_;
2646+
wire->attributes[ID::init] = const_;
26482647
}
26492648
}
26502649
}
@@ -2696,7 +2695,7 @@ struct PopulateNetlist : public TimingPatternInterpretor, public ast::ASTVisitor
26962695

26972696
RTLIL::Cell *cell = netlist.canvas->addCell(netlist.id(sym),
26982697
id(sym.definitionName));
2699-
cell->set_string_attribute(RTLIL::ID::hdlname, netlist.hdlname(sym));
2698+
cell->set_string_attribute(ID::hdlname, netlist.hdlname(sym));
27002699
transfer_attrs(sym, cell);
27012700

27022701
auto port_names = sym.getPortNames();
@@ -3081,7 +3080,7 @@ std::string NetlistContext::hdlname(const ast::Symbol &symbol)
30813080
RTLIL::Wire *NetlistContext::add_wire(const ast::ValueSymbol &symbol)
30823081
{
30833082
auto w = canvas->addWire(id(symbol), symbol.getType().getBitstreamWidth());
3084-
w->set_string_attribute(RTLIL::ID::hdlname, hdlname(symbol));
3083+
w->set_string_attribute(ID::hdlname, hdlname(symbol));
30853084
wire_cache[&symbol] = w;
30863085
transfer_attrs(symbol, w);
30873086
return w;

0 commit comments

Comments
 (0)