@@ -246,7 +246,7 @@ struct ArchReader {
246
246
// Bel Cell mappings
247
247
std::unordered_map<uint32_t , std::vector<t_bel_cell_mapping>> bel_cell_mappings_;
248
248
249
- std::unordered_map<std::string, int > SegmentName_to_SegmentIdx ;
249
+ std::unordered_map<std::string, int > segment_name_to_segment_idx ;
250
250
251
251
// Utils
252
252
std::string str (int idx) {
@@ -1138,14 +1138,12 @@ struct ArchReader {
1138
1138
for (auto tile : tileTypeList) {
1139
1139
t_physical_tile_type ptype;
1140
1140
auto name = str (tile.getName ());
1141
-
1142
- if (name == std::string (" NULL" ))
1141
+ if (name == EMPTY.name )
1143
1142
continue ;
1144
-
1145
1143
ptype.name = vtr::strdup (name.c_str ());
1146
1144
ptype.index = ++index;
1147
1145
ptype.width = ptype.height = ptype.area = 1 ;
1148
- ptype.capacity = 1 ;
1146
+ ptype.capacity = 0 ;
1149
1147
1150
1148
process_sub_tiles (ptype, tile);
1151
1149
@@ -1174,17 +1172,18 @@ struct ArchReader {
1174
1172
auto site = siteTypeList[site_in_tile.getPrimaryType ()];
1175
1173
auto pins_to_wires = site_in_tile.getPrimaryPinsToTileWires ();
1176
1174
1177
- sub_tile.index = 0 ;
1175
+ sub_tile.index = type. capacity ;
1178
1176
sub_tile.name = vtr::strdup (str (site.getName ()).c_str ());
1179
- sub_tile.capacity .set (0 , 0 );
1177
+ sub_tile.capacity .set (type.capacity , type.capacity );
1178
+ type.capacity ++;
1180
1179
1181
1180
int port_idx = 0 ;
1182
1181
int abs_first_pin_idx = 0 ;
1183
1182
int icount = 0 ;
1184
1183
int ocount = 0 ;
1185
1184
1186
- std::unordered_map<std::string, std::string> PortName_to_WireName ;
1187
- int idx = 0 ;
1185
+ std::unordered_map<std::string, std::string> port_name_to_wire_name ;
1186
+ int idx = 0 ;
1188
1187
for (auto dir : {LogicalNetlist::Netlist::Direction::INPUT, LogicalNetlist::Netlist::Direction::OUTPUT}) {
1189
1188
int port_idx_by_type = 0 ;
1190
1189
for (auto pin : site.getPins ()) {
@@ -1195,12 +1194,12 @@ struct ArchReader {
1195
1194
1196
1195
port.name = vtr::strdup (str (pin.getName ()).c_str ());
1197
1196
1198
- PortName_to_WireName [std::string (port.name )] = str (pins_to_wires[idx++]);
1197
+ port_name_to_wire_name [std::string (port.name )] = str (pins_to_wires[idx++]);
1199
1198
1200
1199
port.equivalent = PortEquivalence::NONE;
1201
1200
port.num_pins = 1 ;
1202
1201
1203
- sub_tile.sub_tile_to_tile_pin_indices .push_back (port_idx);
1202
+ sub_tile.sub_tile_to_tile_pin_indices .push_back (type. num_pins + port_idx);
1204
1203
port.index = port_idx++;
1205
1204
1206
1205
port.absolute_first_pin_index = abs_first_pin_idx++;
@@ -1222,14 +1221,14 @@ struct ArchReader {
1222
1221
}
1223
1222
1224
1223
auto pins_size = site.getPins ().size ();
1225
- sub_tile.num_phy_pins += pins_size * type. capacity ;
1226
- type.num_pins += pins_size * type. capacity ;
1224
+ sub_tile.num_phy_pins += pins_size;
1225
+ type.num_pins += pins_size;
1227
1226
type.num_inst_pins += pins_size;
1228
1227
1229
1228
type.num_input_pins += icount;
1230
1229
type.num_output_pins += ocount;
1231
- type.num_receivers += icount * type. capacity ;
1232
- type.num_drivers += ocount * type. capacity ;
1230
+ type.num_receivers += icount;
1231
+ type.num_drivers += ocount;
1233
1232
1234
1233
type.pin_width_offset .resize (type.num_pins , 0 );
1235
1234
type.pin_height_offset .resize (type.num_pins , 0 );
@@ -1262,7 +1261,7 @@ struct ArchReader {
1262
1261
for (const auto & port : sub_tile.ports ) {
1263
1262
t_fc_specification fc_spec;
1264
1263
1265
- fc_spec.seg_index = SegmentName_to_SegmentIdx[PortName_to_WireName [std::string (port.name )]];
1264
+ fc_spec.seg_index = segment_name_to_segment_idx[port_name_to_wire_name [std::string (port.name )]];
1266
1265
1267
1266
// Apply type and defaults
1268
1267
if (port.type == IN_PORT) {
@@ -1302,8 +1301,8 @@ struct ArchReader {
1302
1301
t_grid_def grid_def;
1303
1302
grid_def.width = grid_def.height = 0 ;
1304
1303
for (auto tile : tileList) {
1305
- grid_def.width = std::max (grid_def.width , tile.getCol () + 1 );
1306
- grid_def.height = std::max (grid_def.height , tile.getRow () + 1 );
1304
+ grid_def.width = std::max (grid_def.width , tile.getCol ());
1305
+ grid_def.height = std::max (grid_def.height , tile.getRow ());
1307
1306
}
1308
1307
1309
1308
grid_def.grid_type = GridDefType::FIXED;
@@ -1501,7 +1500,7 @@ struct ArchReader {
1501
1500
arch_->Segments [index].sb .resize (2 );
1502
1501
arch_->Segments [index].sb [0 ] = true ;
1503
1502
arch_->Segments [index].sb [1 ] = true ;
1504
- SegmentName_to_SegmentIdx [str (i)] = index;
1503
+ segment_name_to_segment_idx [str (i)] = index;
1505
1504
++index;
1506
1505
}
1507
1506
}
0 commit comments