Skip to content

Commit c182f64

Browse files
committed
initial addition of tile tag
Signed-off-by: Alessandro Comodi <[email protected]>
1 parent e2f3f72 commit c182f64

File tree

5 files changed

+406
-137
lines changed

5 files changed

+406
-137
lines changed

libs/libarchfpga/src/physical_types.cpp

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,10 @@ static e_directionality switch_type_directionaity(SwitchType type) {
103103
/*
104104
* t_physical_tile_type
105105
*/
106-
std::vector<int> t_physical_tile_type::get_clock_pins_indices(t_logical_block_type_ptr logic_block) const {
107-
VTR_ASSERT(logic_block->pb_type); // assert not a nullptr
108-
106+
std::vector<int> t_physical_tile_type::get_clock_pins_indices() const {
109107
std::vector<int> indices; // function return vector
110108

111109
// Temporary variables
112-
int num_input_pins = logic_block->pb_type->num_input_pins;
113-
int num_output_pins = logic_block->pb_type->num_output_pins;
114-
int num_clock_pins = logic_block->pb_type->num_clock_pins;
115-
116110
int clock_pins_start_idx = 0;
117111
int clock_pins_stop_idx = 0;
118112

@@ -123,8 +117,8 @@ std::vector<int> t_physical_tile_type::get_clock_pins_indices(t_logical_block_ty
123117
// TODO: This pin ordering assumption is also used functions such as load_external_nets_and_cb
124118
// either remove this assumption all togther and create a better mapping or make use of
125119
// the same functions throughout the code that return the pin ranges.
126-
clock_pins_start_idx = num_input_pins + num_output_pins + clock_pins_stop_idx;
127-
clock_pins_stop_idx = clock_pins_start_idx + num_clock_pins;
120+
clock_pins_start_idx = this->num_input_pins + this->num_output_pins + clock_pins_stop_idx;
121+
clock_pins_stop_idx = clock_pins_start_idx + this->num_clock_pins;
128122

129123
for (int pin_idx = clock_pins_start_idx; pin_idx < clock_pins_stop_idx; pin_idx++) {
130124
indices.push_back(pin_idx);

libs/libarchfpga/src/physical_types.h

Lines changed: 55 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ struct t_pb_type_power;
5252
struct t_mode_power;
5353
struct t_interconnect_power;
5454
struct t_port_power;
55+
struct t_physical_port;
56+
struct t_equivalent_site;
57+
struct t_physical_tile_type;
58+
struct t_logical_block_type;
5559
struct t_pb_type;
5660
struct t_pb_graph_pin_power;
5761
struct t_mode;
@@ -584,6 +588,10 @@ typedef const t_logical_block_type* t_logical_block_type_ptr;
584588
struct t_physical_tile_type {
585589
char* name = nullptr;
586590
int num_pins = 0;
591+
int num_input_pins = 0;
592+
int num_output_pins = 0;
593+
int num_clock_pins = 0;
594+
587595
int capacity = 0;
588596

589597
int width = 0;
@@ -598,6 +606,7 @@ struct t_physical_tile_type {
598606
int num_class = 0;
599607
t_class* class_inf = nullptr; /* [0..num_class-1] */
600608

609+
std::vector<t_physical_port> ports;
601610
std::vector<int> pin_width_offset; //[0..num_pins-1]
602611
std::vector<int> pin_height_offset; //[0..num_pins-1]
603612
int* pin_class = nullptr; /* [0..num_pins-1] */
@@ -619,11 +628,56 @@ struct t_physical_tile_type {
619628

620629
int logical_block_index = -1; /* index of the corresponding logical block type */
621630

631+
std::vector<t_equivalent_site> equivalent_sites;
632+
622633
/* Returns the indices of pins that contain a clock for this physical logic block */
623-
std::vector<int> get_clock_pins_indices(t_logical_block_type_ptr logic_block) const;
634+
std::vector<int> get_clock_pins_indices() const;
624635
};
625636
typedef const t_physical_tile_type* t_physical_tile_type_ptr;
626637

638+
/** Describes I/O and clock ports of a physical tile type
639+
*
640+
* It corresponds to <port/> tags in the FPGA architecture description
641+
*
642+
* Data members:
643+
* name: name of the port
644+
* is_clock: whether or not this port is a clock
645+
* is_non_clock_global: Applies to top level pb_type, this pin is not a clock but
646+
* is a global signal (useful for stuff like global reset signals,
647+
* perhaps useful for VCC and GND)
648+
* num_pins: the number of pins this port has
649+
* tile_type: pointer to the associated tile type
650+
* port_class: port belongs to recognized set of ports in class library
651+
* index: port index by index in array of parent pb_type
652+
* port_index_by_type index of port by type (index by input, output, or clock)
653+
* equivalence: Applies to logic block I/Os and to primitive inputs only
654+
*/
655+
struct t_physical_port {
656+
char* name;
657+
enum PORTS type;
658+
bool is_clock;
659+
bool is_non_clock_global;
660+
int num_pins;
661+
PortEquivalence equivalent;
662+
663+
int index;
664+
int port_index_by_type;
665+
int tile_type_index;
666+
};
667+
668+
/** Describes the equivalent sites related to a specific tile type
669+
*
670+
* It corresponds to the <tile> tags in the FPGA architecture description
671+
*
672+
*/
673+
struct t_equivalent_site {
674+
char* pb_type_name;
675+
676+
// XXX Variables to hold information on mapping between site and tile
677+
// XXX as well as references to the belonging pb_type and tile_type
678+
//t_logical_block_type* block_type;
679+
};
680+
627681
/*************************************************************************************************
628682
* PB Type Hierarchy *
629683
*************************************************************************************************

0 commit comments

Comments
 (0)