Skip to content

Commit c85878d

Browse files
committed
place: added equivalent sites placement capability
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent 26bac82 commit c85878d

40 files changed

+570
-294
lines changed

libs/libarchfpga/src/arch_util.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -252,10 +252,6 @@ void free_type_descriptors(std::vector<t_physical_tile_type>& type_descriptors)
252252
vtr::free(type.is_pin_global);
253253
vtr::free(type.pin_class);
254254

255-
for (auto equivalent_site : type.equivalent_sites) {
256-
vtr::free(equivalent_site.pb_type_name);
257-
}
258-
259255
for (auto port : type.ports) {
260256
vtr::free(port.name);
261257
}

libs/libarchfpga/src/physical_types.h

Lines changed: 26 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,9 @@ struct t_port_power;
5555
struct t_physical_tile_port;
5656
struct t_equivalent_site;
5757
struct t_physical_tile_type;
58+
typedef const t_physical_tile_type* t_physical_tile_type_ptr;
5859
struct t_logical_block_type;
60+
typedef const t_logical_block_type* t_logical_block_type_ptr;
5961
struct t_pb_type;
6062
struct t_pb_graph_pin_power;
6163
struct t_mode;
@@ -521,27 +523,6 @@ enum class e_sb_type {
521523
constexpr int NO_SWITCH = -1;
522524
constexpr int DEFAULT_SWITCH = -2;
523525

524-
/* Describes the type for a logical block
525-
* name: unique identifier for type
526-
* pb_type: Internal subblocks and routing information for this physical block
527-
* pb_graph_head: Head of DAG of pb_types_nodes and their edges
528-
*
529-
* index: Keep track of type in array for easy access
530-
* physical_tile_index: index of the corresponding physical tile type
531-
*/
532-
struct t_logical_block_type {
533-
char* name = nullptr;
534-
535-
/* Clustering info */
536-
t_pb_type* pb_type = nullptr;
537-
t_pb_graph_node* pb_graph_head = nullptr;
538-
539-
int index = -1; /* index of type descriptor in array (allows for index referencing) */
540-
541-
int physical_tile_index = -1; /* index of the corresponding physical tile type */
542-
};
543-
typedef const t_logical_block_type* t_logical_block_type_ptr;
544-
545526
/* Describes the type for a physical tile
546527
* name: unique identifier for type
547528
* num_pins: Number of pins for the block
@@ -626,14 +607,13 @@ struct t_physical_tile_type {
626607

627608
int index = -1; /* index of type descriptor in array (allows for index referencing) */
628609

629-
int logical_block_index = -1; /* index of the corresponding logical block type */
630-
631-
std::vector<t_equivalent_site> equivalent_sites;
610+
std::vector<std::string> equivalent_sites_names;
611+
std::vector<t_logical_block_type_ptr> equivalent_sites;
612+
std::unordered_map<int, std::unordered_map<int, int>> tile_block_pin_directs_map;
632613

633614
/* Returns the indices of pins that contain a clock for this physical logic block */
634615
std::vector<int> get_clock_pins_indices() const;
635616
};
636-
typedef const t_physical_tile_type* t_physical_tile_type_ptr;
637617

638618
/** Describes I/O and clock ports of a physical tile type
639619
*
@@ -668,17 +648,24 @@ struct t_physical_tile_port {
668648
int tile_type_index;
669649
};
670650

671-
/** Describes the equivalent sites related to a specific tile type
672-
*
673-
* It corresponds to the <tile> tags in the FPGA architecture description
651+
/* Describes the type for a logical block
652+
* name: unique identifier for type
653+
* pb_type: Internal subblocks and routing information for this physical block
654+
* pb_graph_head: Head of DAG of pb_types_nodes and their edges
674655
*
656+
* index: Keep track of type in array for easy access
657+
* physical_tile_index: index of the corresponding physical tile type
675658
*/
676-
struct t_equivalent_site {
677-
char* pb_type_name;
659+
struct t_logical_block_type {
660+
char* name = nullptr;
661+
662+
/* Clustering info */
663+
t_pb_type* pb_type = nullptr;
664+
t_pb_graph_node* pb_graph_head = nullptr;
678665

679-
// XXX Variables to hold information on mapping between site and tile
680-
// XXX as well as references to the belonging pb_type and tile_type
681-
//t_logical_block_type* block_type;
666+
int index = -1; /* index of type descriptor in array (allows for index referencing) */
667+
668+
std::vector<t_physical_tile_type_ptr> equivalent_tiles;
682669
};
683670

684671
/*************************************************************************************************
@@ -726,8 +713,9 @@ struct t_equivalent_site {
726713
* modes: Different modes accepted
727714
* ports: I/O and clock ports
728715
* num_clock_pins: A count of the total number of clock pins
729-
* int num_input_pins: A count of the total number of input pins
730-
* int num_output_pins: A count of the total number of output pins
716+
* num_input_pins: A count of the total number of input pins
717+
* num_output_pins: A count of the total number of output pins
718+
* num_pins: A count of the total number of pins
731719
* timing: Timing matrix of block [0..num_inputs-1][0..num_outputs-1]
732720
* parent_mode: mode of the parent block
733721
* t_mode_power: ???
@@ -749,6 +737,8 @@ struct t_pb_type {
749737
int num_input_pins = 0; /* inputs not including clock pins */
750738
int num_output_pins = 0;
751739

740+
int num_pins = 0;
741+
752742
t_mode* parent_mode = nullptr;
753743
int depth = 0; /* depth of pb_type */
754744

@@ -861,6 +851,7 @@ struct t_port {
861851

862852
int index;
863853
int port_index_by_type;
854+
int absolute_first_pin_index;
864855

865856
t_port_power* port_power;
866857
};

0 commit comments

Comments
 (0)