3D-ICE 3.0.0
Data Structures | Typedefs | Functions
ic_element.h File Reference
#include <stdio.h>
#include "types.h"
#include "string_t.h"
#include "dimensions.h"

Go to the source code of this file.

Data Structures

struct  ICElement_t
 

Typedefs

typedef struct ICElement_t ICElement_t
 

Functions

void ic_element_init (ICElement_t *icel)
 
void ic_element_copy (ICElement_t *dst, ICElement_t *src)
 
void ic_element_destroy (ICElement_t *icel)
 
ICElement_tic_element_calloc (void)
 
ICElement_tic_element_clone (ICElement_t *icel)
 
void ic_element_free (ICElement_t *icel)
 
bool ic_element_equal (ICElement_t *icel, ICElement_t *other)
 
void ic_element_print (ICElement_t *icel, FILE *stream, String_t prefix)
 
bool ic_element_has_center (ICElement_t *icelement, CellDimension_t cellx, CellDimension_t celly)
 
bool check_intersection (ICElement_t *icelement_a, ICElement_t *icelement_b)
 
bool check_location (ICElement_t *icel, Dimensions_t *dimensions)
 
void align_to_grid (ICElement_t *icel, Dimensions_t *dimensions)
 
Temperature_t get_max_temperature_ic_element (ICElement_t *icel, Dimensions_t *dimensions, Temperature_t *temperatures)
 
Temperature_t get_min_temperature_ic_element (ICElement_t *icel, Dimensions_t *dimensions, Temperature_t *temperatures)
 
Temperature_t get_avg_temperature_ic_element (ICElement_t *icel, Dimensions_t *dimensions, Temperature_t *temperatures)
 

Typedef Documentation

◆ ICElement_t

typedef struct ICElement_t ICElement_t

Definition of the type ICElement_t

Definition at line 122 of file ic_element.h.

Function Documentation

◆ align_to_grid()

void align_to_grid ( ICElement_t icel,
Dimensions_t dimensions 
)

Aligns the ic element to the mesh of the IC

The function translates the coordinates of the ic element as they are in the floorplan file to coordinates in terms of rows and columns to place the ic element on the surface of the active layer. It also computes the effective dimensions.

Parameters
icelthe ic element to align on the source layer
dimensionsthe structure storing the dimensions of the IC

Definition at line 218 of file ic_element.c.

◆ check_intersection()

bool check_intersection ( ICElement_t icelement_a,
ICElement_t icelement_b 
)

Checks if two ic elements overlap

The control is based on the real coordinates of the ic element, i.e. the coordinates read from the floorplan file.

Parameters
icelement_athe first ic element to test
icelement_bthe second ic element to test
Returns
true if the two surfaces oevrlap
false otherwise

Definition at line 176 of file ic_element.c.

◆ check_location()

bool check_location ( ICElement_t icel,
Dimensions_t dimensions 
)

Checks if the ic element is inside the IC

The control is based on the real coordinates of the ic element, i.e. the coordinates read from the floorplan file.

Parameters
icelthe ic element to test
dimensionsthe structure storing the dimensions of the IC
Returns
true if icel is outside of the IC
false otherwise

Definition at line 205 of file ic_element.c.

◆ get_avg_temperature_ic_element()

Temperature_t get_avg_temperature_ic_element ( ICElement_t icel,
Dimensions_t dimensions,
Temperature_t temperatures 
)

Returns the average temperature of the ic element

Parameters
icelpointer to the ic element
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where the IC element is placed
Returns
the average temperature among the thermal cells on the stack layer where icel is placed

Definition at line 364 of file ic_element.c.

◆ get_max_temperature_ic_element()

Temperature_t get_max_temperature_ic_element ( ICElement_t icel,
Dimensions_t dimensions,
Temperature_t temperatures 
)

Returns the maximum temperature of the ic element

Parameters
icelpointer to the ic element
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where the IC element is placed
Returns
the maximum temperature among the thermal cells on the stack layer where icel is placed

Definition at line 264 of file ic_element.c.

◆ get_min_temperature_ic_element()

Temperature_t get_min_temperature_ic_element ( ICElement_t icel,
Dimensions_t dimensions,
Temperature_t temperatures 
)

Returns the minimum temperature of the ic element

Parameters
icelpointer to the ic element
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where the IC element is placed
Returns
the minimum temperature among the thermal cells on the stack layer where icel is placed

Definition at line 312 of file ic_element.c.

◆ ic_element_calloc()

ICElement_t * ic_element_calloc ( void  )

Allocates memory for a structure of type ICElement_t

The content of the new structure is set to default values calling ic_element_init

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

Definition at line 93 of file ic_element.c.

◆ ic_element_clone()

ICElement_t * ic_element_clone ( ICElement_t icel)

Allocates memory for a new copy of the structure icel

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

Definition at line 106 of file ic_element.c.

◆ ic_element_copy()

void ic_element_copy ( ICElement_t dst,
ICElement_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 64 of file ic_element.c.

◆ ic_element_destroy()

void ic_element_destroy ( ICElement_t icel)

Destroys the content of the fields of the structure icel

The function releases any dynamic memory used by the structure and resets its state calling ic_element_init .

Parameters
icelthe address of the structure to destroy

Definition at line 84 of file ic_element.c.

◆ ic_element_equal()

bool ic_element_equal ( ICElement_t icel,
ICElement_t other 
)

Tests if two ic elements have the same position and dimensions

Parameters
icelthe first ic element
otherthe second ic element
Returns
TRUE if icel and other have the same position and dimensions
FALSE otherwise

Definition at line 136 of file ic_element.c.

◆ ic_element_free()

void ic_element_free ( ICElement_t icel)

Frees the memory space pointed by icel

The function destroys the structure icel and then frees its memory. The pointer icel must have been returned by a previous call to ic_element_calloc or ic_element_clone .

If icel is NULL, no operation is performed.

Parameters
icelthe pointer to free

Definition at line 123 of file ic_element.c.

◆ ic_element_has_center()

bool ic_element_has_center ( ICElement_t icelement,
CellDimension_t  cellx,
CellDimension_t  celly 
)

Checks if the center of a thermal cell belongs to the ic element

The control is based on the real coordinates of the ic element, i.e. the coordinates read from the floorplan file.

Parameters
icelementthe ic element to test
cellxthe x coordinate of the center of the thermal cell
cellythe y coordinate of the center of the thermal cell
Returns
true if the point (cellx, celly) is in the area covered by the ic element
false otherwise

Definition at line 161 of file ic_element.c.

◆ ic_element_init()

void ic_element_init ( ICElement_t icel)

Inits the fields of the icel structure with default values

Parameters
icelthe address of the structure to initalize

Definition at line 46 of file ic_element.c.

◆ ic_element_print()

void ic_element_print ( ICElement_t icel,
FILE *  stream,
String_t  prefix 
)

Prints the ic element location as it looks in the floorplan file

Parameters
icelthe 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 146 of file ic_element.c.