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

Go to the source code of this file.

Data Structures

struct  FloorplanElement_t
 Structure containing information about a floorplan element. More...
 

Typedefs

typedef struct FloorplanElement_t FloorplanElement_t
 

Functions

void floorplan_element_init (FloorplanElement_t *flpel)
 
void floorplan_element_copy (FloorplanElement_t *dst, FloorplanElement_t *src)
 
void floorplan_element_destroy (FloorplanElement_t *flpel)
 
FloorplanElement_tfloorplan_element_calloc (void)
 
FloorplanElement_tfloorplan_element_clone (FloorplanElement_t *flpel)
 
void floorplan_element_free (FloorplanElement_t *flpel)
 
bool floorplan_element_same_id (FloorplanElement_t *flpel, FloorplanElement_t *other)
 
void floorplan_element_print (FloorplanElement_t *flpel, FILE *stream, String_t prefix)
 
Temperature_t get_max_temperature_floorplan_element (FloorplanElement_t *flpel, Dimensions_t *dimensions, Temperature_t *temperatures)
 
Temperature_t get_min_temperature_floorplan_element (FloorplanElement_t *flpel, Dimensions_t *dimensions, Temperature_t *temperatures)
 
Temperature_t get_avg_temperature_floorplan_element (FloorplanElement_t *flpel, Dimensions_t *dimensions, Temperature_t *temperatures)
 
Temperature_t get_gradient_temperature_floorplan_element (FloorplanElement_t *flpel, Dimensions_t *dimensions, Temperature_t *temperatures)
 
Error_t insert_power_values_floorplan_element (FloorplanElement_t *flpel, PowersQueue_t *pvalues)
 

Typedef Documentation

◆ FloorplanElement_t

Definition of the type FloorplanElement_t

Definition at line 97 of file floorplan_element.h.

Function Documentation

◆ floorplan_element_calloc()

FloorplanElement_t * floorplan_element_calloc ( void  )

Allocates memory for a structure of type FloorplanElement_t

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

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

Definition at line 93 of file floorplan_element.c.

◆ floorplan_element_clone()

FloorplanElement_t * floorplan_element_clone ( FloorplanElement_t flpel)

Allocates memory for a new copy of the structure flpel

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

Definition at line 108 of file floorplan_element.c.

◆ floorplan_element_copy()

void floorplan_element_copy ( FloorplanElement_t dst,
FloorplanElement_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 60 of file floorplan_element.c.

◆ floorplan_element_destroy()

void floorplan_element_destroy ( FloorplanElement_t flpel)

Destroys the content of the fields of the structure flpel

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

Parameters
flpelthe address of the structure to destroy

Definition at line 80 of file floorplan_element.c.

◆ floorplan_element_free()

void floorplan_element_free ( FloorplanElement_t flpel)

Frees the memory space pointed by flpel

The function destroys the structure flpel and then frees its memory. The pointer flpel must have been returned by a previous call to floorplan_element_calloc or floorplan_element_clone .

If flpel is NULL, no operation is performed.

Parameters
flpelthe pointer to free

Definition at line 125 of file floorplan_element.c.

◆ floorplan_element_init()

void floorplan_element_init ( FloorplanElement_t flpel)

Inits the fields of the flpel structure with default values

Parameters
flpelthe address of the structure to initalize

Definition at line 46 of file floorplan_element.c.

◆ floorplan_element_print()

void floorplan_element_print ( FloorplanElement_t flpel,
FILE *  stream,
String_t  prefix 
)

Prints the floorplan element structure as it looks in the floorplan file

Parameters
flpelthe 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 149 of file floorplan_element.c.

◆ floorplan_element_same_id()

bool floorplan_element_same_id ( FloorplanElement_t flpel,
FloorplanElement_t other 
)

Tests if two floorplan elements have the same Id

Parameters
flpelthe first floorplan element
otherthe second floorplan element
Returns
TRUE if flpel and other have the same Id
FALSE otherwise

Definition at line 138 of file floorplan_element.c.

◆ get_avg_temperature_floorplan_element()

Temperature_t get_avg_temperature_floorplan_element ( FloorplanElement_t flpel,
Dimensions_t dimensions,
Temperature_t temperatures 
)

Returns the average temperature of the floorplan element

Parameters
flpelpointer to the floorplan element
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where flpel is placed
Returns
the average temperature among the thermal cells on the stack layer where flpel is placed

Definition at line 268 of file floorplan_element.c.

◆ get_gradient_temperature_floorplan_element()

Temperature_t get_gradient_temperature_floorplan_element ( FloorplanElement_t flpel,
Dimensions_t dimensions,
Temperature_t temperatures 
)

Returns the gradient temperature of the floorplan element

Parameters
flpelpointer to the floorplan element
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where flpel is placed
Returns
the gradient temperature among the thermal cells on the stack layer where flpel is placed

Definition at line 294 of file floorplan_element.c.

◆ get_max_temperature_floorplan_element()

Temperature_t get_max_temperature_floorplan_element ( FloorplanElement_t flpel,
Dimensions_t dimensions,
Temperature_t temperatures 
)

Returns the maximum temperature of the floorplan element

Parameters
flpelpointer to the floorplan element
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where the floorplan element is placed
Returns
the maximum temperature among the thermal cells on the stack layer where flpel is placed

Definition at line 192 of file floorplan_element.c.

◆ get_min_temperature_floorplan_element()

Temperature_t get_min_temperature_floorplan_element ( FloorplanElement_t flpel,
Dimensions_t dimensions,
Temperature_t temperatures 
)

Returns the minimum temperature of the floorplan element

Parameters
flpelpointer to the floorplan element
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where the floorplan element is placed
Returns
the minimum temperature among the thermal cells on the stack layer where flpel is placed

Definition at line 230 of file floorplan_element.c.

◆ insert_power_values_floorplan_element()

Error_t insert_power_values_floorplan_element ( FloorplanElement_t flpel,
PowersQueue_t pvalues 
)

Moves one power value from pvalues into flpel

The queue pvalues must contain at least one power value

Parameters
flpelpointer to the floorplan element
pvaluespointer to the list of power values
Returns
TDICE_FAILURE if the queue pvalues is empty
TDICE_SUCCESS otherwise

Definition at line 175 of file floorplan_element.c.