83 int *num_inputs_to_cblock;
87 boolean * cblock_counted;
88 float *shared_buffer_trans;
89 float *unsharable_switch_trans, *sharable_switch_trans;
92 int from_node, to_node, iedge, num_edges, maxlen;
93 int iswitch, i, j, iseg, max_inputs_to_cblock;
94 float input_cblock_trans, shared_opin_buffer_trans;
95 const float trans_sram_bit = 6.;
105 double ntrans_sharing, ntrans_no_sharing;
111 float trans_track_to_cblock_buf;
112 float trans_cblock_to_lblock_buf;
115 ntrans_no_sharing = 0.;
116 max_inputs_to_cblock = 0;
122 trans_track_to_cblock_buf =
trans_per_buf(R_minW_nmos / 4., R_minW_nmos,
125 trans_cblock_to_lblock_buf =
trans_per_buf(R_minW_nmos / 4., R_minW_nmos,
131 cblock_counted = (
boolean *)
my_calloc(maxlen,
sizeof(
boolean));
132 shared_buffer_trans = (
float *)
my_calloc(maxlen,
sizeof(
float));
135 trans_sram_bit, R_minW_nmos);
138 trans_sram_bit, R_minW_nmos, R_minW_pmos);
140 for (from_node = 0; from_node <
num_rr_nodes; from_node++) {
144 switch (from_rr_type) {
150 for (iedge = 0; iedge < num_edges; iedge++) {
155 switch (to_rr_type) {
163 shared_buffer_trans[iseg] =
std::max(
164 shared_buffer_trans[iseg],
165 sharable_switch_trans[iswitch]);
167 ntrans_no_sharing += unsharable_switch_trans[iswitch]
168 + sharable_switch_trans[iswitch];
169 ntrans_sharing += unsharable_switch_trans[iswitch];
170 }
else if (from_node < to_node) {
175 ntrans_no_sharing += unsharable_switch_trans[iswitch];
176 ntrans_sharing += unsharable_switch_trans[iswitch];
181 num_inputs_to_cblock[to_node]++;
182 max_inputs_to_cblock =
std::max(max_inputs_to_cblock,
183 num_inputs_to_cblock[to_node]);
187 if (cblock_counted[iseg] ==
FALSE) {
188 cblock_counted[iseg] =
TRUE;
189 ntrans_sharing += trans_track_to_cblock_buf;
190 ntrans_no_sharing += trans_track_to_cblock_buf;
195 vpr_printf(TIO_MESSAGE_ERROR,
"in count_routing_transistors:\n");
196 vpr_printf(TIO_MESSAGE_ERROR,
"\tUnexpected connection from node %d (type %d) to node %d (type %d).\n",
197 from_node, from_rr_type, to_node, to_rr_type);
207 if (from_rr_type ==
CHANX) {
208 for (i =
rr_node[from_node].xlow - 1;
210 ntrans_sharing += shared_buffer_trans[i];
211 shared_buffer_trans[i] = 0.;
216 cblock_counted[i] =
FALSE;
219 for (j =
rr_node[from_node].ylow - 1;
221 ntrans_sharing += shared_buffer_trans[j];
222 shared_buffer_trans[j] = 0.;
227 cblock_counted[j] =
FALSE;
234 shared_opin_buffer_trans = 0.;
236 for (iedge = 0; iedge < num_edges; iedge++) {
238 ntrans_no_sharing += unsharable_switch_trans[iswitch]
239 + sharable_switch_trans[iswitch];
240 ntrans_sharing += unsharable_switch_trans[iswitch];
242 shared_opin_buffer_trans =
std::max(shared_opin_buffer_trans,
243 sharable_switch_trans[iswitch]);
246 ntrans_sharing += shared_opin_buffer_trans;
255 free(cblock_counted);
256 free(shared_buffer_trans);
257 free(unsharable_switch_trans);
258 free(sharable_switch_trans);
263 max_inputs_to_cblock, trans_cblock_to_lblock_buf, trans_sram_bit);
265 free(num_inputs_to_cblock);
267 ntrans_sharing += input_cblock_trans;
268 ntrans_no_sharing += input_cblock_trans;
271 vpr_printf(TIO_MESSAGE_INFO,
"Routing area (in minimum width transistor areas)...\n");
272 vpr_printf(TIO_MESSAGE_INFO,
"\tAssuming no buffer sharing (pessimistic). Total: %#g, per logic tile: %#g\n",
273 ntrans_no_sharing, ntrans_no_sharing / (
float) (
nx *
ny));
274 vpr_printf(TIO_MESSAGE_INFO,
"\tAssuming buffer sharing (slightly optimistic). Total: %#g, per logic tile: %#g\n",
275 ntrans_sharing, ntrans_sharing / (
float) (
nx *
ny));
int seg_index_of_cblock(t_rr_type from_rr_type, int to_node)
void * my_calloc(size_t nelem, size_t size)
static float trans_per_buf(float Rbuf, float R_minW_nmos, float R_minW_pmos)
int seg_index_of_sblock(int from_node, int to_node)
static float * alloc_and_load_unsharable_switch_trans(int num_switch, float trans_sram_bit, float R_minW_nmos)
static float * alloc_and_load_sharable_switch_trans(int num_switch, float trans_sram_bit, float R_minW_nmos, float R_minW_pmos)
struct s_switch_inf * switch_inf
static float get_cblock_trans(int *num_inputs_to_cblock, int max_inputs_to_cblock, float trans_cblock_to_lblock_buf, float trans_sram_bit)