VPR-6.0
|
00001 /** 00002 * @file 00003 * 00004 * Data types describing the physical components on the FPGA architecture. 00005 * 00006 * Key data types: 00007 * - t_type_descriptor: describes a placeable complex logic block, 00008 * - pb_type: describes the types of physical blocks within the t_type_descriptor in a hierarchy where the top block is the complex block and the leaf blocks implement one logical block 00009 * - pb_graph_node: is a flattened version of pb_type so a pb_type with 10 instances will have 10 pb_graph_nodes representing each instance 00010 * - pb: A specific physical block. Shares a many-to-one relationship with a pb_graph_node. For example, a circuit with 10 CLBs will have 10 CLB pbs and 1 CLB pb_graph_node, each CLB pb points to that single one pb_graph_node CLB. 00011 * 00012 * Date: February 19, 2009 00013 * Authors: Jason Luu and Kenneth Kent 00014 */ 00015 00016 00017 #ifndef PHYSICAL_TYPES_H 00018 #define PHYSICAL_TYPES_H 00019 00020 #include "logic_types.h" 00021 #include "util.h" 00022 00023 /*************************************************************************************************/ 00024 /* FPGA basic definitions */ 00025 /*************************************************************************************************/ 00026 00027 /** Pins describe I/O into clustered logic block. 00028 * A pin may be unconnected, driving a net or in the fanout, respectively. */ 00029 enum e_pin_type 00030 { OPEN = -1, DRIVER = 0, RECEIVER = 1 }; 00031 00032 /** Type of interconnect within complex block: Complete for everything connected (full crossbar), direct for one-to-one connections, and mux for many-to-one connections */ 00033 enum e_interconnect 00034 { COMPLETE_INTERC = 1, DIRECT_INTERC = 2, MUX_INTERC = 3 }; 00035 00036 /** Orientations. */ 00037 enum e_side 00038 { TOP = 0, RIGHT = 1, BOTTOM = 2, LEFT = 3 }; 00039 00040 /** pin location distributions */ 00041 enum e_pin_location_distr 00042 { E_SPREAD_PIN_DISTR = 1, E_CUSTOM_PIN_DISTR = 2 }; 00043 00044 00045 /** pb_type class */ 00046 enum e_pb_type_class 00047 { UNKNOWN_CLASS = 0, LUT_CLASS = 1, LATCH_CLASS = 2, MEMORY_CLASS = 3 }; 00048 00049 /**@{*/ 00050 /** Annotations for pin-to-pin connections */ 00051 enum e_pin_to_pin_annotation_type 00052 {E_ANNOT_PIN_TO_PIN_DELAY = 0, E_ANNOT_PIN_TO_PIN_CAPACITANCE}; 00053 enum e_pin_to_pin_annotation_format 00054 {E_ANNOT_PIN_TO_PIN_MATRIX = 0, E_ANNOT_PIN_TO_PIN_CONSTANT}; 00055 enum e_pin_to_pin_delay_annotations 00056 {E_ANNOT_PIN_TO_PIN_DELAY_MIN = 0, E_ANNOT_PIN_TO_PIN_DELAY_MAX, E_ANNOT_PIN_TO_PIN_DELAY_TSETUP, 00057 E_ANNOT_PIN_TO_PIN_DELAY_CLOCK_TO_Q_MIN, E_ANNOT_PIN_TO_PIN_DELAY_CLOCK_TO_Q_MAX, 00058 E_ANNOT_PIN_TO_PIN_DELAY_THOLD}; 00059 enum e_pin_to_pin_capacitance_annotations 00060 {E_ANNOT_PIN_TO_PIN_CAPACITANCE_C = 0}; 00061 /**@}*/ 00062 00063 00064 /*************************************************************************************************/ 00065 /* FPGA grid layout data types */ 00066 /*************************************************************************************************/ 00067 00068 enum e_grid_loc_type 00069 { BOUNDARY = 0, FILL, COL_REPEAT, COL_REL }; 00070 /** Definition of how to place physical logic block in the grid 00071 - grid_loc_type - where the type goes and which numbers are valid 00072 - start_col - the absolute value of the starting column from the left to fill, 00073 used with COL_REPEAT 00074 - repeat - the number of columns to skip before placing the same type, 00075 used with COL_REPEAT. 0 means do not repeat 00076 - rel_col - the fractional column to place type 00077 - priority - in the event of conflict, which type gets picked? 00078 */ 00079 struct s_grid_loc_def 00080 { 00081 enum e_grid_loc_type grid_loc_type; 00082 int start_col; 00083 int repeat; 00084 float col_rel; 00085 int priority; 00086 }; 00087 00088 00089 /* Data type definitions */ 00090 /** Grid info */ 00091 struct s_clb_grid 00092 { 00093 boolean IsAuto; 00094 float Aspect; 00095 int W; 00096 int H; 00097 }; 00098 00099 00100 /*************************************************************************************************/ 00101 /* FPGA Physical Logic Blocks data types */ 00102 /*************************************************************************************************/ 00103 00104 /** A class of CLB pins that share common properties 00105 * - port_name: name of this class of pins 00106 * - type: DRIVER or RECEIVER (what is this pinclass?) 00107 * - num_pins: The number of logically equivalent pins forming this 00108 * class. 00109 * - pinlist[]: List of clb pin numbers which belong to this class. 00110 */ 00111 struct s_class 00112 { 00113 enum e_pin_type type; 00114 int num_pins; 00115 int *pinlist; /**< [0..num_pins - 1] */ 00116 }; 00117 typedef struct s_class t_class; 00118 00119 00120 00121 /** Cluster timing delays: 00122 * - C_ipin_cblock: Capacitance added to a routing track by the isolation 00123 * buffer between a track and the Cblocks at an (i,j) loc. 00124 * - T_ipin_cblock: Delay through an input pin connection box (from a 00125 * routing track to a logic block input pin). 00126 */ 00127 typedef struct s_timing_inf 00128 { 00129 boolean timing_analysis_enabled; 00130 float C_ipin_cblock; 00131 float T_ipin_cblock; 00132 } 00133 t_timing_inf; 00134 00135 struct s_pb_type; /* declare before definition because pb_type contains modes and modes contain pb_types*/ 00136 00137 00138 /** Describes I/O and clock ports 00139 * - name: name of the port 00140 * - model_port: associated model port 00141 * - is_clock: whether or not this port is a clock 00142 * - num_pins: the number of pins this port has 00143 * - parent_pb_type: pointer to the parent pb_type 00144 * - port_class: port belongs to recognized set of ports in class library 00145 * equivalence: 00146 */ 00147 struct s_port 00148 { 00149 char* name; 00150 t_model_ports *model_port; 00151 enum PORTS type; 00152 boolean is_clock; 00153 int num_pins; 00154 boolean equivalent; 00155 struct s_pb_type *parent_pb_type; 00156 char * port_class; 00157 }; 00158 typedef struct s_port t_port; 00159 00160 /** 00161 * Info placed between pins that can be processed later for additional information 00162 * - value: value/property pair 00163 * - prop: value/property pair 00164 * - type: type of annotation 00165 * - format: formatting of data 00166 * - input_pins: input pins as string affected by annotation 00167 * - output_pins: output pins as string affected by annotation 00168 * - clock_pin: clock as string affected by annotation 00169 */ 00170 struct s_pin_to_pin_annotation 00171 { 00172 char ** value; /**< [0..num_value_prop_pairs - 1] */ 00173 int * prop; /**< [0..num_value_prop_pairs - 1] */ 00174 int num_value_prop_pairs; 00175 00176 enum e_pin_to_pin_annotation_type type; 00177 enum e_pin_to_pin_annotation_format format; 00178 00179 char * input_pins; 00180 char * output_pins; 00181 char * clock; 00182 }; 00183 typedef struct s_pin_to_pin_annotation t_pin_to_pin_annotation; 00184 00185 00186 struct s_pb_graph_edge; 00187 00188 00189 /** Describes interconnect edge inside a cluster 00190 * - type: type of the interconnect 00191 * - name: indentifier for interconnect 00192 * - input_string: input string verbatim to parse later 00193 * - output_string: input string output to parse later 00194 * - annotations: Annotations for delay, power, etc 00195 * - num_annotations: Total number of annotations 00196 * - parent_mode_index: Mode of parent as int 00197 */ 00198 struct s_interconnect 00199 { 00200 enum e_interconnect type; 00201 char *name; 00202 00203 char *input_string; 00204 char *output_string; 00205 00206 t_pin_to_pin_annotation *annotations; /**< [0..num_annotations-1] */ 00207 int num_annotations; 00208 int parent_mode_index; 00209 }; 00210 typedef struct s_interconnect t_interconnect; 00211 00212 00213 /** Describes mode 00214 * - name: name of the mode 00215 * - pb_type_children: pb_types it contains 00216 * - interconnect: interconnect of parent pb_type to children pb_types or children to children pb_types 00217 * - num_interconnect: Total number of interconnect tags specified by user 00218 * - parent_pb_type: Which parent contains this mode 00219 * - index: Index of mode in array with other modes 00220 */ 00221 struct s_mode 00222 { 00223 char* name; 00224 struct s_pb_type *pb_type_children; /**< [0..num_child_pb_types] */ 00225 int num_pb_type_children; 00226 t_interconnect *interconnect; 00227 int num_interconnect; 00228 struct s_pb_type *parent_pb_type; 00229 int index; 00230 }; 00231 typedef struct s_mode t_mode; 00232 00233 /** Identify pb pin type for timing purposes */ 00234 enum e_pb_graph_pin_type 00235 { PB_PIN_NORMAL = 0, PB_PIN_SEQUENTIAL, PB_PIN_INPAD, PB_PIN_OUTPAD, PB_PIN_TERMINAL, PB_PIN_CLOCK }; 00236 00237 /** Describes a pb graph pin 00238 * - port: pointer to the port that this pin is associated with 00239 * - pin_number: pin number of the port that this pin is associated with 00240 * - input edges: [0..num_input_edges - 1]edges incoming 00241 * - num_input_edges: number edges incoming 00242 * - output edges: [0..num_output_edges - 1]edges out_going 00243 * - num_output_edges: number edges out_going 00244 * - parent_node: parent pb_graph_node 00245 * - pin_count_in_cluster: Unique number for pin inside cluster 00246 */ 00247 struct s_pb_graph_pin 00248 { 00249 t_port *port; 00250 int pin_number; 00251 struct s_pb_graph_edge** input_edges; /**< [0..num_input_edges] */ 00252 int num_input_edges; 00253 struct s_pb_graph_edge** output_edges; /**< [0..num_output_edges] */ 00254 int num_output_edges; 00255 00256 struct s_pb_graph_node *parent_node; 00257 int pin_count_in_cluster; 00258 00259 /* timing information */ 00260 enum e_pb_graph_pin_type type; /**< Is a sequential logic element (TRUE), inpad/outpad (TRUE), or neither (FALSE) */ 00261 float tsu_tco; /**< For sequential logic elements, this is the setup time (if input) or clock-to-q time (if output) */ 00262 struct s_pb_graph_pin** pin_timing; /**< primitive ipin to opin timing */ 00263 float *pin_timing_del_max; /**< primitive ipin to opin timing */ 00264 int num_pin_timing; /**< primitive ipin to opin timing */ 00265 }; 00266 typedef struct s_pb_graph_pin t_pb_graph_pin; 00267 00268 struct s_pb_graph_node; 00269 00270 /** Describes a pb graph edge, this is a "fat" edge which means it supports bused based connections 00271 * - input_pins: array of pb_type graph input pins ptrs entering this edge 00272 * - num_input_pins: Number of input pins entering this edge 00273 * - output_pins: array of pb_type graph output pins ptrs entering this edge 00274 * - num_output_pins: Number of output pins entering this edge 00275 */ 00276 struct s_pb_graph_edge 00277 { 00278 t_pb_graph_pin **input_pins; 00279 int num_input_pins; 00280 t_pb_graph_pin **output_pins; 00281 int num_output_pins; 00282 00283 /* timing information */ 00284 float delay_max; 00285 float delay_min; 00286 float capacitance; 00287 00288 /* who drives this edge */ 00289 t_interconnect * interconnect; 00290 int driver_set; 00291 int driver_pin; 00292 }; 00293 typedef struct s_pb_graph_edge t_pb_graph_edge; 00294 00295 /** This structure stores the physical block graph nodes for a pb_type and mode of a cluster 00296 * - pb_type: Pointer to the type of pb graph node this belongs to 00297 * - mode: parent mode of operation 00298 * - placement_index: there are a certain number of pbs available, this gives the index of the node 00299 * - child_pb_graph_nodes: array of children pb graph nodes organized into modes 00300 * - parent_pb_graph_node: parent pb graph node 00301 */ 00302 struct s_pb_graph_node 00303 { 00304 const struct s_pb_type *pb_type; 00305 00306 int placement_index; 00307 00308 t_pb_graph_pin **input_pins; /**< [0..num_input_ports-1] [0..num_port_pins-1]*/ 00309 t_pb_graph_pin **output_pins; /**< [0..num_output_ports-1] [0..num_port_pins-1]*/ 00310 t_pb_graph_pin **clock_pins; /**< [0..num_clock_ports-1] [0..num_port_pins-1]*/ 00311 00312 int num_input_ports; 00313 int num_output_ports; 00314 int num_clock_ports; 00315 00316 int *num_input_pins; /**< [0..num_input_ports - 1] */ 00317 int *num_output_pins; /**< [0..num_output_ports - 1] */ 00318 int *num_clock_pins; /**< [0..num_clock_ports - 1] */ 00319 00320 struct s_pb_graph_node ***child_pb_graph_nodes; /**< [0..num_modes-1][0..num_pb_type_in_mode-1][0..num_pb-1] */ 00321 struct s_pb_graph_node *parent_pb_graph_node; 00322 00323 int total_pb_pins; /**< only valid for top-level */ 00324 }; 00325 typedef struct s_pb_graph_node t_pb_graph_node; 00326 00327 /** Describes a physical block type 00328 * - name: name of the physical block type 00329 * - num_pb: maximum number of instances of this physical block type sharing one parent 00330 * - blif_model: the string in the blif circuit that corresponds with this pb type 00331 * - class_type: Special library name 00332 * - modes: Different modes accepted 00333 * - ports: I/O and clock ports 00334 * - num_clock_pins: A count of the total number of clock pins 00335 * - int num_input_pins: A count of the total number of input pins 00336 * - int num_output_pins: A count of the total number of output pins 00337 * - timing: Timing matrix of block [0..num_inputs-1][0..num_outputs-1] 00338 * - parent_mode: mode of the parent block 00339 */ 00340 struct s_pb_type 00341 { 00342 char* name; 00343 int num_pb; 00344 char *blif_model; 00345 t_model *model; /* TODO redudant with models_contained, can remove */ 00346 enum e_pb_type_class class_type; 00347 00348 t_mode *modes; /**< [0..num_modes-1] */ 00349 int num_modes; 00350 t_port *ports; /**< [0..num_ports] */ 00351 int num_ports; 00352 00353 int num_clock_pins; 00354 int num_input_pins; /**< inputs not including clock pins */ 00355 int num_output_pins; 00356 00357 t_mode *parent_mode; 00358 int depth; /**< depth of pb_type */ 00359 00360 float max_internal_delay; 00361 t_pin_to_pin_annotation *annotations; /**< [0..num_annotations-1] */ 00362 int num_annotations; 00363 00364 struct s_linked_vptr *models_contained; 00365 }; 00366 typedef struct s_pb_type t_pb_type; 00367 00368 00369 /** Describes the type for a physical logic block 00370 * - name: unique identifier for type 00371 * - num_pins: Number of pins for the block 00372 * - capacity: Number of blocks of this type that can occupy one grid tile. 00373 * This is primarily used for IO pads. 00374 * - height: Height of large block in grid tiles 00375 * - pinloc: Is set to 1 if a given pin exists on a certain position of a block. 00376 * - num_class: Number of logically-equivalent pin classes 00377 * - class_inf: Information of each logically-equivalent class 00378 * - pin_class: The class a pin belongs to 00379 * - is_global_pin: Whether or not a pin is global (hence not routed) 00380 * - is_Fc_frac: True if Fc fractional, else Fc absolute 00381 * - is_Fc_out_full_flex: True means opins will connect to all available segments 00382 * - pb_type: Internal subblocks and routing information for this physical block 00383 * - pb_graph_head: Head of DAG of pb_types_nodes and their edges 00384 00385 * - area: Describes how much area this logic block takes, if undefined, use default 00386 * - type_timing_inf: timing information unique to this type 00387 * - num_drivers: Total number of output drivers supplied 00388 * - num_receivers: Total number of input receivers supplied 00389 * - index: Keep track of type in array for easy access 00390 */ 00391 struct s_type_descriptor /* TODO rename this. maybe physical type descriptor or complex logic block or physical logic block*/ 00392 { 00393 char *name; 00394 int num_pins; 00395 int capacity; 00396 00397 int height; 00398 00399 int ***pinloc; /**< [0..height-1][0..3][0..num_pins-1] */ 00400 int *pin_height; /**< [0..num_pins-1] */ 00401 int **num_pin_loc_assignments; /**< [0..height-1][0..3] */ 00402 char ****pin_loc_assignments; /**< [0..height-1][0..3][0..num_tokens-1][0..string_name] */ 00403 enum e_pin_location_distr pin_location_distribution; 00404 00405 int num_class; 00406 struct s_class *class_inf; /**< [0..num_class-1] */ 00407 int *pin_class; /**< [0..num_pins-1] */ 00408 00409 boolean *is_global_pin; /**< [0..num_pins-1] */ 00410 00411 boolean is_Fc_frac; 00412 boolean is_Fc_out_full_flex; 00413 float Fc_in; 00414 float Fc_out; 00415 00416 /* Clustering info */ 00417 struct s_pb_type *pb_type; 00418 t_pb_graph_node *pb_graph_head; 00419 00420 /* Grid location info */ 00421 struct s_grid_loc_def *grid_loc_def; /**< [0..num_def-1] */ 00422 int num_grid_loc_def; 00423 float area; 00424 00425 /* This info can be determined from class_inf and pin_class but stored for faster access */ 00426 int num_drivers; 00427 int num_receivers; 00428 00429 int index; /**< index of type descriptor in array (allows for index referencing) */ 00430 }; 00431 typedef struct s_type_descriptor t_type_descriptor; 00432 typedef const struct s_type_descriptor *t_type_ptr; 00433 00434 /*************************************************************************************************/ 00435 /* FPGA Routing architecture */ 00436 /*************************************************************************************************/ 00437 00438 /** Description of routing channel distribution across the FPGA, only available for global routing 00439 * Width is standard dev. for Gaussian. xpeak is where peak 00440 * occurs. dc is the dc offset for Gaussian and pulse waveforms. 00441 */ 00442 enum e_stat 00443 { UNIFORM, GAUSSIAN, PULSE, DELTA }; 00444 typedef struct s_chan 00445 { 00446 enum e_stat type; 00447 float peak; 00448 float width; 00449 float xpeak; 00450 float dc; 00451 } 00452 t_chan; 00453 00454 /** - chan_width_io: The relative width of the I/O channel between the pads 00455 * and logic array. 00456 * - chan_x_dist: Describes the x-directed channel width distribution. 00457 * - chan_y_dist: Describes the y-directed channel width distribution. 00458 */ 00459 typedef struct s_chan_width_dist 00460 { 00461 float chan_width_io; 00462 t_chan chan_x_dist; 00463 t_chan chan_y_dist; 00464 } 00465 t_chan_width_dist; 00466 00467 00468 enum e_directionality 00469 { UNI_DIRECTIONAL, BI_DIRECTIONAL }; 00470 enum e_switch_block_type 00471 { SUBSET, WILTON, UNIVERSAL, FULL }; 00472 typedef enum e_switch_block_type t_switch_block_type; 00473 enum e_Fc_type 00474 { ABSOLUTE, FRACTIONAL }; 00475 00476 00477 /** Lists all the important information about a certain segment type. Only 00478 * used if the route_type is DETAILED. [0 .. det_routing_arch.num_segment] 00479 * - frequency: ratio of tracks which are of this segment type. 00480 * - length: Length (in clbs) of the segment. 00481 * - wire_switch: Index of the switch type that connects other wires *to* 00482 * this segment. 00483 * - opin_switch: Index of the switch type that connects output pins (OPINs) 00484 * *to* this segment. 00485 * - frac_cb: The fraction of logic blocks along its length to which this 00486 * segment can connect. (i.e. internal population). 00487 * - frac_sb: The fraction of the length + 1 switch blocks along the segment 00488 * to which the segment can connect. Segments that aren't long 00489 * lines must connect to at least two switch boxes. 00490 * - Cmetal: Capacitance of a routing track, per unit logic block length. 00491 * - Rmetal: Resistance of a routing track, per unit logic block length. 00492 * - drivers: How do signals driving a routing track connect to 00493 * the track? (UDSD by AY) 00494 */ 00495 typedef struct s_segment_inf 00496 { 00497 int frequency; 00498 int length; 00499 short wire_switch; 00500 short opin_switch; 00501 float frac_cb; 00502 float frac_sb; 00503 boolean longline; 00504 float Rmetal; 00505 float Cmetal; 00506 enum e_directionality directionality; 00507 boolean *cb; 00508 int cb_len; 00509 boolean *sb; 00510 int sb_len; 00511 } 00512 t_segment_inf; 00513 00514 00515 /** Lists all the important information about a switch type. 00516 * [0 .. det_routing_arch.num_switch] 00517 * - buffered: Does this switch include a buffer? 00518 * - R: Equivalent resistance of the buffer/switch. 00519 * - Cin: Input capacitance. 00520 * - Cout: Output capacitance. 00521 * - Tdel: Intrinsic delay. The delay through an unloaded switch is 00522 * Tdel + R * Cout. 00523 * - mux_trans_size: The area of each transistor in the segment's driving mux 00524 * measured in minimum width transistor units 00525 * - buf_size: The area of the buffer. If set to zero, area should be 00526 * calculated from R 00527 */ 00528 struct s_switch_inf 00529 { 00530 boolean buffered; 00531 float R; 00532 float Cin; 00533 float Cout; 00534 float Tdel; 00535 float mux_trans_size; 00536 float buf_size; 00537 char *name; 00538 }; 00539 00540 /** Record for storing the technology parameters for NMOS and 00541 * PMOS type of transistors 00542 * 00543 * - min_length: minimum channel width of the transistor (in m) 00544 * - min_width: minimum width of the transistor (in m) 00545 * - Vth: threshold voltage (in volt) 00546 * - CJ: junction capacitance (F/m^2) 00547 * - CJSW: side-wall junction capacitance (F/m) 00548 * - CJSWG: gate-edge side-wall bulk junction capacitance (F/m) 00549 * - CGDO: gate-drain overlap capacitance (F/m) 00550 * - COX: gate-oxide cpacitance per unit area 00551 * - EC: contant for leakage current calculation 00552 */ 00553 struct transistor_record 00554 { 00555 float min_length; 00556 float min_width; 00557 float Vth; 00558 float CJ; 00559 float CJSW; 00560 float CJSWG; 00561 float CGDO; 00562 float COX; 00563 float EC; 00564 }; 00565 00566 /** Record for Poly Data 00567 Cpoly: poly capacitance 00568 poly_extention: poly extention 00569 */ 00570 struct poly_record 00571 { 00572 float Cpoly; 00573 float poly_extension; 00574 }; 00575 00576 typedef struct s_arch t_arch; 00577 /** Detailed routing architecture */ 00578 struct s_arch 00579 { 00580 t_chan_width_dist Chans; 00581 enum e_switch_block_type SBType; 00582 float R_minW_nmos; 00583 float R_minW_pmos; 00584 int Fs; 00585 float C_ipin_cblock; 00586 float T_ipin_cblock; 00587 float grid_logic_tile_area; 00588 float ipin_mux_trans_size; 00589 struct s_clb_grid clb_grid; 00590 t_segment_inf * Segments; 00591 int num_segments; 00592 struct s_switch_inf *Switches; 00593 int num_switches; 00594 t_model *models; 00595 t_model *model_library; 00596 }; 00597 00598 typedef struct s_power t_power; 00599 struct s_power 00600 { 00601 int num_temperature_records; /**<Number of different temperatures in .arch file */ 00602 struct temperature_record *NFS_records; 00603 00604 float clb_Cwire; 00605 struct transistor_record NMOS_tx_record; 00606 struct transistor_record PMOS_tx_record; 00607 struct poly_record poly_inf; 00608 float supply_voltage; 00609 float swing_voltage; 00610 float Vgs_for_leakage; 00611 float SRAM_leakage; 00612 float short_circuit_power_percentage; 00613 }; 00614 00615 typedef struct s_clocks t_clocks; 00616 struct s_clocks 00617 { 00618 int num_global_clock; 00619 struct clock_details *clock_inf; /**< Details about the clock network */ 00620 }; 00621 00622 #endif 00623