Skip to content

Commit fe45554

Browse files
committed
vpr: base: netlist writer: split multi-bit cell instance ports
Signed-off-by: Pawel Czarnecki <[email protected]>
1 parent 7d912c3 commit fe45554

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

vpr/src/base/netlist_writer.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2439,6 +2439,8 @@ void print_verilog_port(std::ostream& os, size_t& unconn_count, const std::strin
24392439
//Pins
24402440
if (nets.size() == 1) {
24412441
//Single-bit port
2442+
//Port name
2443+
os << indent(depth) << "." << port_name << "(";
24422444
if (nets[0].empty()) {
24432445
//Disconnected
24442446
if (type == PortType::INPUT || type == PortType::CLOCK) {
@@ -2451,6 +2453,7 @@ void print_verilog_port(std::ostream& os, size_t& unconn_count, const std::strin
24512453
//Connected
24522454
os << escape_verilog_identifier(nets[0]);
24532455
}
2456+
os << ")";
24542457
} else {
24552458
// Check if all pins are unconnected
24562459
bool all_unconnected = true;
@@ -2470,7 +2473,8 @@ void print_verilog_port(std::ostream& os, size_t& unconn_count, const std::strin
24702473
os << "{"
24712474
<< "\n";
24722475
for (int ipin = (int)nets.size() - 1; ipin >= 0; --ipin) { //Reverse order to match endianess
2473-
os << indent(depth + 1);
2476+
std::string name = port_name + "[" + std::to_string(ipin) + "]";
2477+
os << indent(depth) << "." << escape_verilog_identifier(name) << " (";
24742478
if (nets[ipin].empty()) {
24752479
//Disconnected
24762480
if (type == PortType::INPUT || type == PortType::CLOCK) {
@@ -2494,7 +2498,6 @@ void print_verilog_port(std::ostream& os, size_t& unconn_count, const std::strin
24942498
os << indent(depth) + " }";
24952499
}
24962500
}
2497-
os << ")";
24982501
}
24992502

25002503
///@brief Escapes the given identifier to be safe for verilog

0 commit comments

Comments
 (0)