@@ -883,7 +883,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
883
883
print_sdf ();
884
884
}
885
885
886
- private : // Internal Helper functions
886
+ protected : // Internal Helper functions
887
887
// /@brief Writes out the verilog netlist
888
888
void print_verilog (int depth = 0 ) {
889
889
verilog_os_ << indent (depth) << " //Verilog generated by VPR " << vtr::VERSION << " from post-place-and-route implementation\n " ;
@@ -957,6 +957,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
957
957
verilog_os_ << indent (depth) << " endmodule\n " ;
958
958
}
959
959
960
+ private: // Internal Helper functions
960
961
// /@brief Writes out the blif netlist
961
962
void print_blif (int depth = 0 ) {
962
963
blif_os_ << indent (depth) << " #BLIF generated by VPR " << vtr::VERSION << " from post-place-and-route implementation\n " ;
@@ -1061,47 +1062,6 @@ class NetlistWriterVisitor : public NetlistVisitor {
1061
1062
sdf_os_ << indent (depth) << " )\n " ;
1062
1063
}
1063
1064
1064
- /* *
1065
- * @brief Returns the name of a wire connecting a primitive and global net.
1066
- *
1067
- * The wire is recorded and instantiated by the top level output routines.
1068
- */
1069
- std::string make_inst_wire (AtomNetId atom_net_id, // /<The id of the net in the atom netlist
1070
- tatum::NodeId tnode_id, // /<The tnode associated with the primitive pin
1071
- std::string inst_name, // /<The name of the instance associated with the pin
1072
- PortType port_type, // /<The port direction
1073
- int port_idx, // /<The instance port index
1074
- int pin_idx) { // /<The instance pin index
1075
-
1076
- std::string wire_name = inst_name;
1077
- if (port_type == PortType::INPUT) {
1078
- wire_name = join_identifier (wire_name, " input" );
1079
- } else if (port_type == PortType::CLOCK) {
1080
- wire_name = join_identifier (wire_name, " clock" );
1081
- } else {
1082
- VTR_ASSERT (port_type == PortType::OUTPUT);
1083
- wire_name = join_identifier (wire_name, " output" );
1084
- }
1085
-
1086
- wire_name = join_identifier (wire_name, std::to_string (port_idx));
1087
- wire_name = join_identifier (wire_name, std::to_string (pin_idx));
1088
-
1089
- auto value = std::make_pair (wire_name, tnode_id);
1090
- if (port_type == PortType::INPUT || port_type == PortType::CLOCK) {
1091
- // Add the sink
1092
- logical_net_sinks_[atom_net_id].push_back (value);
1093
-
1094
- } else {
1095
- // Add the driver
1096
- VTR_ASSERT (port_type == PortType::OUTPUT);
1097
-
1098
- auto ret = logical_net_drivers_.insert (std::make_pair (atom_net_id, value));
1099
- VTR_ASSERT (ret.second ); // Was inserted, drivers are unique
1100
- }
1101
-
1102
- return wire_name;
1103
- }
1104
-
1105
1065
/* *
1106
1066
* @brief Returns the name of a circuit-level Input/Output
1107
1067
*
@@ -1157,6 +1117,48 @@ class NetlistWriterVisitor : public NetlistVisitor {
1157
1117
return io_name;
1158
1118
}
1159
1119
1120
+ protected:
1121
+ /* *
1122
+ * @brief Returns the name of a wire connecting a primitive and global net.
1123
+ *
1124
+ * The wire is recorded and instantiated by the top level output routines.
1125
+ */
1126
+ std::string make_inst_wire (AtomNetId atom_net_id, // /<The id of the net in the atom netlist
1127
+ tatum::NodeId tnode_id, // /<The tnode associated with the primitive pin
1128
+ std::string inst_name, // /<The name of the instance associated with the pin
1129
+ PortType port_type, // /<The port direction
1130
+ int port_idx, // /<The instance port index
1131
+ int pin_idx) { // /<The instance pin index
1132
+
1133
+ std::string wire_name = inst_name;
1134
+ if (port_type == PortType::INPUT) {
1135
+ wire_name = join_identifier (wire_name, " input" );
1136
+ } else if (port_type == PortType::CLOCK) {
1137
+ wire_name = join_identifier (wire_name, " clock" );
1138
+ } else {
1139
+ VTR_ASSERT (port_type == PortType::OUTPUT);
1140
+ wire_name = join_identifier (wire_name, " output" );
1141
+ }
1142
+
1143
+ wire_name = join_identifier (wire_name, std::to_string (port_idx));
1144
+ wire_name = join_identifier (wire_name, std::to_string (pin_idx));
1145
+
1146
+ auto value = std::make_pair (wire_name, tnode_id);
1147
+ if (port_type == PortType::INPUT || port_type == PortType::CLOCK) {
1148
+ // Add the sink
1149
+ logical_net_sinks_[atom_net_id].push_back (value);
1150
+
1151
+ } else {
1152
+ // Add the driver
1153
+ VTR_ASSERT (port_type == PortType::OUTPUT);
1154
+
1155
+ auto ret = logical_net_drivers_.insert (std::make_pair (atom_net_id, value));
1156
+ VTR_ASSERT (ret.second ); // Was inserted, drivers are unique
1157
+ }
1158
+
1159
+ return wire_name;
1160
+ }
1161
+
1160
1162
// /@brief Returns an Instance object representing the LUT
1161
1163
std::shared_ptr<Instance> make_lut_instance (const t_pb* atom) {
1162
1164
// Determine what size LUT
@@ -1772,18 +1774,6 @@ class NetlistWriterVisitor : public NetlistVisitor {
1772
1774
return top_pb->pb_route ;
1773
1775
}
1774
1776
1775
- // /@brief Returns the top complex block which contains the given pb
1776
- const t_pb* find_top_cb (const t_pb* curr) {
1777
- // Walk up through the pb graph until curr
1778
- // has no parent, at which point it will be the top pb
1779
- const t_pb* parent = curr->parent_pb ;
1780
- while (parent != nullptr ) {
1781
- curr = parent;
1782
- parent = curr->parent_pb ;
1783
- }
1784
- return curr;
1785
- }
1786
-
1787
1777
// /@brief Returns the tnode ID of the given atom's connected cluster pin
1788
1778
tatum::NodeId find_tnode (const t_pb* atom, int cluster_pin_idx) {
1789
1779
auto & atom_ctx = g_vpr_ctx.atom ();
@@ -1801,6 +1791,19 @@ class NetlistWriterVisitor : public NetlistVisitor {
1801
1791
return tnode_id;
1802
1792
}
1803
1793
1794
+ private:
1795
+ // /@brief Returns the top complex block which contains the given pb
1796
+ const t_pb* find_top_cb (const t_pb* curr) {
1797
+ // Walk up through the pb graph until curr
1798
+ // has no parent, at which point it will be the top pb
1799
+ const t_pb* parent = curr->parent_pb ;
1800
+ while (parent != nullptr ) {
1801
+ curr = parent;
1802
+ parent = curr->parent_pb ;
1803
+ }
1804
+ return curr;
1805
+ }
1806
+
1804
1807
// /@brief Returns a LogicVec representing the LUT mask of the given LUT atom
1805
1808
LogicVec load_lut_mask (size_t num_inputs, // LUT size
1806
1809
const t_pb* atom) { // LUT primitive
@@ -2058,13 +2061,15 @@ class NetlistWriterVisitor : public NetlistVisitor {
2058
2061
return ::get_delay_ps (delay_sec); // Class overload hides file-scope by default
2059
2062
}
2060
2063
2061
- private: // Data
2062
- std::string top_module_name_; // /<Name of the top level module (i.e. the circuit)
2064
+ private: // Data
2065
+ std::string top_module_name_; // /<Name of the top level module (i.e. the circuit)
2066
+ protected:
2063
2067
std::vector<std::string> inputs_; // /<Name of circuit inputs
2064
2068
std::vector<std::string> outputs_; // /<Name of circuit outputs
2065
2069
std::vector<Assignment> assignments_; // /<Set of assignments (i.e. net-to-net connections)
2066
2070
std::vector<std::shared_ptr<Instance>> cell_instances_; // /<Set of cell instances
2067
2071
2072
+ private:
2068
2073
// Drivers of logical nets.
2069
2074
// Key: logic net id, Value: pair of wire_name and tnode_id
2070
2075
std::map<AtomNetId, std::pair<std::string, tatum::NodeId>> logical_net_drivers_;
@@ -2075,7 +2080,10 @@ class NetlistWriterVisitor : public NetlistVisitor {
2075
2080
std::map<std::string, float > logical_net_sink_delays_;
2076
2081
2077
2082
// Output streams
2083
+ protected:
2078
2084
std::ostream& verilog_os_;
2085
+
2086
+ private:
2079
2087
std::ostream& blif_os_;
2080
2088
std::ostream& sdf_os_;
2081
2089
0 commit comments