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

Go to the source code of this file.

Data Structures

struct  Floorplan_t
 The floorplan representing the IC as a set of floorplan elements. More...
 

Typedefs

typedef struct Floorplan_t Floorplan_t
 

Functions

void floorplan_init (Floorplan_t *floorplan)
 
void floorplan_copy (Floorplan_t *dst, Floorplan_t *src)
 
void floorplan_destroy (Floorplan_t *floorplan)
 
Floorplan_tfloorplan_calloc (void)
 
Floorplan_tfloorplan_clone (Floorplan_t *floorplan)
 
void floorplan_free (Floorplan_t *floorplan)
 
void floorplan_print (Floorplan_t *floorplan, FILE *stream, String_t prefix)
 
Error_t fill_floorplan (Floorplan_t *floorplan, Dimensions_t *dimensions, String_t file_name)
 
Error_t fill_sources_floorplan (Floorplan_t *floorplan, Source_t *sources)
 
Quantity_t get_number_of_floorplan_elements_floorplan (Floorplan_t *floorplan)
 
FloorplanElement_tget_floorplan_element (Floorplan_t *floorplan, String_t floorplan_element_id)
 
Error_t insert_power_values_floorplan (Floorplan_t *floorplan, PowersQueue_t *pvalues)
 
Temperature_tget_all_max_temperatures_floorplan (Floorplan_t *floorplan, Dimensions_t *dimensions, Temperature_t *temperatures, Quantity_t *n_floorplan_elements, Temperature_t *max_temperatures)
 
Temperature_tget_all_min_temperatures_floorplan (Floorplan_t *floorplan, Dimensions_t *dimensions, Temperature_t *temperatures, Quantity_t *n_floorplan_elements, Temperature_t *min_temperatures)
 
Temperature_tget_all_avg_temperatures_floorplan (Floorplan_t *floorplan, Dimensions_t *dimensions, Temperature_t *temperatures, Quantity_t *n_floorplan_elements, Temperature_t *avg_temperatures)
 
Temperature_tget_all_gradient_temperatures_floorplan (Floorplan_t *floorplan, Dimensions_t *dimensions, Temperature_t *temperatures, Quantity_t *n_floorplan_elements, Temperature_t *gradient_temperatures)
 

Typedef Documentation

◆ Floorplan_t

typedef struct Floorplan_t Floorplan_t

Definition of the type Floorplan_t

Definition at line 95 of file floorplan.h.

Function Documentation

◆ fill_floorplan()

Error_t fill_floorplan ( Floorplan_t floorplan,
Dimensions_t dimensions,
String_t  file_name 
)

Parses the floorplan file and fills the floorplan structure

Parameters
floorplanthe floorplan structure to fill
dimensionspointer to the structure storing the dimensions of the stack
file_namepath to the floorplan file to parse
Returns
TDICE_FAILURE if the file cannot be opened or if the parsing of the floorplan fails
TDICE_FAILURE otherwise

Definition at line 170 of file floorplan.c.

◆ fill_sources_floorplan()

Error_t fill_sources_floorplan ( Floorplan_t floorplan,
Source_t sources 
)

Fills the source vector corresponding to a floorplan

Parameters
floorplanpointer to the floorplan placed on the source layer
sourcespointer to the location of the source vector that corresponds to the South-West thermal cell of the layer where the floorplan is placed
Returns
TDICE_SUCCESS if the source vector has been filled correctly
TDICE_FAILURE if it not possible to fill the source vector (at least one floorplan element with no power values in its queue)

Definition at line 267 of file floorplan.c.

◆ floorplan_calloc()

Floorplan_t * floorplan_calloc ( void  )

Allocates memory for a structure of type Floorplan_t

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

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

Definition at line 109 of file floorplan.c.

◆ floorplan_clone()

Floorplan_t * floorplan_clone ( Floorplan_t floorplan)

Allocates memory for a new copy of the structure floorplan

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

Definition at line 122 of file floorplan.c.

◆ floorplan_copy()

