3D-ICE 3.0.0
Data Structures | Typedefs | Functions
dimensions.h File Reference
#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
 

Functions

void cell_dimensions_init (CellDimensions_t *celld)
 
void cell_dimensions_copy (CellDimensions_t *dst, CellDimensions_t *src)
 
void cell_dimensions_destroy (CellDimensions_t *celld)
 
void grid_dimensions_init (GridDimensions_t *gridd)
 
void grid_dimensions_copy (GridDimensions_t *dst, GridDimensions_t *src)
 
void grid_dimensions_destroy (GridDimensions_t *gridd)
 
void chip_dimensions_init (ChipDimensions_t *chipd)
 
void chip_dimensions_copy (ChipDimensions_t *dst, ChipDimensions_t *src)
 
void chip_dimensions_destroy (ChipDimensions_t *chipd)
 
void dimensions_init (Dimensions_t *dimensions)
 
void dimensions_copy (Dimensions_t *dst, Dimensions_t *src)
 
void dimensions_destroy (Dimensions_t *dimensions)
 
Dimensions_tdimensions_calloc (void)
 
Dimensions_tdimensions_clone (Dimensions_t *dimensions)
 
void dimensions_free (Dimensions_t *dimensions)
 
void dimensions_print (Dimensions_t *dimensions, FILE *stream, String_t prefix)
 
void print_axes (Dimensions_t *dimensions)
 
void compute_number_of_connections (Dimensions_t *dimensions, Quantity_t num_channels, ChannelModel_t channel_model, struct HeatSink_t *topSink)
 
CellIndex_t first_row (Dimensions_t *dimensions)
 
CellIndex_t last_row (Dimensions_t *dimensions)
 
CellIndex_t first_column (Dimensions_t *dimensions)
 
CellIndex_t last_column (Dimensions_t *dimensions)
 
CellIndex_t first_layer (Dimensions_t *dimensions)
 
CellIndex_t last_layer (Dimensions_t *dimensions)
 
CellDimension_t get_cell_length (Dimensions_t *dimensions, CellIndex_t column_index)
 
CellDimension_t get_cell_width (Dimensions_t *dimensions, CellIndex_t row_index)
 
CellDimension_t get_cell_height (Dimensions_t *dimensions, CellIndex_t layer_index)
 
ChipDimension_t get_cell_center_x (Dimensions_t *dimensions, CellIndex_t column_index)
 
ChipDimension_t get_cell_center_y (Dimensions_t *dimensions, CellIndex_t row_index)
 
ChipDimension_t get_cell_location_x (Dimensions_t *dimensions, CellIndex_t column_index)
 
ChipDimension_t get_cell_location_y (Dimensions_t *dimensions, CellIndex_t row_index)
 
CellIndex_t get_number_of_layers (Dimensions_t *dimensions)
 
CellIndex_t get_number_of_rows (Dimensions_t *dimensions)
 
CellIndex_t get_number_of_columns (Dimensions_t *dimensions)
 
CellIndex_t get_number_of_cells (Dimensions_t *dimensions)
 
CellIndex_t get_number_of_connections (Dimensions_t *dimensions)
 
CellIndex_t get_layer_area (Dimensions_t *dimensions)
 
CellIndex_t get_cell_offset_in_layer (Dimensions_t *dimensions, CellIndex_t row_index, CellIndex_t column_index)
 
CellIndex_t get_cell_offset_in_stack (Dimensions_t *dimensions, CellIndex_t layer_index, CellIndex_t row_index, CellIndex_t column_index)
 
ChipDimension_t get_chip_length (Dimensions_t *dimensions)
 
ChipDimension_t get_chip_width (Dimensions_t *dimensions)
 
ChipDimension_t get_chip_area (Dimensions_t *dimensions)
 
CellIndex_t get_spreader_cell_offset (Dimensions_t *dimensions, struct HeatSink_t *hsink, CellIndex_t row_index, CellIndex_t column_index)
 
CellIndex_t get_spreader_cell_offset_from_layer_coordinates (Dimensions_t *dimensions, struct HeatSink_t *hsink, CellIndex_t row_index, CellIndex_t column_index)
 
