@@ -886,7 +886,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
886
886
print_sdf ();
887
887
}
888
888
889
- private: // Internal Helper functions
889
+ protected:
890
890
virtual void print_primary_io (int depth) {
891
891
// Primary Inputs
892
892
for (auto iter = inputs_.begin (); iter != inputs_.end (); ++iter) {
@@ -977,6 +977,7 @@ class NetlistWriterVisitor : public NetlistVisitor {
977
977
verilog_os_ << indent (depth) << " endmodule\n " ;
978
978
}
979
979
980
+ private: // Internal Helper functions
980
981
// /@brief Writes out the blif netlist
981
982
void print_blif (int depth = 0 ) {
982
983
blif_os_ << indent (depth) << " #BLIF generated by VPR " << vtr::VERSION << " from post-place-and-route implementation\n " ;
@@ -1081,47 +1082,6 @@ class NetlistWriterVisitor : public NetlistVisitor {
1081
1082
sdf_os_ << indent (depth) << " )\n " ;
1082
1083
}
1083
1084
1084
- /* *
1085
- * @brief Returns the name of a wire connecting a primitive and global net.
1086
- *
1087
- * The wire is recorded and instantiated by the top level output routines.
1088
- */
1089
- std::string make_inst_wire (AtomNetId atom_net_id, // /<The id of the net in the atom netlist
1090
- tatum::NodeId tnode_id, // /<The tnode associated with the primitive pin
1091
- std::string inst_name, // /<The name of the instance associated with the pin
1092
- PortType port_type, // /<The port direction
1093
- int port_idx, // /<The instance port index
1094
- int pin_idx) { // /<The instance pin index
1095
-
1096
- std::string wire_name = inst_name;
1097
- if (port_type == PortType::INPUT) {
1098
- wire_name = join_identifier (wire_name, " input" );
1099
- } else if (port_type == PortType::CLOCK) {
1100
- wire_name = join_identifier (wire_name, " clock" );
1101
- } else {
1102
- VTR_ASSERT (port_type == PortType::OUTPUT);
1103
- wire_name = join_identifier (wire_name, " output" );
1104
- }
1105
-
1106
- wire_name = join_identifier (wire_name, std::to_string (port_idx));
1107
- wire_name = join_identifier (wire_name, std::to_string (pin_idx));
1108
-
1109
- auto value = std::make_pair (wire_name, tnode_id);
1110
- if (port_type == PortType::INPUT || port_type == PortType::CLOCK) {
1111
- // Add the sink
1112
- logical_net_sinks_[atom_net_id].push_back (value);
1113
-
1114
- } else {
1115
- // Add the driver
1116
- VTR_ASSERT (port_type == PortType::OUTPUT);
1117
-
1118
- auto ret = logical_net_drivers_.insert (std::make_pair (atom_net_id, value));
1119
- VTR_ASSERT (ret.second ); // Was inserted, drivers are unique
1120
- }
1121
-
1122
- return wire_name;
1123
- }
1124
-
1125
1085
/* *
1126
1086
* @brief Returns the name of a circuit-level Input/Output
1127
1087
*
@@ -1177,6 +1137,48 @@ class NetlistWriterVisitor : public NetlistVisitor {
1177
1137
return io_name;
1178
1138
}
1179
1139
1140
+ protected:
1141
+ /* *
1142
+ * @brief Returns the name of a wire connecting a primitive and global net.
1143
+ *
1144
+ * The wire is recorded and instantiated by the top level output routines.
1145
+ */
1146
+ std::string make_inst_wire (AtomNetId atom_net_id, // /<The id of the net in the atom netlist
1147
+ tatum::NodeId tnode_id, // /<The tnode associated with the primitive pin
1148
+ std::string inst_name, // /<The name of the instance associated with the pin
1149
+ PortType port_type, // /<The port direction
1150
+ int port_idx, // /<The instance port index
1151
+ int pin_idx) { // /<The instance pin index
1152
+
1153
+ std::string wire_name = inst_name;
1154
+ if (port_type == PortType::INPUT) {
1155
+ wire_name = join_identifier (wire_name, " input" );
1156
+ } else if (port_type == PortType::CLOCK) {
1157
+ wire_name = join_identifier (wire_name, " clock" );
1158
+ } else {
1159
+ VTR_ASSERT (port_type == PortType::OUTPUT);
1160
+ wire_name = join_identifier (wire_name, " output" );
1161
+ }
1162
+
1163
+ wire_name = join_identifier (wire_name, std::to_string (port_idx));
1164
+ wire_name = join_identifier (wire_name, std::to_string (pin_idx));
1165
+
1166
+ auto value = std::make_pair (wire_name, tnode_id);
1167
+ if (port_type == PortType::INPUT || port_type == PortType::CLOCK) {
1168
+ // Add the sink
1169
+ logical_net_sinks_[atom_net_id].push_back (value);
1170
+
1171
+ } else {
1172
+ // Add the driver
1173
+ VTR_ASSERT (port_type == PortType::OUTPUT);
1174
+
1175
+ auto ret = logical_net_drivers_.insert (std::make_pair (atom_net_id, value));
1176
+ VTR_ASSERT (ret.second ); // Was inserted, drivers are unique
1177
+ }
1178
+
1179
+ return wire_name;
1180
+ }
1181
+
1180
1182
// /@brief Returns an Instance object representing the LUT
1181
1183
std::shared_ptr<Instance> make_lut_instance (const t_pb* atom) {
1182
1184
// Determine what size LUT
@@ -1792,18 +1794,6 @@ class NetlistWriterVisitor : public NetlistVisitor {
1792
1794
return top_pb->pb_route ;
1793
1795
}
1794
1796
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
-
1807
1797
// /@brief Returns the tnode ID of the given atom's connected cluster pin
1808
1798
tatum::NodeId find_tnode (const t_pb* atom, int cluster_pin_idx) {
1809
1799
auto & atom_ctx = g_vpr_ctx.atom ();
@@ -1821,6 +1811,19 @@ class NetlistWriterVisitor : public NetlistVisitor {
1821
1811
return tnode_id;
1822
1812
}
1823
1813
1814
+ private:
1815
+ // /@brief Returns the top complex block which contains the given pb
1816
+ const t_pb* find_top_cb (const t_pb* curr) {
1817
+ // Walk up through the pb graph until curr
1818
+ // has no parent, at which point it will be the top pb
1819
+ const t_pb* parent = curr->parent_pb ;
1820
+ while (parent != nullptr ) {
1821
+ curr = parent;
1822
+ parent = curr->parent_pb ;
1823
+ }
1824
+ return curr;
1825
+ }
1826
+
1824
1827
// /@brief Returns a LogicVec representing the LUT mask of the given LUT atom
1825
1828
LogicVec load_lut_mask (size_t num_inputs, // LUT size
1826
1829
const t_pb* atom) { // LUT primitive
@@ -2078,13 +2081,15 @@ class NetlistWriterVisitor : public NetlistVisitor {
2078
2081
return ::get_delay_ps (delay_sec); // Class overload hides file-scope by default
2079
2082
}
2080
2083
2081
- private: // Data
2082
- std::string top_module_name_; // /<Name of the top level module (i.e. the circuit)
2084
+ private: // Data
2085
+ std::string top_module_name_; // /<Name of the top level module (i.e. the circuit)
2086
+ protected:
2083
2087
std::vector<std::string> inputs_; // /<Name of circuit inputs
2084
2088
std::vector<std::string> outputs_; // /<Name of circuit outputs
2085
2089
std::vector<Assignment> assignments_; // /<Set of assignments (i.e. net-to-net connections)
2086
2090
std::vector<std::shared_ptr<Instance>> cell_instances_; // /<Set of cell instances
2087
2091
2092
+ private:
2088
2093
// Drivers of logical nets.
2089
2094
// Key: logic net id, Value: pair of wire_name and tnode_id
2090
2095
std::map<AtomNetId, std::pair<std::string, tatum::NodeId>> logical_net_drivers_;
@@ -2095,7 +2100,10 @@ class NetlistWriterVisitor : public NetlistVisitor {
2095
2100
std::map<std::string, float > logical_net_sink_delays_;
2096
2101
2097
2102
// Output streams
2103
+ protected:
2098
2104
std::ostream& verilog_os_;
2105
+
2106
+ private:
2099
2107
std::ostream& blif_os_;
2100
2108
std::ostream& sdf_os_;
2101
2109
0 commit comments