11#include < numeric>
2+ #include " arch_types.h"
3+ #include " physical_types.h"
24#include " vtr_assert.h"
35#include " vtr_util.h"
46
@@ -182,8 +184,8 @@ static t_pin_inst_port block_type_pin_index_to_pin_inst(t_physical_tile_type_ptr
182184 pin_inst_port.logical_block_index = logical_num;
183185 pin_inst_port.pb_type_idx = pb_type_idx;
184186 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 ;
187189
188190 if (is_flat && logical_num != -1 ) {
189191 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
200202 }
201203 }
202204 }
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 );
205207 return pin_inst_port;
206208}
207209
@@ -435,7 +437,7 @@ int get_sub_tile_physical_pin(int sub_tile_index,
435437
436438int get_logical_block_physical_sub_tile_index (t_physical_tile_type_ptr physical_tile,
437439 t_logical_block_type_ptr logical_block) {
438- int sub_tile_index = OPEN ;
440+ int sub_tile_index = ARCH_FPGA_UNDEFINED_VAL ;
439441 for (const auto & sub_tile : physical_tile->sub_tiles ) {
440442 auto eq_sites = sub_tile.equivalent_sites ;
441443 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_
444446 }
445447 }
446448
447- if (sub_tile_index == OPEN ) {
449+ if (sub_tile_index == ARCH_FPGA_UNDEFINED_VAL ) {
448450 archfpga_throw (__FILE__, __LINE__,
449451 " Found no instances of logical block type '%s' within physical tile type '%s'. " ,
450452 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,
458460 int pin) {
459461 int sub_tile_index = get_logical_block_physical_sub_tile_index (physical_tile, logical_block);
460462
461- if (sub_tile_index == OPEN ) {
463+ if (sub_tile_index == ARCH_FPGA_UNDEFINED_VAL ) {
462464 archfpga_throw (__FILE__, __LINE__,
463465 " Couldn't find the corresponding physical tile type pin of the logical block type pin %d." ,
464466 pin);
@@ -471,7 +473,7 @@ int get_physical_pin(t_physical_tile_type_ptr physical_tile,
471473int get_logical_block_physical_sub_tile_index (t_physical_tile_type_ptr physical_tile,
472474 t_logical_block_type_ptr logical_block,
473475 int sub_tile_capacity) {
474- int sub_tile_index = OPEN ;
476+ int sub_tile_index = ARCH_FPGA_UNDEFINED_VAL ;
475477 for (const auto & sub_tile : physical_tile->sub_tiles ) {
476478 auto eq_sites = sub_tile.equivalent_sites ;
477479 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_
482484 }
483485 }
484486
485- if (sub_tile_index == OPEN ) {
487+ if (sub_tile_index == ARCH_FPGA_UNDEFINED_VAL ) {
486488 archfpga_throw (__FILE__, __LINE__,
487489 " Found no instances of logical block type '%s' within physical tile type '%s'. " ,
488490 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
528530 VTR_ASSERT (pin < physical_tile->num_pins );
529531 int sub_tile_index = get_logical_block_physical_sub_tile_index (physical_tile, logical_block, sub_tile_capacity);
530532
531- if (sub_tile_index == OPEN ) {
533+ if (sub_tile_index == ARCH_FPGA_UNDEFINED_VAL ) {
532534 archfpga_throw (__FILE__, __LINE__,
533535 " Couldn't find the corresponding physical tile type pin of the logical block type pin %d." ,
534536 pin);
@@ -610,7 +612,7 @@ bool is_opin(int ipin, t_physical_tile_type_ptr type) {
610612
611613 int iclass = type->pin_class [ipin];
612614
613- if (type->class_inf [iclass].type == DRIVER)
615+ if (type->class_inf [iclass].type == e_pin_type:: DRIVER)
614616 return true ;
615617 else
616618 return false ;
@@ -895,7 +897,7 @@ int get_tile_class_max_ptc(t_physical_tile_type_ptr tile, bool is_flat) {
895897/* * get information given pin physical number **/
896898std::tuple<const t_sub_tile*, int > get_sub_tile_from_pin_physical_num (t_physical_tile_type_ptr physical_tile, int physical_num) {
897899 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 ;
899901
900902 bool pin_on_tile = is_pin_on_tile (physical_tile, physical_num);
901903
@@ -926,7 +928,7 @@ t_logical_block_type_ptr get_logical_block_from_pin_physical_num(t_physical_tile
926928 t_logical_block_type_ptr logical_block = nullptr ;
927929
928930 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 );
930932
931933 for (auto logical_block_pin_range_pair : sub_tile->intra_pin_range [sub_tile_cap]) {
932934 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,
11891191 t_logical_block_type_ptr logical_block,
11901192 int relative_cap,
11911193 const t_pb_graph_pin* pin) {
1192- int pin_physical_num = OPEN ;
1194+ int pin_physical_num = ARCH_FPGA_UNDEFINED_VAL ;
11931195 if (pin->is_root_block_pin ()) {
11941196 pin_physical_num = get_physical_pin_at_sub_tile_location (physical_tile,
11951197 logical_block,
@@ -1264,12 +1266,12 @@ bool intra_tile_nodes_connected(t_physical_tile_type_ptr physical_type,
12641266 const t_sub_tile* from_sub_tile;
12651267 int from_sub_tile_rel_cap;
12661268 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 );
12681270
12691271 const t_sub_tile* to_sub_tile;
12701272 int to_sub_tile_rel_cap;
12711273 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 );
12731275
12741276 return (from_sub_tile_rel_cap == to_sub_tile_rel_cap) && (from_sub_tile == to_sub_tile);
12751277
0 commit comments