bool has_layer_underneath (Dimensions_t *dimensions, struct HeatSink_t *hsink, CellIndex_t row_index, CellIndex_t column_index)
 
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)
 

Typedef Documentation

◆ CellDimensions_t

Definition of the type CellDimension_t

Definition at line 121 of file dimensions.h.

◆ ChipDimensions_t

Definition of the type ChipDimension

Definition at line 267 of file dimensions.h.

◆ Dimensions_t

typedef struct Dimensions_t Dimensions_t

Definition of the type Dimensions_t

Definition at line 346 of file dimensions.h.

◆ GridDimensions_t

The definition of the type GridDimensions_t

Definition at line 212 of file dimensions.h.

Function Documentation

◆ cell_dimensions_copy()

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

Parameters
dstthe address of the left term sructure (destination)
srcthe address of the right term structure (source)

Definition at line 61 of file dimensions.c.

◆ cell_dimensions_destroy()

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 .

Parameters
celldthe address of the structure to destroy

Definition at line 96 of file dimensions.c.

◆ cell_dimensions_init()

void cell_dimensions_init ( CellDimensions_t celld)

Inits the fields of the celld structure with default values

Parameters
celldthe address of the structure to initalize

Definition at line 48 of file dimensions.c.

◆ chip_dimensions_copy()

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

Parameters
dstthe address of the left term sructure (destination)
srcthe address of the right term structure (source)

Definition at line 152 of file dimensions.c.

◆ chip_dimensions_destroy()

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 .

Parameters
chipdthe address of the structure to destroy

Definition at line 162 of file dimensions.c.

◆ chip_dimensions_init()

void chip_dimensions_init ( ChipDimensions_t chipd)

Inits the fields of the chipd structure with default values

Parameters
chipdthe address of the structure to initalize

Definition at line 144 of file dimensions.c.

◆ compute_number_of_connections()

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

Parameters
dimensionsthe address of the dimensions structure
num_channelsnumber of channels (as stack element) in the stack
channel_modelthe model of the channel used in the stack

Definition at line 321 of file dimensions.c.

◆ dimensions_calloc()

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

Returns
the pointer to the new structure
NULL if the memory allocation fails

Definition at line 219 of file dimensions.c.

◆ dimensions_clone()

Dimensions_t * dimensions_clone ( Dimensions_t dimensions)

Allocates memory for a new copy of the structure dimensions

Parameters
dimensionsthe address of the structure to clone
Returns
a pointer to a new structure
NULL if the memory allocation fails
NULL if the parameter dimensions is NULL

Definition at line 232 of file dimensions.c.

◆ dimensions_copy()

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

Parameters
dstthe address of the left term sructure (destination)
srcthe address of the right term structure (source)

Definition at line 189 of file dimensions.c.

◆ dimensions_destroy()

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 .

Parameters
dimensionsthe address of the structure to destroy

Definition at line 205 of file dimensions.c.

◆ dimensions_free()

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.

Parameters
dimensionsthe pointer to free

Definition at line 249 of file dimensions.c.

◆ dimensions_init()

void dimensions_init ( Dimensions_t dimensions)

Inits the fields of the dimensions structure with default values

Parameters
dimensionsthe address of the structure to initalize

Definition at line 173 of file dimensions.c.

◆ dimensions_print()

void dimensions_print ( Dimensions_t dimensions,
FILE *  stream,
String_t  prefix 
)

Prints the dimension declaration as it looks in the stack file

Parameters
dimensionsthe address of the structure to print
streamthe output stream (must be already open)
prefixa string to be printed as prefix at the beginning of each line

Definition at line 262 of file dimensions.c.

◆ first_column()

CellIndex_t first_column ( Dimensions_t dimensions)

Returns the index of the first column of thermal cells in a layer

Parameters
dimensionsthe address of the dimension structure
Returns
The index of the first column in a layer

◆ first_layer()

CellIndex_t first_layer ( Dimensions_t dimensions)

Returns the index of the first layer of thermal cells in a layer

Parameters
dimensionsthe address of the dimension structure
Returns
The index of the first layer in a layer

◆ first_row()

