Skip to content

Commit 789b6c6

Browse files
committed
Moved declarations of unconnected wires before cell instances in generated output Verilog netlist
Signed-off-by: Maciej Kurc <[email protected]>
1 parent 2f34458 commit 789b6c6

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

vpr/src/base/netlist_writer.cpp

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -961,15 +961,15 @@ class NetlistWriterVisitor : public NetlistVisitor {
961961
}
962962
}
963963

964-
//All the cell instances
964+
//All the cell instances (to an internal buffer for now)
965+
std::stringstream instances_ss;
966+
965967
size_t unconn_count = 0;
966-
verilog_os_ << "\n";
967-
verilog_os_ << indent(depth + 1) << "//Cell instances\n";
968968
for (auto& inst : cell_instances_) {
969-
inst->print_verilog(verilog_os_, unconn_count, depth + 1);
969+
inst->print_verilog(instances_ss, unconn_count, depth + 1);
970970
}
971971

972-
//Unconnected wires
972+
//Unconnected wires declarations
973973
if (unconn_count) {
974974
verilog_os_ << "\n";
975975
verilog_os_ << indent(depth + 1) << "//Unconnected wires\n";
@@ -979,6 +979,11 @@ class NetlistWriterVisitor : public NetlistVisitor {
979979
}
980980
}
981981

982+
//All the cell instances
983+
verilog_os_ << "\n";
984+
verilog_os_ << indent(depth + 1) << "//Cell instances\n";
985+
verilog_os_ << instances_ss.str();
986+
982987
verilog_os_ << "\n";
983988
verilog_os_ << indent(depth) << "endmodule\n";
984989
}

0 commit comments

Comments
 (0)