Skip to content

Commit 6e28a9a

Browse files
committed
changed the hardcoded 0 and 1 indicies to constexpr
1 parent aa76412 commit 6e28a9a

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

libs/libarchfpga/src/echo_arch.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313

1414
using vtr::t_linked_vptr;
1515

16+
/// @brief indices to lookup IPIN connection block switch name
17+
constexpr int ipin_cblock_switch_index_within_die = 0;
18+
constexpr int ipin_cblock_switch_index_between_dice = 1;
19+
1620
void PrintArchInfo(FILE* Echo, const t_arch* arch);
1721
static void PrintPb_types_rec(FILE* Echo, const t_pb_type* pb_type, int level);
1822
static void PrintPb_types_recPower(FILE* Echo,
@@ -231,13 +235,13 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
231235
break;
232236
}
233237

234-
fprintf(Echo, "\tInput Connect Block Switch Name Within a Same Die: %s\n", arch->ipin_cblock_switch_name[0].c_str());
238+
fprintf(Echo, "\tInput Connect Block Switch Name Within a Same Die: %s\n", arch->ipin_cblock_switch_name[ipin_cblock_switch_index_within_die].c_str());
235239

236240
//if there is more than one layer available, print the connection block switch name that is used for connection between two dice
237241
for(const auto& layout : arch->grid_layouts){
238242
int num_layers = (int)layout.layers.size();
239243
if(num_layers > 1){
240-
fprintf(Echo, "\tInput Connect Block Switch Name Between Two Dice: %s\n", arch->ipin_cblock_switch_name[1].c_str());
244+
fprintf(Echo, "\tInput Connect Block Switch Name Between Two Dice: %s\n", arch->ipin_cblock_switch_name[[ipin_cblock_switch_index_between_dice].c_str());
241245
}
242246
}
243247

0 commit comments

Comments
 (0)