CellIndex_t first_row ( Dimensions_t dimensions)

Returns the index of the first row of thermal cells in a layer

Parameters
dimensionsthe address of the dimension structure
Returns
The index of the first row in a layer

◆ get_cell_center_x()

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

Parameters
dimensionsthe address of the dimension structure
column_indexthe column index of the thermal cell
Returns
the X coordinate of the center of thermal cell in position column_index

Definition at line 563 of file dimensions.c.

◆ get_cell_center_y()

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

Parameters
dimensionsthe address of the dimension structure
row_indexthe row index of the thermal cell
Returns
the Y coordinate of the center of thermal cell in position row_index

Definition at line 589 of file dimensions.c.

◆ get_cell_height()

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.

Parameters
dimensionsthe address of the dimension structure
layer_indexthe layer index of the thermal cell
Returns
the height of the thermal cell in position layer_index
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.

◆ get_cell_length()

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].

Parameters
dimensionsthe address of the dimension structure
column_indexthe column index of the thermal cell
Returns
the length of the thermal cell in position column_index
0 if column_index is out of range

Definition at line 477 of file dimensions.c.

◆ get_cell_location_x()

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

Parameters
dimensionsthe address of the dimension structure
column_indexthe column index of the thermal cell
Returns
the X coordinate of the south-west corner of thermal cell in position column_index

Definition at line 601 of file dimensions.c.

◆ get_cell_location_y()

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

Parameters
dimensionsthe address of the dimension structure
row_indexthe row index of the thermal cell
Returns
the X coordinate of the south-west corner of thermal cell in position row_index

Definition at line 620 of file dimensions.c.

◆ get_cell_offset_in_layer()

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 $ C \cdot r + c $, where $ C $ is the number of columns in the 3d grid.

Parameters
dimensionsthe address of the dimension structure
row_indexthe row index $ r $ of the thermal cell
column_indexthe column index $ c $ of the thermal cell
Returns
the index of a thermal cell $ (r, c) $ in a layer

Definition at line 673 of file dimensions.c.

◆ get_cell_offset_in_stack()

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 $ R \cdot C \cdot l + C \cdot r + c $, where $ R $ and $ C $ are, respectively, the number of rows and columns in the 3d grid

Parameters
dimensionsthe address of the dimension structure
layer_indexthe layer index $ l $ of the thermal cell
row_indexthe row index $ r $ of the thermal cell
column_indexthe column index $ c $ of the thermal cell
Returns
the index of a thermal cell $ (l, r, c) $ in the 3d stack

Definition at line 685 of file dimensions.c.

◆ get_cell_width()

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].

Parameters
dimensionsthe address of the dimension structure
row_indexthe row index of the thermal cell
Returns
the width of the thermal cell in position row_index
0 if row_index is out of range

Definition at line 514 of file dimensions.c.

◆ get_chip_area()

ChipDimension_t get_chip_area ( Dimensions_t dimensions)

Returns the area of the IC in $ \mu m^2 $

Parameters
dimensionsthe address of the dimension structure
Returns
the area of the IC

Definition at line 713 of file dimensions.c.

◆ get_chip_length()

ChipDimension_t get_chip_length ( Dimensions_t dimensions)

Returns the length of the IC

Parameters
dimensionsthe address of the dimension structure
Returns
the length of the IC

Definition at line 699 of file dimensions.c.

◆ get_chip_width()

ChipDimension_t get_chip_width ( Dimensions_t dimensions)

Returns the width of the IC

Parameters
dimensionsthe address of the dimension structure
Returns
the width of the IC

Definition at line 706 of file dimensions.c.

◆ get_layer_area()

CellIndex_t get_layer_area ( Dimensions_t dimensions)

Returns the number of thermal cells in a layer

Parameters
dimensionsthe address of the dimension structure
Returns
the number of thermal cells in a layer

Definition at line 666 of file dimensions.c.

◆ get_layer_cell_offset_from_spreader_coordinates()

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

Parameters
dimensionspointer to dimensions
hsinkpointer to heatsink
layer_indexwhich layer of the 3D stack?
row_indexrow in the heat spreader coordinates
column_indexcolumn in the heat spreader coordinates
Returns
the index of a thermal cell

