-
Notifications
You must be signed in to change notification settings - Fork 415
Eliminate vtr_free and vtr_malloc/vtr_calloc/vtr_realloc #3040
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
efd922c
2f679a7
0bdb49f
7cb2095
2c12600
c0bf94c
e7b470a
e8875c7
3256475
d04d41f
81eba83
700cc75
ba39dae
d0c4cb9
1193d3b
6eb6a8f
c658a87
faa099d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,6 @@ | |
#include "clock_types.h" | ||
|
||
//Forward declarations | ||
struct t_clock_arch; | ||
struct t_clock_network; | ||
struct t_power_arch; | ||
struct t_interconnect_pins; | ||
|
@@ -407,12 +406,6 @@ struct t_grid_def { | |
|
||
/************************* POWER ***********************************/ | ||
|
||
/* Global clock architecture */ | ||
struct t_clock_arch { | ||
int num_global_clocks; | ||
t_clock_network* clock_inf; /* Details about each clock */ | ||
}; | ||
|
||
/* Architecture information for a single clock */ | ||
struct t_clock_network { | ||
bool autosize_buffer; /* autosize clock buffers */ | ||
|
@@ -422,6 +415,15 @@ struct t_clock_network { | |
float prob; /* Static probability of net assigned to this clock */ | ||
float dens; /* Switching density of net assigned to this clock */ | ||
float period; /* Period of clock */ | ||
|
||
t_clock_network() { | ||
autosize_buffer = false; | ||
buffer_size = 0.0f; | ||
C_wire = 0.0f; | ||
prob = 0.0f; | ||
dens = 0.0f; | ||
period = 0.0f; | ||
} | ||
}; | ||
|
||
/* Power-related architecture information */ | ||
|
@@ -434,12 +436,26 @@ struct t_power_arch { | |
float mux_transistor_size; | ||
float FF_size; | ||
float LUT_transistor_size; | ||
|
||
t_power_arch() { | ||
C_wire_local = 0.0f; | ||
logical_effort_factor = 0.0f; | ||
local_interc_factor = 0.0f; | ||
transistors_per_SRAM_bit = 0.0f; | ||
mux_transistor_size = 0.0f; | ||
FF_size = 0.0f; | ||
LUT_transistor_size = 0.0f; | ||
} | ||
}; | ||
|
||
/* Power usage for an entity */ | ||
struct t_power_usage { | ||
float dynamic; | ||
float leakage; | ||
t_power_usage() { | ||
dynamic = 0.0f; | ||
leakage = 0.0f; | ||
} | ||
}; | ||
|
||
/*************************************************************************************************/ | ||
|
@@ -534,6 +550,18 @@ struct t_port_power { | |
t_port* scaled_by_port; | ||
int scaled_by_port_pin_idx; | ||
bool reverse_scaled; /* Scale by (1-prob) */ | ||
|
||
t_port_power() { | ||
wire_type = (e_power_wire_type)0; | ||
wire = {0.0f}; // Default to C = 0.0f | ||
buffer_type = (e_power_buffer_type)0; | ||
buffer_size = 0.0f; | ||
pin_toggle_initialized = false; | ||
energy_per_toggle = 0.0f; | ||
scaled_by_port = nullptr; | ||
scaled_by_port_pin_idx = 0; | ||
reverse_scaled = false; | ||
} | ||
}; | ||
|
||
/** | ||
|
@@ -1150,24 +1178,39 @@ struct t_mode { | |
*/ | ||
struct t_interconnect { | ||
enum e_interconnect type; | ||
char* name = nullptr; | ||
char* name; | ||
|
||
char* input_string = nullptr; | ||
char* output_string = nullptr; | ||
char* input_string; | ||
char* output_string; | ||
|
||
t_pin_to_pin_annotation* annotations = nullptr; /* [0..num_annotations-1] */ | ||
int num_annotations = 0; | ||
bool infer_annotations = false; | ||
t_pin_to_pin_annotation* annotations; /* [0..num_annotations-1] */ | ||
int num_annotations; | ||
bool infer_annotations; | ||
|
||
int line_num = 0; /* Interconnect is processed later, need to know what line number it messed up on to give proper error message */ | ||
int line_num; /* Interconnect is processed later, need to know what line number it messed up on to give proper error message */ | ||
|
||
int parent_mode_index = 0; | ||
int parent_mode_index; | ||
|
||
/* Power related members */ | ||
t_mode* parent_mode = nullptr; | ||
t_mode* parent_mode; | ||
|
||
t_interconnect_power* interconnect_power = nullptr; | ||
t_interconnect_power* interconnect_power; | ||
t_metadata_dict meta; | ||
|
||
t_interconnect() { | ||
type = (e_interconnect)0; | ||
name = nullptr; | ||
input_string = nullptr; | ||
output_string = nullptr; | ||
annotations = nullptr; | ||
num_annotations = 0; | ||
infer_annotations = false; | ||
line_num = 0; | ||
parent_mode_index = 0; | ||
parent_mode = nullptr; | ||
interconnect_power = nullptr; | ||
meta = t_metadata_dict(); | ||
} | ||
}; | ||
|
||
/** Describes I/O and clock ports | ||
|
@@ -1205,6 +1248,22 @@ struct t_port { | |
int absolute_first_pin_index; | ||
|
||
t_port_power* port_power; | ||
|
||
t_port() { | ||
name = nullptr; | ||
model_port = nullptr; | ||
type = (PORTS)0; | ||
is_clock = false; | ||
is_non_clock_global = false; | ||
num_pins = 0; | ||
equivalent = (PortEquivalence)0; | ||
parent_pb_type = nullptr; | ||
port_class = nullptr; | ||
index = 0; | ||
port_index_by_type = 0; | ||
absolute_first_pin_index = 0; | ||
port_power = nullptr; | ||
} | ||
}; | ||
|
||
struct t_pb_type_power { | ||
|
@@ -1231,6 +1290,15 @@ struct t_interconnect_power { | |
int num_output_ports; | ||
int num_pins_per_port; | ||
float transistor_cnt; | ||
|
||
t_interconnect_power() { | ||
power_usage = t_power_usage(); | ||
port_info_initialized = false; | ||
num_input_ports = 0; | ||
num_output_ports = 0; | ||
num_pins_per_port = 0; | ||
transistor_cnt = 0.0f; | ||
} | ||
}; | ||
|
||
struct t_interconnect_pins { | ||
|
@@ -1249,18 +1317,16 @@ struct t_mode_power { | |
* This is later for additional information. | ||
* | ||
* Data Members: | ||
* value: value/property pair | ||
* prop: value/property pair | ||
* annotation_entries: pairs of annotation subtypes and the annotation values | ||
* type: type of annotation | ||
* format: formatting of data | ||
* input_pins: input pins as string affected by annotation | ||
* output_pins: output pins as string affected by annotation | ||
* clock_pin: clock as string affected by annotation | ||
*/ | ||
struct t_pin_to_pin_annotation { | ||
char** value; /* [0..num_value_prop_pairs - 1] */ | ||
int* prop; /* [0..num_value_prop_pairs - 1] */ | ||
int num_value_prop_pairs; | ||
|
||
std::vector<std::pair<int, std::string>> annotation_entries; | ||
|
||
enum e_pin_to_pin_annotation_type type; | ||
enum e_pin_to_pin_annotation_format format; | ||
|
@@ -1270,6 +1336,17 @@ struct t_pin_to_pin_annotation { | |
char* clock; | ||
|
||
int line_num; /* used to report what line number this annotation is found in architecture file */ | ||
|
||
t_pin_to_pin_annotation() { | ||
annotation_entries = std::vector<std::pair<int, std::string>>(); | ||
input_pins = nullptr; | ||
output_pins = nullptr; | ||
clock = nullptr; | ||
|
||
line_num = 0; | ||
type = (e_pin_to_pin_annotation_type)0; | ||
format = (e_pin_to_pin_annotation_format)0; | ||
} | ||
}; | ||
|
||
/************************************************************************************************* | ||
|
@@ -2207,7 +2284,8 @@ struct t_arch { | |
LogicalModels models; | ||
|
||
t_power_arch* power = nullptr; | ||
t_clock_arch* clocks = nullptr; | ||
|
||
std::shared_ptr<std::vector<t_clock_network>> clocks; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why is this a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is shared by device_ctx.clock_arch. I think @vaughnbetz mentioned that in the future, we should get rid of the pointer entirely by assigning the value to device_ctx.clock_arch at the end. Currently, the code is creating two pointers with the same memory address and assigning a value after which can be dangerous. |
||
|
||
//determine which layers in multi-die FPGAs require to build global routing resources | ||
std::vector<bool> layer_global_routing; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Future: convert annotations and num_annotations to a vector