@@ -274,7 +274,7 @@ e_side string_to_side(std::string side_str);
274
274
static void link_physical_logical_types (std::vector<t_physical_tile_type>& PhysicalTileTypes,
275
275
std::vector<t_logical_block_type>& LogicalBlockTypes);
276
276
277
- static void check_port_direct_mappings (t_physical_tile_type_ptr physical_tile, t_logical_block_type_ptr logical_block);
277
+ static void check_port_direct_mappings (t_physical_tile_type_ptr physical_tile, t_sub_tile* sub_tile, t_logical_block_type_ptr logical_block);
278
278
279
279
static const t_physical_tile_port* get_port_by_name (t_sub_tile* sub_tile, const char * port_name);
280
280
static const t_port* get_port_by_name (t_logical_block_type_ptr type, const char * port_name);
@@ -3145,7 +3145,7 @@ static void ProcessTileEquivalentSites(pugi::xml_node Parent,
3145
3145
if (0 == strcmp (LogicalBlockType->pb_type ->name , Prop.c_str ())) {
3146
3146
SubTile->equivalent_sites .push_back (LogicalBlockType);
3147
3147
3148
- check_port_direct_mappings (PhysicalTileType, LogicalBlockType);
3148
+ check_port_direct_mappings (PhysicalTileType, SubTile, LogicalBlockType);
3149
3149
}
3150
3150
3151
3151
CurSite = CurSite.next_sibling (CurSite.name ());
@@ -3168,12 +3168,12 @@ static void ProcessEquivalentSiteDirectConnection(pugi::xml_node Parent,
3168
3168
3169
3169
for (int npin = 0 ; npin < num_pins; npin++) {
3170
3170
t_physical_pin physical_pin (npin);
3171
- t_logical_pin logical_pin (SubTile-> index , npin);
3171
+ t_logical_pin logical_pin (npin);
3172
3172
3173
3173
directs_map.insert (logical_pin, physical_pin);
3174
3174
}
3175
3175
3176
- PhysicalTileType->tile_block_pin_directs_map [LogicalBlockType->index ] = directs_map;
3176
+ PhysicalTileType->tile_block_pin_directs_map [LogicalBlockType->index ][SubTile-> index ] = directs_map;
3177
3177
}
3178
3178
3179
3179
static void ProcessEquivalentSiteCustomConnection (pugi::xml_node Parent,
@@ -3194,6 +3194,7 @@ static void ProcessEquivalentSiteCustomConnection(pugi::xml_node Parent,
3194
3194
vtr::bimap<t_logical_pin, t_physical_pin> directs_map;
3195
3195
3196
3196
CurDirect = Parent.first_child ();
3197
+
3197
3198
while (CurDirect) {
3198
3199
check_node (CurDirect, " direct" , loc_data);
3199
3200
@@ -3220,7 +3221,7 @@ static void ProcessEquivalentSiteCustomConnection(pugi::xml_node Parent,
3220
3221
int num_pins = from_pins.second - from_pins.first ;
3221
3222
for (int i = 0 ; i < num_pins; i++) {
3222
3223
t_physical_pin physical_pin (from_pins.first + i);
3223
- t_logical_pin logical_pin (SubTile-> index , to_pins.first + i);
3224
+ t_logical_pin logical_pin (to_pins.first + i);
3224
3225
3225
3226
auto result = directs_map.insert (logical_pin, physical_pin);
3226
3227
if (!result.second ) {
@@ -3234,7 +3235,7 @@ static void ProcessEquivalentSiteCustomConnection(pugi::xml_node Parent,
3234
3235
CurDirect = CurDirect.next_sibling (CurDirect.name ());
3235
3236
}
3236
3237
3237
- PhysicalTileType->tile_block_pin_directs_map [LogicalBlockType->index ] = directs_map;
3238
+ PhysicalTileType->tile_block_pin_directs_map [LogicalBlockType->index ][SubTile-> index ] = directs_map;
3238
3239
}
3239
3240
3240
3241
static void ProcessPinLocations (pugi::xml_node Locations,
@@ -5060,23 +5061,26 @@ static void link_physical_logical_types(std::vector<t_physical_tile_type>& Physi
5060
5061
std::sort (equivalent_tiles.begin (), equivalent_tiles.end (), criteria);
5061
5062
5062
5063
for (int pin = 0 ; pin < logical_block.pb_type ->num_pins ; pin++) {
5063
- for (auto & tile : logical_block.equivalent_tiles ) {
5064
- auto direct_map = tile->tile_block_pin_directs_map .at (logical_block.index );
5064
+ for (auto & tile : equivalent_tiles) {
5065
+ auto direct_maps = tile->tile_block_pin_directs_map .at (logical_block.index );
5066
+
5065
5067
for (auto & sub_tile : tile->sub_tiles ) {
5066
5068
auto equiv_sites = sub_tile.equivalent_sites ;
5067
5069
if (std::find (equiv_sites.begin (), equiv_sites.end (), &logical_block) == equiv_sites.end ()) {
5068
5070
continue ;
5069
5071
}
5070
5072
5071
- auto result = direct_map.find (t_logical_pin (sub_tile.index , pin));
5073
+ auto direct_map = direct_maps.at (sub_tile.index );
5074
+
5075
+ auto result = direct_map.find (t_logical_pin (pin));
5072
5076
if (result == direct_map.end ()) {
5073
5077
archfpga_throw (__FILE__, __LINE__,
5074
5078
" Logical pin %d not present in pin mapping between Tile %s and Block %s.\n " ,
5075
5079
pin, tile->name , logical_block.name );
5076
5080
}
5077
5081
5078
- int sub_tile_index = result->second .pin ;
5079
- int phy_index = sub_tile.sub_tile_to_tile_pin_indices [sub_tile_index ];
5082
+ int sub_tile_pin_index = result->second .pin ;
5083
+ int phy_index = sub_tile.sub_tile_to_tile_pin_indices [sub_tile_pin_index ];
5080
5084
5081
5085
bool is_ignored = tile->is_ignored_pin [phy_index];
5082
5086
bool is_global = tile->is_pin_global [phy_index];
@@ -5102,44 +5106,38 @@ static void link_physical_logical_types(std::vector<t_physical_tile_type>& Physi
5102
5106
}
5103
5107
}
5104
5108
5105
- static void check_port_direct_mappings (t_physical_tile_type_ptr physical_tile, t_logical_block_type_ptr logical_block) {
5109
+ static void check_port_direct_mappings (t_physical_tile_type_ptr physical_tile, t_sub_tile* sub_tile, t_logical_block_type_ptr logical_block) {
5106
5110
auto pb_type = logical_block->pb_type ;
5107
5111
5108
- if (pb_type->num_pins > physical_tile-> num_pins ) {
5112
+ if (pb_type->num_pins > (sub_tile-> num_phy_pins / sub_tile-> capacity . total ()) ) {
5109
5113
archfpga_throw (__FILE__, __LINE__,
5110
- " Logical Block (%s) has more pins than the Physical Tile (%s).\n " ,
5111
- logical_block->name , physical_tile ->name );
5114
+ " Logical Block (%s) has more pins than the Sub Tile (%s).\n " ,
5115
+ logical_block->name , sub_tile ->name );
5112
5116
}
5113
5117
5114
- auto & pin_direct_mapping = physical_tile->tile_block_pin_directs_map .at (logical_block->index );
5118
+ auto & pin_direct_maps = physical_tile->tile_block_pin_directs_map .at (logical_block->index );
5119
+ auto pin_direct_map = pin_direct_maps.at (sub_tile->index );
5115
5120
5116
- if (pb_type->num_pins != (int )pin_direct_mapping .size ()) {
5121
+ if (pb_type->num_pins != (int )pin_direct_map .size ()) {
5117
5122
archfpga_throw (__FILE__, __LINE__,
5118
- " Logical block (%s) and Physical tile (%s) have a different number of ports.\n " ,
5123
+ " Logical block (%s) and Sub tile (%s) have a different number of ports.\n " ,
5119
5124
logical_block->name , physical_tile->name );
5120
5125
}
5121
5126
5122
- for (auto pin_map : pin_direct_mapping ) {
5127
+ for (auto pin_map : pin_direct_map ) {
5123
5128
auto block_port = get_port_by_pin (logical_block, pin_map.first .pin );
5124
5129
5125
- for (auto & sub_tile : physical_tile->sub_tiles ) {
5126
- auto equivalent_sites = sub_tile.equivalent_sites ;
5127
- if (std::find (equivalent_sites.begin (), equivalent_sites.end (), logical_block) == equivalent_sites.end ()) {
5128
- continue ;
5129
- }
5130
-
5131
- auto sub_tile_port = get_port_by_pin (&sub_tile, pin_map.second .pin );
5130
+ auto sub_tile_port = get_port_by_pin (sub_tile, pin_map.second .pin );
5132
5131
5133
- VTR_ASSERT (block_port != nullptr );
5134
- VTR_ASSERT (sub_tile_port != nullptr );
5132
+ VTR_ASSERT (block_port != nullptr );
5133
+ VTR_ASSERT (sub_tile_port != nullptr );
5135
5134
5136
- if (sub_tile_port->type != block_port->type
5137
- || sub_tile_port->num_pins != block_port->num_pins
5138
- || sub_tile_port->equivalent != block_port->equivalent ) {
5139
- archfpga_throw (__FILE__, __LINE__,
5140
- " Logical block (%s) and Physical tile (%s) do not have equivalent port specifications.\n " ,
5141
- logical_block->name , sub_tile.name );
5142
- }
5135
+ if (sub_tile_port->type != block_port->type
5136
+ || sub_tile_port->num_pins != block_port->num_pins
5137
+ || sub_tile_port->equivalent != block_port->equivalent ) {
5138
+ archfpga_throw (__FILE__, __LINE__,
5139
+ " Logical block (%s) and Physical tile (%s) do not have equivalent port specifications. Sub tile port %s, logical block port %s\n " ,
5140
+ logical_block->name , sub_tile->name , sub_tile_port->name , block_port->name );
5143
5141
}
5144
5142
}
5145
5143
}
0 commit comments