174 static void find_all_the_macro (
int * num_of_macro,
int * pl_macro_member_blk_num_of_this_blk,
175 int * pl_macro_idirect,
int * pl_macro_num_members,
int ** pl_macro_member_blk_num);
184 int * pl_macro_idirect,
int * pl_macro_num_members,
int ** pl_macro_member_blk_num) {
193 int iblk, from_iblk_pin, to_iblk_pin, from_inet, to_inet, from_idirect, to_idirect,
194 from_src_or_sink, to_src_or_sink;
195 int next_iblk, curr_iblk, next_inet, curr_inet;
196 int num_blk_pins, num_macro;
203 for (to_iblk_pin = 0; to_iblk_pin < num_blk_pins; to_iblk_pin++) {
211 if ( to_src_or_sink ==
SINK && to_idirect !=
OPEN && to_inet ==
OPEN ) {
213 for (from_iblk_pin = 0; from_iblk_pin < num_blk_pins; from_iblk_pin++) {
214 from_inet = block[iblk].nets[from_iblk_pin];
220 if ( from_src_or_sink ==
SOURCE && to_idirect == from_idirect && from_inet !=
OPEN) {
223 pl_macro_member_blk_num_of_this_blk[0] = iblk;
224 pl_macro_idirect[num_macro] = to_idirect;
227 pl_macro_num_members[num_macro]++;
233 next_inet = from_inet;
237 while (next_inet !=
OPEN) {
239 curr_iblk = next_iblk;
240 curr_inet = next_inet;
243 assert(
clb_net[curr_inet].num_sinks == 1);
249 next_inet = block[next_iblk].nets[from_iblk_pin];
252 imember = pl_macro_num_members[num_macro];
253 pl_macro_member_blk_num_of_this_blk[imember] = next_iblk;
256 pl_macro_num_members[num_macro]++;
261 pl_macro_member_blk_num[num_macro] =
262 (
int *)
my_calloc (pl_macro_num_members[num_macro] ,
sizeof(
int));
264 for (imember = 0; imember < pl_macro_num_members[num_macro]; imember ++)
265 pl_macro_member_blk_num[num_macro][imember] = pl_macro_member_blk_num_of_this_blk[imember];
277 *num_of_macro = num_macro;
302 int imacro, imember, num_macro;
303 int *pl_macro_idirect, *pl_macro_num_members, **pl_macro_member_blk_num,
304 *pl_macro_member_blk_num_of_this_blk;
326 pl_macro_idirect, pl_macro_num_members, pl_macro_member_blk_num);
333 for (imacro = 0; imacro < num_macro; imacro++) {
334 macro[imacro].
num_blocks = pl_macro_num_members[imacro];
339 for (imember = 0; imember < macro[imacro].
num_blocks; imember++) {
343 macro[imacro].
members[imember].
blk_index = pl_macro_member_blk_num[imacro][imember];
348 free(pl_macro_num_members);
349 free(pl_macro_idirect);
350 for(imacro=0; imacro < num_macro; imacro++) {
351 free(pl_macro_member_blk_num[imacro]);
353 free(pl_macro_member_blk_num);
354 free(pl_macro_member_blk_num_of_this_blk);
400 int * temp_imacro_from_iblk = NULL;
401 int imacro, imember, iblk;
406 temp_imacro_from_iblk[iblk] =
OPEN;
410 for (imacro = 0; imacro < num_macros; imacro++) {
411 for (imember = 0; imember < macros[imacro].
num_blocks; imember++) {
413 temp_imacro_from_iblk[iblk] = imacro;
428 for (itype = 1; itype <
num_types; itype++) {
436 for (itype = 1; itype <
num_types; itype++) {
void get_imacro_from_iblk(int *imacro, int iblk, t_pl_macro *macros, int num_macros)
static int ** f_direct_type_from_blk_pin
void * my_calloc(size_t nelem, size_t size)
static int ** f_idirect_from_blk_pin
static void find_all_the_macro(int *num_of_macro, int *pl_macro_member_blk_num_of_this_blk, int *pl_macro_idirect, int *pl_macro_num_members, int **pl_macro_member_blk_num)
t_pl_macro_member * members
static void * my_malloc(int ibytes)
void free_placement_macros_structs(void)
static void free_imacro_from_iblk(void)
static void alloc_and_load_imacro_from_iblk(t_pl_macro *macros, int num_macros)
static int * f_imacro_from_iblk
void alloc_and_load_idirect_from_blk_pin(t_direct_inf *directs, int num_directs, int ***idirect_from_blk_pin, int ***direct_type_from_blk_pin)
int alloc_and_load_placement_macros(t_direct_inf *directs, int num_directs, t_pl_macro **macros)