@@ -347,17 +347,17 @@ static t_pb_graph_pin* get_driver_pb_graph_pin(const t_pb* driver_pb, const Atom
347
347
348
348
static void update_pb_type_count (const t_pb* pb, std::unordered_map<std::string, int >& pb_type_count);
349
349
350
- static void update_alm_count (const t_pb* pb, const t_type_ptr logic_block_type, const t_pb_type* alm_pb_type , std::vector<int >& alm_count );
350
+ static void update_le_count (const t_pb* pb, const t_type_ptr logic_block_type, const t_pb_type* le_pb_type , std::vector<int >& le_count );
351
351
352
352
static void print_pb_type_count (std::unordered_map<std::string, int >& pb_type_count);
353
353
354
354
static t_type_ptr identify_logic_block_type (std::map<const t_model*, std::vector<t_type_ptr>>& primitive_candidate_block_types);
355
355
356
- static t_pb_type* identify_alm_block_type (t_type_ptr logic_block_type);
356
+ static t_pb_type* identify_le_block_type (t_type_ptr logic_block_type);
357
357
358
358
static bool pb_used_for_blif_model (const t_pb* pb, std::string blif_model_name);
359
359
360
- static void print_alm_count (std::vector<int >& alm_count );
360
+ static void print_le_count (std::vector<int >& le_count, const t_pb_type* le_pb_type );
361
361
362
362
/* ****************************************/
363
363
/* globally accessible function*/
@@ -420,16 +420,15 @@ std::map<t_type_ptr, size_t> do_clustering(const t_packer_opts& packer_opts,
420
420
// used for each physical block type defined in the architecture file.
421
421
std::unordered_map<std::string, int > pb_type_count;
422
422
423
- // this data structure tracks the number of ALMs used. It is populated only
424
- // for architectures which has an ALM-like logic blocks. The architecture is
425
- // assumed to have an ALM-like logic block only if it has a logic block that
426
- // contains LUT primitives and is the first pb_block to have more than one
427
- // instance from the top of the hierarchy (All parent pb_block have one
428
- // instance only and one mode only). Index 0 holds the number of ALMs that are
429
- // used for both logic (LUTs/adders) and registers. Index 1 holds the number
430
- // of ALMs that are used for logic (LUTs/adders) only. Index 2 holds the
431
- // number of ALMs that are used for registers only.
432
- std::vector<int > alm_count (3 , 0 );
423
+ // this data structure tracks the number of Logic Elements (LEs) used. It is
424
+ // populated only for architectures which has LEs. The architecture is assumed
425
+ // to have LEs only iff it has a logic block that contains LUT primitives and is
426
+ // the first pb_block to have more than one instance from the top of the hierarchy
427
+ // (All parent pb_block have one instance only and one mode only). Index 0 holds
428
+ // the number of LEs that are used for both logic (LUTs/adders) and registers.
429
+ // Index 1 holds the number of LEs that are used for logic (LUTs/adders) only.
430
+ // Index 2 holds the number of LEs that are used for registers only.
431
+ std::vector<int > le_count (3 , 0 );
433
432
434
433
num_clb = 0 ;
435
434
@@ -482,8 +481,8 @@ std::map<t_type_ptr, size_t> do_clustering(const t_packer_opts& packer_opts,
482
481
auto primitive_candidate_block_types = identify_primitive_candidate_block_types ();
483
482
// find the cluster type that has lut primitives
484
483
auto logic_block_type = identify_logic_block_type (primitive_candidate_block_types);
485
- // find an ALM-like pb_type within the found logic_block_type
486
- auto alm_pb_type = identify_alm_block_type (logic_block_type);
484
+ // find a LE pb_type within the found logic_block_type
485
+ auto le_pb_type = identify_le_block_type (logic_block_type);
487
486
488
487
blocks_since_last_analysis = 0 ;
489
488
num_blocks_hill_added = 0 ;
@@ -737,8 +736,8 @@ std::map<t_type_ptr, size_t> do_clustering(const t_packer_opts& packer_opts,
737
736
auto cur_pb = cluster_ctx.clb_nlist .block_pb (clb_index);
738
737
// update the pb type count by counting the used pb types in this packed cluster
739
738
update_pb_type_count (cur_pb, pb_type_count);
740
- // update the data structure holding the alm counts
741
- update_alm_count (cur_pb, logic_block_type, alm_pb_type, alm_count );
739
+ // update the data structure holding the LE counts
740
+ update_le_count (cur_pb, logic_block_type, le_pb_type, le_count );
742
741
free_pb_stats_recursive (cur_pb);
743
742
} else {
744
743
/* Free up data structures and requeue used molecules */
@@ -758,9 +757,9 @@ std::map<t_type_ptr, size_t> do_clustering(const t_packer_opts& packer_opts,
758
757
// physical block type after finishing the packing stage
759
758
print_pb_type_count (pb_type_count);
760
759
761
- // if this architecture has an ALM-like physical block, report its usage
762
- if (alm_pb_type ) {
763
- print_alm_count (alm_count );
760
+ // if this architecture has LE physical block, report its usage
761
+ if (le_pb_type ) {
762
+ print_le_count (le_count, le_pb_type );
764
763
}
765
764
766
765
/* ***************************************************************
@@ -3402,13 +3401,13 @@ static t_type_ptr identify_logic_block_type(std::map<const t_model*, std::vector
3402
3401
}
3403
3402
3404
3403
/* *
3405
- * This function returns the pb_type that is similar to an ALM in an Intel
3406
- * FPGA. The ALM is defined as a physical block that contains a LUT primitive and
3404
+ * This function returns the pb_type that is similar to Logic Element (LE) in an FPGA
3405
+ * The LE is defined as a physical block that contains a LUT primitive and
3407
3406
* is found by searching a cluster type to find the first pb_type (from the top
3408
- * of the hierarchy clb->alm ) that has more than one instance within the cluster.
3407
+ * of the hierarchy clb->LE ) that has more than one instance within the cluster.
3409
3408
*/
3410
- static t_pb_type* identify_alm_block_type (t_type_ptr logic_block_type) {
3411
- // if there is no CLB-like cluster, then there is no ALM-like pb_block
3409
+ static t_pb_type* identify_le_block_type (t_type_ptr logic_block_type) {
3410
+ // if there is no CLB-like cluster, then there is no LE pb_block
3412
3411
if (!logic_block_type)
3413
3412
return nullptr ;
3414
3413
@@ -3423,7 +3422,7 @@ static t_pb_type* identify_alm_block_type(t_type_ptr logic_block_type) {
3423
3422
// explore the only child of this pb_graph_node
3424
3423
pb_graph_node = &pb_graph_node->child_pb_graph_nodes [0 ][0 ][0 ];
3425
3424
// if the child node has more than one instance in the
3426
- // cluster then this is the pb_type similar to an ALM
3425
+ // cluster then this is the pb_type similar to a LE
3427
3426
if (pb_graph_node->pb_type ->num_pb > 1 )
3428
3427
return pb_graph_node->pb_type ;
3429
3428
}
@@ -3432,12 +3431,12 @@ static t_pb_type* identify_alm_block_type(t_type_ptr logic_block_type) {
3432
3431
}
3433
3432
3434
3433
/* *
3435
- * This function updates the alm_count data structure from the given packed cluster
3434
+ * This function updates the le_count data structure from the given packed cluster
3436
3435
*/
3437
- static void update_alm_count (const t_pb* pb, const t_type_ptr logic_block_type, const t_pb_type* alm_pb_type , std::vector<int >& alm_count ) {
3438
- // if this cluster doesn't contain ALMs or there
3439
- // are no alms in this architecture, ignore it
3440
- if (!logic_block_type || pb->pb_graph_node != logic_block_type->pb_graph_head || !alm_pb_type )
3436
+ static void update_le_count (const t_pb* pb, const t_type_ptr logic_block_type, const t_pb_type* le_pb_type , std::vector<int >& le_count ) {
3437
+ // if this cluster doesn't contain LEs or there
3438
+ // are no les in this architecture, ignore it
3439
+ if (!logic_block_type || pb->pb_graph_node != logic_block_type->pb_graph_head || !le_pb_type )
3441
3440
return ;
3442
3441
3443
3442
const std::string lut (" .names" );
@@ -3446,29 +3445,29 @@ static void update_alm_count(const t_pb* pb, const t_type_ptr logic_block_type,
3446
3445
3447
3446
auto parent_pb = pb;
3448
3447
3449
- // go down the hierarchy till the parent physical block of the ALM is found
3450
- while (parent_pb->child_pbs [0 ][0 ].pb_graph_node ->pb_type != alm_pb_type ) {
3448
+ // go down the hierarchy till the parent physical block of the LE is found
3449
+ while (parent_pb->child_pbs [0 ][0 ].pb_graph_node ->pb_type != le_pb_type ) {
3451
3450
parent_pb = &parent_pb->child_pbs [0 ][0 ];
3452
3451
}
3453
3452
3454
- // iterate over all the ALMs and update the ALM count accordingly
3455
- for (int ialm = 0 ; ialm < parent_pb->get_num_children_of_type (0 ); ialm ++) {
3456
- if (!parent_pb->child_pbs [0 ][ialm ].name )
3453
+ // iterate over all the LEs and update the LE count accordingly
3454
+ for (int ile = 0 ; ile < parent_pb->get_num_children_of_type (0 ); ile ++) {
3455
+ if (!parent_pb->child_pbs [0 ][ile ].name )
3457
3456
continue ;
3458
3457
3459
- auto has_used_lut = pb_used_for_blif_model (&parent_pb->child_pbs [0 ][ialm ], lut);
3460
- auto has_used_adder = pb_used_for_blif_model (&parent_pb->child_pbs [0 ][ialm ], adder);
3461
- auto has_used_ff = pb_used_for_blif_model (&parent_pb->child_pbs [0 ][ialm ], ff);
3458
+ auto has_used_lut = pb_used_for_blif_model (&parent_pb->child_pbs [0 ][ile ], lut);
3459
+ auto has_used_adder = pb_used_for_blif_model (&parent_pb->child_pbs [0 ][ile ], adder);
3460
+ auto has_used_ff = pb_used_for_blif_model (&parent_pb->child_pbs [0 ][ile ], ff);
3462
3461
3463
- // First type of ALMs : used for logic and registers
3462
+ // First type of LEs : used for logic and registers
3464
3463
if ((has_used_lut || has_used_adder) && has_used_ff) {
3465
- alm_count [0 ]++;
3466
- // Second type of ALMs : used for logic only
3464
+ le_count [0 ]++;
3465
+ // Second type of LEs : used for logic only
3467
3466
} else if (has_used_lut || has_used_adder) {
3468
- alm_count [1 ]++;
3469
- // Third type of ALMs : used for registers only
3467
+ le_count [1 ]++;
3468
+ // Third type of LEs : used for registers only
3470
3469
} else if (has_used_ff) {
3471
- alm_count [2 ]++;
3470
+ le_count [2 ]++;
3472
3471
}
3473
3472
}
3474
3473
}
@@ -3505,12 +3504,12 @@ static bool pb_used_for_blif_model(const t_pb* pb, std::string blif_model_name)
3505
3504
}
3506
3505
3507
3506
/* *
3508
- * Print the alm count data strurture
3507
+ * Print the LE count data strurture
3509
3508
*/
3510
- static void print_alm_count (std::vector<int >& alm_count ) {
3511
- VTR_LOG (" \n ALM count... \n " );
3512
- VTR_LOG (" Total number of ALMs used : %d\n " , alm_count [0 ] + alm_count [1 ] + alm_count [2 ]);
3513
- VTR_LOG (" ALMs used for logic and registers : %d\n " , alm_count [0 ]);
3514
- VTR_LOG (" ALMs used for logic only : %d\n " , alm_count [1 ]);
3515
- VTR_LOG (" ALMs used for registers only : %d\n\n " , alm_count [2 ]);
3509
+ static void print_le_count (std::vector<int >& le_count, const t_pb_type* le_pb_type ) {
3510
+ VTR_LOG (" \n Logic Element (%s) detailed count: \n " , le_pb_type-> name );
3511
+ VTR_LOG (" Total number of Logic Elements used : %d\n " , le_count [0 ] + le_count [1 ] + le_count [2 ]);
3512
+ VTR_LOG (" LEs used for logic and registers : %d\n " , le_count [0 ]);
3513
+ VTR_LOG (" LEs used for logic only : %d\n " , le_count [1 ]);
3514
+ VTR_LOG (" LEs used for registers only : %d\n\n " , le_count [2 ]);
3516
3515
}
0 commit comments