Definition at line 782 of file dimensions.c.

◆ get_number_of_cells()

CellIndex_t get_number_of_cells ( Dimensions_t dimensions)

Returns the number of thermal cells in the 3d stack

Parameters
dimensionsthe address of the dimension structure
Returns
the number of thermal cells

Definition at line 652 of file dimensions.c.

◆ get_number_of_columns()

CellIndex_t get_number_of_columns ( Dimensions_t dimensions)

Returns the number of columns in the 3d stack

Parameters
dimensionsthe address of the dimension structure
Returns
the number of columns

Definition at line 645 of file dimensions.c.

◆ get_number_of_connections()

CellIndex_t get_number_of_connections ( Dimensions_t dimensions)

Returns the number of connections between the thermal cells in the 3d stack

Parameters
dimensionsthe address of the dimension structure
Returns
the number of connections

Definition at line 659 of file dimensions.c.

◆ get_number_of_layers()

CellIndex_t get_number_of_layers ( Dimensions_t dimensions)

Returns the number of layers in the 3d stack

Parameters
dimensionsthe address of the dimension structure
Returns
the number of layers

Definition at line 631 of file dimensions.c.

◆ get_number_of_rows()

CellIndex_t get_number_of_rows ( Dimensions_t dimensions)

Returns the number of rows in the 3d stack

Parameters
dimensionsthe address of the dimension structure
Returns
the number of rows

Definition at line 638 of file dimensions.c.

◆ get_spreader_cell_offset()

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

Parameters
dimensionsthe address of the dimension structure
hsinkthe heatsink
row_indexrow in the heat spreader coordinates
column_indexcolumn in the heat spreader coordinates
Returns
the index of a thermal cell $ (r, c) $ of the heat spreader

Definition at line 720 of file dimensions.c.

◆ get_spreader_cell_offset_from_layer_coordinates()

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.

Parameters
dimensionspointer to dimensions
hsinkpointer to heatsink
row_indexrow in the 3D layer stack coordinates
column_indexcolumn in the 3D layer stack coordinates
Returns
the index of a thermal cell

Definition at line 746 of file dimensions.c.

◆ grid_dimensions_copy()

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

Parameters
dstthe address of the left term sructure (destination)
srcthe address of the right term structure (source)

Definition at line 120 of file dimensions.c.

◆ grid_dimensions_destroy()

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 .

Parameters
griddthe address of the structure to destroy

Definition at line 133 of file dimensions.c.

◆ grid_dimensions_init()

void grid_dimensions_init ( GridDimensions_t gridd)

Inits the fields of the gridd structure with default values

Parameters
griddthe address of the structure to initalize

Definition at line 109 of file dimensions.c.

◆ has_layer_underneath()

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?"

Parameters
dimensionspointer to dimensions
hsinkpointer to heatsink
row_indexrow in the heat spreader coordinates
column_indexcolumn in the heat spreader coordinates
Returns
true if there is a cell underneath

Definition at line 763 of file dimensions.c.

◆ last_column()

CellIndex_t last_column ( Dimensions_t dimensions)

Returns the index of the last column of thermal cells in a layer

Parameters
dimensionsthe address of the dimension structure
Returns
The index of the last column in a layer

Definition at line 456 of file dimensions.c.

◆ last_layer()

CellIndex_t last_layer ( Dimensions_t dimensions)

Returns the index of the last layer of thermal cells in a layer

Parameters
dimensionsthe address of the dimension structure
Returns
The index of the last layer in a layer

Definition at line 470 of file dimensions.c.

◆ last_row()

CellIndex_t last_row ( Dimensions_t dimensions)

Returns the index of the last row of thermal cells in a layer

Parameters
dimensionsthe address of the dimension structure
Returns
The index of the last row in a layer

Definition at line 442 of file dimensions.c.

◆ print_axes()

void print_axes ( Dimensions_t dimensions)

Creates two text files containing the X and Y coordinates of the thermal cells

Parameters
dimensionsthe address of the dimensions structure

Definition at line 284 of file dimensions.c.