@@ -232,7 +232,8 @@ static void compute_wire_connections(
232
232
const t_chan_details& chan_details_y,
233
233
t_switchblock_inf* sb,
234
234
const DeviceGrid& grid,
235
- const t_wire_type_sizes* wire_type_sizes,
235
+ const t_wire_type_sizes* wire_type_sizes_x,
236
+ const t_wire_type_sizes* wire_type_sizes_y,
236
237
e_directionality directionality,
237
238
t_sb_connection_map* sb_conns,
238
239
vtr::RandState& rand_state,
@@ -251,7 +252,8 @@ static void compute_wireconn_connections(
251
252
int to_y,
252
253
t_rr_type from_chan_type,
253
254
t_rr_type to_chan_type,
254
- const t_wire_type_sizes* wire_type_sizes,
255
+ const t_wire_type_sizes* wire_type_sizes_x,
256
+ const t_wire_type_sizes* wire_type_sizes_y,
255
257
const t_switchblock_inf* sb,
256
258
t_wireconn_inf* wireconn_ptr,
257
259
t_sb_connection_map* sb_conns,
@@ -317,7 +319,9 @@ t_sb_connection_map* alloc_and_load_switchblock_permutations(const t_chan_detail
317
319
/* Holds temporary memory for parsing. */
318
320
t_wireconn_scratchpad scratchpad;
319
321
320
- /* get a single number for channel width */
322
+ /* get a single number for channel width.
323
+ * AA: Note that this needs be changed to support different horizontal and vertical channels. Future action item ... */
324
+
321
325
int channel_width = nodes_per_chan->max ;
322
326
if (nodes_per_chan->max != nodes_per_chan->x_min || nodes_per_chan->max != nodes_per_chan->y_min ) {
323
327
VPR_FATAL_ERROR (VPR_ERROR_ARCH, " Custom switch blocks currently support consistent channel widths only." );
@@ -329,7 +333,21 @@ t_sb_connection_map* alloc_and_load_switchblock_permutations(const t_chan_detail
329
333
/* We assume that x & y channels have the same ratios of wire types. i.e., looking at a single
330
334
* channel is representative of all channels in the FPGA -- as of 3/9/2013 this is true in VPR */
331
335
t_wire_type_sizes wire_type_sizes;
332
- count_wire_type_sizes (chan_details_x[0 ][0 ].data (), channel_width, &wire_type_sizes);
336
+ t_wire_type_sizes wire_type_sizes_x;
337
+ t_wire_type_sizes wire_type_sizes_y;
338
+
339
+ /* Count the number of wires in each wire type in the specified channel. Note that this is representative of
340
+ * the wire count for every channel in direction due to the assumption stated above.
341
+ * AA: This will not hold if we
342
+ * 1) support different horizontal and vertical segment distributions
343
+ * 2) support non-uniform channel distributions.
344
+ *
345
+ * Future action item ...
346
+ */
347
+
348
+ count_wire_type_sizes (chan_details_y[0 ][0 ].data (), nodes_per_chan->y_max , &wire_type_sizes_y);
349
+ count_wire_type_sizes (chan_details_x[0 ][0 ].data (), nodes_per_chan->x_max , &wire_type_sizes_x);
350
+ count_wire_type_sizes (chan_details_x[0 ][0 ].data (), nodes_per_chan->max , &wire_type_sizes);
333
351
334
352
#ifdef FAST_SB_COMPUTATION
335
353
/* ******* fast switch block computation method; computes a row of switchblocks then stamps it out everywhere ********/
@@ -351,6 +369,9 @@ t_sb_connection_map* alloc_and_load_switchblock_permutations(const t_chan_detail
351
369
grid, &wire_type_sizes, directionality, &sb_row, sb_conns);
352
370
353
371
#else
372
+
373
+ // channel_width is only used in FAST_SB_COMPUTATION, do below so it doesn't throw a compile warning.
374
+ (void )channel_width;
354
375
/* ******* slow switch block computation method; computes switchblocks at each coordinate ********/
355
376
/* iterate over all the switchblocks specified in the architecture */
356
377
for (int i_sb = 0 ; i_sb < (int )switchblocks.size (); i_sb++) {
@@ -373,7 +394,7 @@ t_sb_connection_map* alloc_and_load_switchblock_permutations(const t_chan_detail
373
394
* the current wire will connect to */
374
395
compute_wire_connections (x_coord, y_coord, from_side, to_side,
375
396
chan_details_x, chan_details_y, &sb, grid,
376
- &wire_type_sizes , directionality, sb_conns, rand_state, &scratchpad);
397
+ &wire_type_sizes_x, &wire_type_sizes_y , directionality, sb_conns, rand_state, &scratchpad);
377
398
}
378
399
}
379
400
}
@@ -758,7 +779,7 @@ static void get_switchpoint_wires(
758
779
759
780
/* Compute the wire(s) that the wire at (x, y, from_side, to_side) should connect to.
760
781
* sb_conns is updated with the result */
761
- static void compute_wire_connections (int x_coord, int y_coord, enum e_side from_side, enum e_side to_side, const t_chan_details& chan_details_x, const t_chan_details& chan_details_y, t_switchblock_inf* sb, const DeviceGrid& grid, const t_wire_type_sizes* wire_type_sizes , e_directionality directionality, t_sb_connection_map* sb_conns, vtr::RandState& rand_state, t_wireconn_scratchpad* scratchpad) {
782
+ static void compute_wire_connections (int x_coord, int y_coord, enum e_side from_side, enum e_side to_side, const t_chan_details& chan_details_x, const t_chan_details& chan_details_y, t_switchblock_inf* sb, const DeviceGrid& grid, const t_wire_type_sizes* wire_type_sizes_x, const t_wire_type_sizes* wire_type_sizes_y , e_directionality directionality, t_sb_connection_map* sb_conns, vtr::RandState& rand_state, t_wireconn_scratchpad* scratchpad) {
762
783
int from_x, from_y; /* index into source channel */
763
784
int to_x, to_y; /* index into destination channel */
764
785
t_rr_type from_chan_type, to_chan_type; /* the type of channel - i.e. CHANX or CHANY */
@@ -793,6 +814,14 @@ static void compute_wire_connections(int x_coord, int y_coord, enum e_side from_
793
814
return ;
794
815
}
795
816
817
+ const t_wire_type_sizes* wire_type_sizes_from = wire_type_sizes_x;
818
+ const t_wire_type_sizes* wire_type_sizes_to = wire_type_sizes_x;
819
+ if (from_chan_type == CHANY) {
820
+ wire_type_sizes_from = wire_type_sizes_y;
821
+ }
822
+ if (to_chan_type == CHANY) {
823
+ wire_type_sizes_to = wire_type_sizes_y;
824
+ }
796
825
/* iterate over all the wire connections specified for this switch block */
797
826
for (int iconn = 0 ; iconn < (int )sb->wireconns .size (); iconn++) {
798
827
/* pointer to a connection specification between wire types/subsegment_nums */
@@ -801,8 +830,8 @@ static void compute_wire_connections(int x_coord, int y_coord, enum e_side from_
801
830
/* compute the destination wire segments to which the source wire segment should connect based on the
802
831
* current wireconn */
803
832
compute_wireconn_connections (grid, directionality, from_chan_details, to_chan_details,
804
- sb_conn, from_x, from_y, to_x, to_y, from_chan_type, to_chan_type, wire_type_sizes ,
805
- sb, wireconn_ptr, sb_conns, rand_state, scratchpad);
833
+ sb_conn, from_x, from_y, to_x, to_y, from_chan_type, to_chan_type, wire_type_sizes_from ,
834
+ wire_type_sizes_to, sb, wireconn_ptr, sb_conns, rand_state, scratchpad);
806
835
}
807
836
808
837
return ;
@@ -824,7 +853,8 @@ static void compute_wireconn_connections(
824
853
int to_y,
825
854
t_rr_type from_chan_type,
826
855
t_rr_type to_chan_type,
827
- const t_wire_type_sizes* wire_type_sizes,
856
+ const t_wire_type_sizes* wire_type_sizes_from,
857
+ const t_wire_type_sizes* wire_type_sizes_to,
828
858
const t_switchblock_inf* sb,
829
859
t_wireconn_inf* wireconn_ptr,
830
860
t_sb_connection_map* sb_conns,
@@ -836,12 +866,12 @@ static void compute_wireconn_connections(
836
866
837
867
get_switchpoint_wires (grid,
838
868
from_chan_details[from_x][from_y].data (), from_chan_type, from_x, from_y, sb_conn.from_side ,
839
- wireconn_ptr->from_switchpoint_set , wire_type_sizes , false , wireconn_ptr->from_switchpoint_order , rand_state,
869
+ wireconn_ptr->from_switchpoint_set , wire_type_sizes_from , false , wireconn_ptr->from_switchpoint_order , rand_state,
840
870
&scratchpad->potential_src_wires ,
841
871
&scratchpad->scratch_wires );
842
872
get_switchpoint_wires (grid,
843
873
to_chan_details[to_x][to_y].data (), to_chan_type, to_x, to_y, sb_conn.to_side ,
844
- wireconn_ptr->to_switchpoint_set , wire_type_sizes , true , wireconn_ptr->to_switchpoint_order , rand_state, &scratchpad->potential_dest_wires ,
874
+ wireconn_ptr->to_switchpoint_set , wire_type_sizes_to , true , wireconn_ptr->to_switchpoint_order , rand_state, &scratchpad->potential_dest_wires ,
845
875
&scratchpad->scratch_wires );
846
876
847
877
const auto & potential_src_wires = scratchpad->potential_src_wires ;
0 commit comments