void floorplan_copy ( Floorplan_t dst,
Floorplan_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.c.

◆ floorplan_destroy()

void floorplan_destroy ( Floorplan_t floorplan)

Destroys the content of the fields of the structure floorplan

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

Parameters
floorplanthe address of the structure to destroy

Definition at line 93 of file floorplan.c.

◆ floorplan_free()

void floorplan_free ( Floorplan_t floorplan)

Frees the memory space pointed by floorplan

The function destroys the structure floorplan and then frees its memory. The pointer floorplan must have been returned by a previous call to floorplan_calloc or floorplan_clone .

If floorplan is NULL, no operation is performed.

Parameters
floorplanthe pointer to free

Definition at line 139 of file floorplan.c.

◆ floorplan_init()

void floorplan_init ( Floorplan_t floorplan)

Inits the fields of the floorplan structure with default values

Parameters
floorplanthe address of the structure to initalize

Definition at line 47 of file floorplan.c.

◆ floorplan_print()

void floorplan_print ( Floorplan_t floorplan,
FILE *  stream,
String_t  prefix 
)

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

Parameters
floorplanthe 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 152 of file floorplan.c.

◆ get_all_avg_temperatures_floorplan()

Temperature_t * get_all_avg_temperatures_floorplan ( Floorplan_t floorplan,
Dimensions_t dimensions,
Temperature_t temperatures,
Quantity_t n_floorplan_elements,
Temperature_t avg_temperatures 
)

Returns the average temperature of each floorplan element in the given floorplan

Parameters
floorplanpointer to the floorplan
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where floorplan is placed
n_floorplan_elements(OUT) the number of floorplan elements
avg_temperatures(IN/OUT) addres to the memory where temperatures will be written into.
Returns
the same address as avg_temperatures if avg_temperatures is not NULL.
the address of a memory containing n_floorplan_elements temperatures if avg_temperatures is NULL

Definition at line 405 of file floorplan.c.

◆ get_all_gradient_temperatures_floorplan()

Temperature_t * get_all_gradient_temperatures_floorplan ( Floorplan_t floorplan,
Dimensions_t dimensions,
Temperature_t temperatures,
Quantity_t n_floorplan_elements,
Temperature_t gradient_temperatures 
)

Returns the gradient temperature of each floorplan element in the given floorplan

Parameters
floorplanpointer to the floorplan
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where floorplan is placed
n_floorplan_elements(OUT) the number of floorplan elements
gradient_temperatures(IN/OUT) addres to the memory where temperatures will be written into.
Returns
the same address as gradient_temperatures if gradient_temperatures is not NULL.
the address of a memory containing n_floorplan_elements temperatures if gradient_temperatures is NULL

Definition at line 446 of file floorplan.c.

◆ get_all_max_temperatures_floorplan()

Temperature_t * get_all_max_temperatures_floorplan ( Floorplan_t floorplan,
Dimensions_t dimensions,
Temperature_t temperatures,
Quantity_t n_floorplan_elements,
Temperature_t max_temperatures 
)

Returns the maximum temperature of each floorplan element in the given floorplan

Parameters
floorplanpointer to the floorplan
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where floorplan is placed
n_floorplan_elements(OUT) the number of floorplan elements
max_temperatures(IN/OUT) addres to the memory where temperatures will be written into.
Returns
the same address as max_temperatures if max_temperatures is not NULL.
the address of a memory containing n_floorplan_elements temperatures if max_temperatures is NULL

Definition at line 325 of file floorplan.c.

◆ get_all_min_temperatures_floorplan()

Temperature_t * get_all_min_temperatures_floorplan ( Floorplan_t floorplan,
Dimensions_t dimensions,
Temperature_t temperatures,
Quantity_t n_floorplan_elements,
Temperature_t min_temperatures 
)

Returns the minimum temperature of each floorplan element in the given floorplan

Parameters
floorplanpointer to the floorplan
dimensionspointer to the structure storing the dimensions
temperaturespointer to the temperature of the first thermal cell in the layer where floorplan is placed
n_floorplan_elements(OUT) the number of floorplan elements
min_temperatures(IN/OUT) addres to the memory where temperatures will be written into.
Returns
the same address as min_temperatures if min_temperatures is not NULL.
the address of a memory containing n_floorplan_elements temperatures if min_temperatures is NULL

Definition at line 365 of file floorplan.c.

◆ get_floorplan_element()

FloorplanElement_t * get_floorplan_element ( Floorplan_t floorplan,
String_t  floorplan_element_id 
)

Returns a pointer to a floorplan element in the floorplan

Parameters
floorplanaddress of the floorplan
floorplan_element_idid of the floorplan element as in the floorplan file
Returns
NULL if floorplan_element_id does not exist
the pointer to the floorplan element floorplan_element_id

Definition at line 244 of file floorplan.c.

◆ get_number_of_floorplan_elements_floorplan()

Quantity_t get_number_of_floorplan_elements_floorplan ( Floorplan_t floorplan)

Returns the total number of floorplan elements in the floorplan

Parameters
floorplanaddress of the Floorplan structure
Returns
the total nyumber of floorplan elements in floorplan

Definition at line 237 of file floorplan.c.

◆ insert_power_values_floorplan()

Error_t insert_power_values_floorplan ( Floorplan_t floorplan,
PowersQueue_t pvalues 
)

Inserts power values from pvaluse into each floorplan element

The queue pvalues must contain at least as many power values as floorplan elements in floorplan . Floorplan elements are considered in the same order as they appear in the floorplan file: the first element popped from pvalues (a fifo queue) goes to the first floorplan element in the flp file, the second to the second, etc ...

Parameters
floorplanpointer to the floorplan
pvaluespointer to the list of power values
Returns
TDICE_FAILURE if the queue pvalues does not contain enough power values
TDICE_SUCCESS otherwise

Definition at line 297 of file floorplan.c.