3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-06-07 14:43:23 +00:00

Merge pull request #5095 from YosysHQ/emil/one-bit-width

rtlil: enable single-bit vector wires
This commit is contained in:
Emil J 2025-05-23 15:55:45 +02:00 committed by GitHub
commit 4b8d42d22c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 46 additions and 0 deletions

View file

@ -383,6 +383,7 @@ void dump_attributes(std::ostream &f, std::string indent, dict<RTLIL::IdString,
if (attr2comment)
as_comment = true;
for (auto it = attributes.begin(); it != attributes.end(); ++it) {
if (it->first == ID::single_bit_vector) continue;
if (it->first == ID::init && regattr) continue;
f << stringf("%s" "%s %s", indent.c_str(), as_comment ? "/*" : "(*", id(it->first).c_str());
f << stringf(" = ");
@ -419,6 +420,9 @@ void dump_wire(std::ostream &f, std::string indent, RTLIL::Wire *wire)
range = stringf(" [%d:%d]", wire->start_offset, wire->width - 1 + wire->start_offset);
else
range = stringf(" [%d:%d]", wire->width - 1 + wire->start_offset, wire->start_offset);
} else {
if (wire->attributes.count(ID::single_bit_vector))
range = stringf(" [%d:%d]", wire->start_offset, wire->start_offset);
}
if (wire->port_input && !wire->port_output)
f << stringf("%s" "input%s %s;\n", indent.c_str(), range.c_str(), id(wire->name).c_str());