Skip to content

Commit f4bd1be

Browse files
authored
Merge pull request verilog-to-routing#2552 from verilog-to-routing/echo_seg_fault_fix
Architecture Seg Fault Issue
2 parents 594e96b + 6c4f17e commit f4bd1be

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

libs/libarchfpga/src/echo_arch.cpp

Lines changed: 16 additions & 5 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,10 +235,14 @@ 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());
239+
235240
//if there is more than one layer available, print the connection block switch name that is used for connection between two dice
236-
if (arch->grid_layouts.size() > 1) {
237-
fprintf(Echo, "\tInput Connect Block Switch Name Between Two Dice: %s\n", arch->ipin_cblock_switch_name[1].c_str());
241+
for(const auto& layout : arch->grid_layouts){
242+
int num_layers = (int)layout.layers.size();
243+
if(num_layers > 1){
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());
245+
}
238246
}
239247

240248
fprintf(Echo, "*************************************************\n\n");
@@ -287,9 +295,12 @@ void PrintArchInfo(FILE* Echo, const t_arch* arch) {
287295
fprintf(Echo, "\t\t\t\ttype unidir mux_name for within die connections: %s\n",
288296
arch->Switches[seg.arch_wire_switch].name.c_str());
289297
//if there is more than one layer available, print the segment switch name that is used for connection between two dice
290-
if (arch->grid_layouts.size() > 1) {
291-
fprintf(Echo, "\t\t\t\ttype unidir mux_name for between two dice connections: %s\n",
298+
for(const auto& layout : arch->grid_layouts){
299+
int num_layers = (int)layout.layers.size();
300+
if(num_layers > 1){
301+
fprintf(Echo, "\t\t\t\ttype unidir mux_name for between two dice connections: %s\n",
292302
arch->Switches[seg.arch_opin_between_dice_switch].name.c_str());
303+
}
293304
}
294305
} else { //Should be bidir
295306
fprintf(Echo, "\t\t\t\ttype bidir wire_switch %s arch_opin_switch %s\n",

0 commit comments

Comments
 (0)