1
1
#include < numeric>
2
+ #include " arch_types.h"
3
+ #include " physical_types.h"
2
4
#include " vtr_assert.h"
3
5
#include " vtr_util.h"
4
6
@@ -182,8 +184,8 @@ static t_pin_inst_port block_type_pin_index_to_pin_inst(t_physical_tile_type_ptr
182
184
pin_inst_port.logical_block_index = logical_num;
183
185
pin_inst_port.pb_type_idx = pb_type_idx;
184
186
pin_inst_port.pin_physical_num = pin_physical_num;
185
- pin_inst_port.port_index = OPEN ;
186
- pin_inst_port.pin_index_in_port = OPEN ;
187
+ pin_inst_port.port_index = ARCH_FPGA_UNDEFINED_VAL ;
188
+ pin_inst_port.pin_index_in_port = ARCH_FPGA_UNDEFINED_VAL ;
187
189
188
190
if (is_flat && logical_num != -1 ) {
189
191
auto pb_pin = get_pb_pin_from_pin_physical_num (type, pin_physical_num);
@@ -200,8 +202,8 @@ static t_pin_inst_port block_type_pin_index_to_pin_inst(t_physical_tile_type_ptr
200
202
}
201
203
}
202
204
}
203
- VTR_ASSERT (pin_inst_port.port_index != OPEN );
204
- VTR_ASSERT (pin_inst_port.pin_index_in_port != OPEN );
205
+ VTR_ASSERT (pin_inst_port.port_index != ARCH_FPGA_UNDEFINED_VAL );
206
+ VTR_ASSERT (pin_inst_port.pin_index_in_port != ARCH_FPGA_UNDEFINED_VAL );
205
207
return pin_inst_port;
206
208
}
207
209
@@ -435,7 +437,7 @@ int get_sub_tile_physical_pin(int sub_tile_index,
435
437
436
438
int get_logical_block_physical_sub_tile_index (t_physical_tile_type_ptr physical_tile,
437
439
t_logical_block_type_ptr logical_block) {
438
- int sub_tile_index = OPEN ;
440
+ int sub_tile_index = ARCH_FPGA_UNDEFINED_VAL ;
439
441
for (const auto & sub_tile : physical_tile->sub_tiles ) {
440
442
auto eq_sites = sub_tile.equivalent_sites ;
441
443
auto it = std::find (eq_sites.begin (), eq_sites.end (), logical_block);
@@ -444,7 +446,7 @@ int get_logical_block_physical_sub_tile_index(t_physical_tile_type_ptr physical_
444
446
}
445
447
}
446
448
447
- if (sub_tile_index == OPEN ) {
449
+ if (sub_tile_index == ARCH_FPGA_UNDEFINED_VAL ) {
448
450
archfpga_throw (__FILE__, __LINE__,
449
451
" Found no instances of logical block type '%s' within physical tile type '%s'. " ,
450
452
logical_block->name .c_str (), physical_tile->name .c_str ());
@@ -458,7 +460,7 @@ int get_physical_pin(t_physical_tile_type_ptr physical_tile,
458
460
int pin) {
459
461
int sub_tile_index = get_logical_block_physical_sub_tile_index (physical_tile, logical_block);
460
462
461
- if (sub_tile_index == OPEN ) {
463
+ if (sub_tile_index == ARCH_FPGA_UNDEFINED_VAL ) {
462
464
archfpga_throw (__FILE__, __LINE__,
463
465
" Couldn't find the corresponding physical tile type pin of the logical block type pin %d." ,
464
466
pin);
@@ -471,7 +473,7 @@ int get_physical_pin(t_physical_tile_type_ptr physical_tile,
471
473
int get_logical_block_physical_sub_tile_index (t_physical_tile_type_ptr physical_tile,
472
474
t_logical_block_type_ptr logical_block,
473
475
int sub_tile_capacity) {
474
- int sub_tile_index = OPEN ;
476
+ int sub_tile_index = ARCH_FPGA_UNDEFINED_VAL ;
475
477
for (const auto & sub_tile : physical_tile->sub_tiles ) {
476
478
auto eq_sites = sub_tile.equivalent_sites ;
477
479
auto it = std::find (eq_sites.begin (), eq_sites.end (), logical_block);
@@ -482,7 +484,7 @@ int get_logical_block_physical_sub_tile_index(t_physical_tile_type_ptr physical_
482
484
}
483
485
}
484
486
485
- if (sub_tile_index == OPEN ) {
487
+ if (sub_tile_index == ARCH_FPGA_UNDEFINED_VAL ) {
486
488
archfpga_throw (__FILE__, __LINE__,
487
489
" Found no instances of logical block type '%s' within physical tile type '%s'. " ,
488
490
logical_block->name .c_str (), physical_tile->name .c_str ());
@@ -528,7 +530,7 @@ int get_physical_pin_at_sub_tile_location(t_physical_tile_type_ptr physical_tile
528
530
VTR_ASSERT (pin < physical_tile->num_pins );
529
531
int sub_tile_index = get_logical_block_physical_sub_tile_index (physical_tile, logical_block, sub_tile_capacity);
530
532
531
- if (sub_tile_index == OPEN ) {
533
+ if (sub_tile_index == ARCH_FPGA_UNDEFINED_VAL ) {
532
534
archfpga_throw (__FILE__, __LINE__,
533
535
" Couldn't find the corresponding physical tile type pin of the logical block type pin %d." ,
534
536
pin);
@@ -610,7 +612,7 @@ bool is_opin(int ipin, t_physical_tile_type_ptr type) {
610
612
611
613
int iclass = type->pin_class [ipin];
612
614
613
- if (type->class_inf [iclass].type == DRIVER)
615
+ if (type->class_inf [iclass].type == e_pin_type:: DRIVER)
614
616
return true ;
615
617
else
616
618
return false ;
@@ -895,7 +897,7 @@ int get_tile_class_max_ptc(t_physical_tile_type_ptr tile, bool is_flat) {
895
897
/* * get information given pin physical number **/
896
898
std::tuple<const t_sub_tile*, int > get_sub_tile_from_pin_physical_num (t_physical_tile_type_ptr physical_tile, int physical_num) {
897
899
const t_sub_tile* target_sub_tile = nullptr ;
898
- int target_sub_tile_cap = OPEN ;
900
+ int target_sub_tile_cap = ARCH_FPGA_UNDEFINED_VAL ;
899
901
900
902
bool pin_on_tile = is_pin_on_tile (physical_tile, physical_num);
901
903
@@ -926,7 +928,7 @@ t_logical_block_type_ptr get_logical_block_from_pin_physical_num(t_physical_tile
926
928
t_logical_block_type_ptr logical_block = nullptr ;
927
929
928
930
std::tie (sub_tile, sub_tile_cap) = get_sub_tile_from_pin_physical_num (physical_tile, physical_num);
929
- VTR_ASSERT (sub_tile_cap != OPEN );
931
+ VTR_ASSERT (sub_tile_cap != ARCH_FPGA_UNDEFINED_VAL );
930
932
931
933
for (auto logical_block_pin_range_pair : sub_tile->intra_pin_range [sub_tile_cap]) {
932
934
if (physical_num >= logical_block_pin_range_pair.second .low ) {
@@ -1189,7 +1191,7 @@ int get_pb_pin_physical_num(t_physical_tile_type_ptr physical_tile,
1189
1191
t_logical_block_type_ptr logical_block,
1190
1192
int relative_cap,
1191
1193
const t_pb_graph_pin* pin) {
1192
- int pin_physical_num = OPEN ;
1194
+ int pin_physical_num = ARCH_FPGA_UNDEFINED_VAL ;
1193
1195
if (pin->is_root_block_pin ()) {
1194
1196
pin_physical_num = get_physical_pin_at_sub_tile_location (physical_tile,
1195
1197
logical_block,
@@ -1264,12 +1266,12 @@ bool intra_tile_nodes_connected(t_physical_tile_type_ptr physical_type,
1264
1266
const t_sub_tile* from_sub_tile;
1265
1267
int from_sub_tile_rel_cap;
1266
1268
std::tie (from_sub_tile, from_sub_tile_rel_cap) = get_sub_tile_from_pin_physical_num (physical_type, pin_physical_num);
1267
- VTR_ASSERT (from_sub_tile != nullptr && from_sub_tile_rel_cap != OPEN );
1269
+ VTR_ASSERT (from_sub_tile != nullptr && from_sub_tile_rel_cap != ARCH_FPGA_UNDEFINED_VAL );
1268
1270
1269
1271
const t_sub_tile* to_sub_tile;
1270
1272
int to_sub_tile_rel_cap;
1271
1273
std::tie (to_sub_tile, to_sub_tile_rel_cap) = get_sub_tile_from_class_physical_num (physical_type, sink_physical_num);
1272
- VTR_ASSERT (to_sub_tile != nullptr && to_sub_tile_rel_cap != OPEN );
1274
+ VTR_ASSERT (to_sub_tile != nullptr && to_sub_tile_rel_cap != ARCH_FPGA_UNDEFINED_VAL );
1273
1275
1274
1276
return (from_sub_tile_rel_cap == to_sub_tile_rel_cap) && (from_sub_tile == to_sub_tile);
1275
1277
0 commit comments