3D-ICE 3.0.0
|
#include <stdio.h>
#include "types.h"
#include "string_t.h"
#include "non_uniform_cell_list.h"
#include "connection_list.h"
Go to the source code of this file.
Data Structures | |
struct | CellDimensions_t |
Structure that collects the dimensions of a thermal cell. More... | |
struct | GridDimensions_t |
Structure that collects the dimensions of a 3d thermal grid of cells. More... | |
struct | ChipDimensions_t |
Structure that collects the main dimensions of the IC. More... | |
struct | Dimensions_t |
Collections of all the structures that are needed for the thermal simulation. More... | |
Typedefs | |
typedef struct CellDimensions_t | CellDimensions_t |
typedef struct GridDimensions_t | GridDimensions_t |
typedef struct ChipDimensions_t | ChipDimensions_t |
typedef struct Dimensions_t | Dimensions_t |
typedef struct CellDimensions_t CellDimensions_t |
Definition of the type CellDimension_t
Definition at line 121 of file dimensions.h.
typedef struct ChipDimensions_t ChipDimensions_t |
Definition of the type ChipDimension
Definition at line 267 of file dimensions.h.
typedef struct Dimensions_t Dimensions_t |
Definition of the type Dimensions_t
Definition at line 346 of file dimensions.h.
typedef struct GridDimensions_t GridDimensions_t |
The definition of the type GridDimensions_t
Definition at line 212 of file dimensions.h.
void cell_dimensions_copy | ( | CellDimensions_t * | dst, |
CellDimensions_t * | src | ||
) |
Copies the structure src into dst , as an assignement
The function destroys the content of dst and then makes the copy
dst | the address of the left term sructure (destination) |
src | the address of the right term structure (source) |
Definition at line 61 of file dimensions.c.
void cell_dimensions_destroy | ( | CellDimensions_t * | celld | ) |
Destroys the content of the fields of the structure celld
The function releases any dynamic memory used by the structure and resets its state calling cell_dimensions_init .
celld | the address of the structure to destroy |
Definition at line 96 of file dimensions.c.
void cell_dimensions_init | ( | CellDimensions_t * | celld | ) |
Inits the fields of the celld structure with default values
celld | the address of the structure to initalize |
Definition at line 48 of file dimensions.c.
void chip_dimensions_copy | ( | ChipDimensions_t * | dst, |
ChipDimensions_t * | src | ||
) |
Copies the structure src into dst , as an assignement
The function destroys the content of dst and then makes the copy
dst | the address of the left term sructure (destination) |
src | the address of the right term structure (source) |
Definition at line 152 of file dimensions.c.
void chip_dimensions_destroy | ( | ChipDimensions_t * | chipd | ) |
Destroys the content of the fields of the structure chipd
The function releases any dynamic memory used by the structure and resets its state calling chip_dimensions_init .
chipd | the address of the structure to destroy |
Definition at line 162 of file dimensions.c.
void chip_dimensions_init | ( | ChipDimensions_t * | chipd | ) |
Inits the fields of the chipd structure with default values
chipd | the address of the structure to initalize |
Definition at line 144 of file dimensions.c.
void compute_number_of_connections | ( | Dimensions_t * | dimensions, |
Quantity_t | num_channels, | ||
ChannelModel_t | channel_model, | ||
struct HeatSink_t * | topSink | ||
) |
Computes the number of connections between the thermal cells in the stack
Sets the content of the field Dimensions::NConnections
dimensions | the address of the dimensions structure |
num_channels | number of channels (as stack element) in the stack |
channel_model | the model of the channel used in the stack |
Definition at line 321 of file dimensions.c.
Dimensions_t * dimensions_calloc | ( | void | ) |
Allocates memory for a structure of type Dimensions_t
The content of the new structure is set to default values calling dimensions_init
NULL
if the memory allocation fails Definition at line 219 of file dimensions.c.
Dimensions_t * dimensions_clone | ( | Dimensions_t * | dimensions | ) |
Allocates memory for a new copy of the structure dimensions
dimensions | the address of the structure to clone |
NULL
if the memory allocation fails NULL
if the parameter dimensions is NULL
Definition at line 232 of file dimensions.c.
void dimensions_copy | ( | Dimensions_t * | dst, |
Dimensions_t * | src | ||
) |
Copies the structure src into dst , as an assignement
The function destroys the content of dst and then makes the copy
dst | the address of the left term sructure (destination) |
src | the address of the right term structure (source) |
Definition at line 189 of file dimensions.c.
void dimensions_destroy | ( | Dimensions_t * | dimensions | ) |
Destroys the content of the fields of the structure dimensions
The function releases any dynamic memory used by the structure and resets its state calling dimensions_init .
dimensions | the address of the structure to destroy |
Definition at line 205 of file dimensions.c.
void dimensions_free | ( | Dimensions_t * | dimensions | ) |
Frees the memory space pointed by dimensions
The function destroys the structure dimensions and then frees its memory. The pointer dimensions must have been returned by a previous call to dimensions_calloc or dimensions_clone .
If dimensions is NULL
, no operation is performed.
dimensions | the pointer to free |
Definition at line 249 of file dimensions.c.
void dimensions_init | ( | Dimensions_t * | dimensions | ) |
Inits the fields of the dimensions structure with default values
dimensions | the address of the structure to initalize |
Definition at line 173 of file dimensions.c.
void dimensions_print | ( | Dimensions_t * | dimensions, |
FILE * | stream, | ||
String_t | prefix | ||
) |
Prints the dimension declaration as it looks in the stack file
dimensions | the address of the structure to print |
stream | the output stream (must be already open) |
prefix | a string to be printed as prefix at the beginning of each line |
Definition at line 262 of file dimensions.c.
CellIndex_t first_column | ( | Dimensions_t * | dimensions | ) |
Returns the index of the first column of thermal cells in a layer
dimensions | the address of the dimension structure |
CellIndex_t first_layer | ( | Dimensions_t * | dimensions | ) |
Returns the index of the first layer of thermal cells in a layer
dimensions | the address of the dimension structure |
CellIndex_t first_row | ( | Dimensions_t * | dimensions | ) |
Returns the index of the first row of thermal cells in a layer
dimensions | the address of the dimension structure |
ChipDimension_t get_cell_center_x | ( | Dimensions_t * | dimensions, |
CellIndex_t | column_index | ||
) |
Returns the X coordinate of the center of the cell at column_index
dimensions | the address of the dimension structure |
column_index | the column index of the thermal cell |
Definition at line 563 of file dimensions.c.
ChipDimension_t get_cell_center_y | ( | Dimensions_t * | dimensions, |
CellIndex_t | row_index | ||
) |
Returns the Y coordinate of the center of the cell at row_index
dimensions | the address of the dimension structure |
row_index | the row index of the thermal cell |
Definition at line 589 of file dimensions.c.
CellDimension_t get_cell_height | ( | Dimensions_t * | dimensions, |
CellIndex_t | layer_index | ||
) |
Returns the height of a thermal cell
The function prints a warning on stderr if layer_index is oustside of its correct range of values, i.e. [0, nlayers] or if the array of heights has not been created.
dimensions | the address of the dimension structure |
layer_index | the layer index of the thermal cell |
0
if layer_index is out of range or if the array of heights has not been created. Definition at line 535 of file dimensions.c.
CellDimension_t get_cell_length | ( | Dimensions_t * | dimensions, |
CellIndex_t | column_index | ||
) |
Returns the length of a thermal cell
The function prints a warning on stderr if column_index is oustside of its correct range of values, i.e. [0, ncolumns].
dimensions | the address of the dimension structure |
column_index | the column index of the thermal cell |
0
if column_index is out of range Definition at line 477 of file dimensions.c.
ChipDimension_t get_cell_location_x | ( | Dimensions_t * | dimensions, |
CellIndex_t | column_index | ||
) |
Returns the X coordinate of the south-west corner of the cell at column_index
dimensions | the address of the dimension structure |
column_index | the column index of the thermal cell |
Definition at line 601 of file dimensions.c.
ChipDimension_t get_cell_location_y | ( | Dimensions_t * | dimensions, |
CellIndex_t | row_index | ||
) |
Returns the Y coordinate of the south-west corner of the cell at row_index
dimensions | the address of the dimension structure |
row_index | the row index of the thermal cell |
Definition at line 620 of file dimensions.c.
CellIndex_t get_cell_offset_in_layer | ( | Dimensions_t * | dimensions, |
CellIndex_t | row_index, | ||
CellIndex_t | column_index | ||
) |
Returns the index of a thermal cell within a layer
The index is computed as , where
is the number of columns in the 3d grid.
dimensions | the address of the dimension structure |
row_index | the row index ![]() |
column_index | the column index ![]() |
Definition at line 673 of file dimensions.c.
CellIndex_t get_cell_offset_in_stack | ( | Dimensions_t * | dimensions, |
CellIndex_t | layer_index, | ||
CellIndex_t | row_index, | ||
CellIndex_t | column_index | ||
) |
Returns the index of a thermal cell within the entire 3d stack
The index is computed as , where
and
are, respectively, the number of rows and columns in the 3d grid
dimensions | the address of the dimension structure |
layer_index | the layer index ![]() |
row_index | the row index ![]() |
column_index | the column index ![]() |
Definition at line 685 of file dimensions.c.
CellDimension_t get_cell_width | ( | Dimensions_t * | dimensions, |
CellIndex_t | row_index | ||
) |
Returns the width of a thermal cell
The function prints a warning on stderr if row_index is oustside of its correct range of values, i.e. [0, nrows].
dimensions | the address of the dimension structure |
row_index | the row index of the thermal cell |
0
if row_index is out of range Definition at line 514 of file dimensions.c.
ChipDimension_t get_chip_area | ( | Dimensions_t * | dimensions | ) |
Returns the area of the IC in
dimensions | the address of the dimension structure |
Definition at line 713 of file dimensions.c.
ChipDimension_t get_chip_length | ( | Dimensions_t * | dimensions | ) |
Returns the length of the IC
dimensions | the address of the dimension structure |
Definition at line 699 of file dimensions.c.
ChipDimension_t get_chip_width | ( | Dimensions_t * | dimensions | ) |
Returns the width of the IC
dimensions | the address of the dimension structure |
Definition at line 706 of file dimensions.c.
CellIndex_t get_layer_area | ( | Dimensions_t * | dimensions | ) |
Returns the number of thermal cells in a layer
dimensions | the address of the dimension structure |
Definition at line 666 of file dimensions.c.
CellIndex_t get_layer_cell_offset_from_spreader_coordinates | ( | Dimensions_t * | dimensions, |
struct HeatSink_t * | hsink, | ||
CellIndex_t | layer_index, | ||
CellIndex_t | row_index, | ||
CellIndex_t | column_index | ||
) |
A cell in the 3D layer is indexed using its own row, column and layer. A cell in the heat spreader is indexed using its own row and column, which are not the same as the row and column of the 3D layer stack. This is because the 3D layers are in the center of the heatsink, or equivalently there is a border around the 3D layers
This function allows to access a cell of the 3D layer stack, using the coordinates of the heat spreader. Note that there may be no cell underneath, so you have to call has_layer_underneath() before
dimensions | pointer to dimensions |
hsink | pointer to heatsink |
layer_index | which layer of the 3D stack? |
row_index | row in the heat spreader coordinates |
column_index | column in the heat spreader coordinates |
Definition at line 782 of file dimensions.c.
CellIndex_t get_number_of_cells | ( | Dimensions_t * | dimensions | ) |
Returns the number of thermal cells in the 3d stack
dimensions | the address of the dimension structure |
Definition at line 652 of file dimensions.c.
CellIndex_t get_number_of_columns | ( | Dimensions_t * | dimensions | ) |
Returns the number of columns in the 3d stack
dimensions | the address of the dimension structure |
Definition at line 645 of file dimensions.c.
CellIndex_t get_number_of_connections | ( | Dimensions_t * | dimensions | ) |
Returns the number of connections between the thermal cells in the 3d stack
dimensions | the address of the dimension structure |
Definition at line 659 of file dimensions.c.
CellIndex_t get_number_of_layers | ( | Dimensions_t * | dimensions | ) |
Returns the number of layers in the 3d stack
dimensions | the address of the dimension structure |
Definition at line 631 of file dimensions.c.
CellIndex_t get_number_of_rows | ( | Dimensions_t * | dimensions | ) |
Returns the number of rows in the 3d stack
dimensions | the address of the dimension structure |
Definition at line 638 of file dimensions.c.
CellIndex_t get_spreader_cell_offset | ( | Dimensions_t * | dimensions, |
struct HeatSink_t * | hsink, | ||
CellIndex_t | row_index, | ||
CellIndex_t | column_index | ||
) |
Returns the index of a thermal cell of the heat spreader
The heat spreader is not considered a layer as its length and width can be larger than the layers in the 3D stack. Its cells are stored after all of the cells of the 3D stack
dimensions | the address of the dimension structure |
hsink | the heatsink |
row_index | row in the heat spreader coordinates |
column_index | column in the heat spreader coordinates |
Definition at line 720 of file dimensions.c.
CellIndex_t get_spreader_cell_offset_from_layer_coordinates | ( | Dimensions_t * | dimensions, |
struct HeatSink_t * | hsink, | ||
CellIndex_t | row_index, | ||
CellIndex_t | column_index | ||
) |
A cell in the 3D layer is indexed using its own row, column and layer. A cell in the heat spreader is indexed using its own row and column, which are not the same as the row and column of the 3D layer stack. This is because the 3D layers are in the center of the heatsink, or equivalently there is a border around the 3D layers
This function allows to access a cell of the heat spreader, using the coordinates of the 3D layer stack, which is always possible since the spreader is larger or equal in size.
dimensions | pointer to dimensions |
hsink | pointer to heatsink |
row_index | row in the 3D layer stack coordinates |
column_index | column in the 3D layer stack coordinates |
Definition at line 746 of file dimensions.c.
void grid_dimensions_copy | ( | GridDimensions_t * | dst, |
GridDimensions_t * | src | ||
) |
Copies the structure src into dst , as an assignement
The function destroys the content of dst and then makes the copy
dst | the address of the left term sructure (destination) |
src | the address of the right term structure (source) |
Definition at line 120 of file dimensions.c.
void grid_dimensions_destroy | ( | GridDimensions_t * | gridd | ) |
Destroys the content of the fields of the structure gridd
The function releases any dynamic memory used by the structure and resets its state calling grid_dimensions_init .
gridd | the address of the structure to destroy |
Definition at line 133 of file dimensions.c.
void grid_dimensions_init | ( | GridDimensions_t * | gridd | ) |
Inits the fields of the gridd structure with default values
gridd | the address of the structure to initalize |
Definition at line 109 of file dimensions.c.
bool has_layer_underneath | ( | Dimensions_t * | dimensions, |
struct HeatSink_t * | hsink, | ||
CellIndex_t | row_index, | ||
CellIndex_t | column_index | ||
) |
A cell in the 3D layer is indexed using its own row, column and layer. A cell in the heat spreader is indexed using its own row and column, which are not the same as the row and column of the 3D layer stack. This is because the 3D layers are in the center of the heatsink, or equivalently there is a border around the 3D layers
This answers the question "is there a cell of the 3D layer stack underneath this spreader cell?"
dimensions | pointer to dimensions |
hsink | pointer to heatsink |
row_index | row in the heat spreader coordinates |
column_index | column in the heat spreader coordinates |
Definition at line 763 of file dimensions.c.
CellIndex_t last_column | ( | Dimensions_t * | dimensions | ) |
Returns the index of the last column of thermal cells in a layer
dimensions | the address of the dimension structure |
Definition at line 456 of file dimensions.c.
CellIndex_t last_layer | ( | Dimensions_t * | dimensions | ) |
Returns the index of the last layer of thermal cells in a layer
dimensions | the address of the dimension structure |
Definition at line 470 of file dimensions.c.
CellIndex_t last_row | ( | Dimensions_t * | dimensions | ) |
Returns the index of the last row of thermal cells in a layer
dimensions | the address of the dimension structure |
Definition at line 442 of file dimensions.c.
void print_axes | ( | Dimensions_t * | dimensions | ) |
Creates two text files containing the X and Y coordinates of the thermal cells
dimensions | the address of the dimensions structure |
Definition at line 284 of file dimensions.c.