3D-ICE 3.0.0
Data Structures | Typedefs | Functions
stack_element.h File Reference
#include <stdio.h>
#include "types.h"
#include "string_t.h"
#include "channel.h"
#include "heat_sink.h"
#include "die.h"
#include "dimensions.h"
#include "layer.h"

Go to the source code of this file.

Data Structures

union  StackElement_p
 A union of pointers to types that can be an instance of a StackElement. More...
 
struct  StackElement_t
 Structure used to store data about the stack element that compose the 2D/3D stack. More...
 

Typedefs

typedef union StackElement_p StackElement_p
 
typedef struct StackElement_t StackElement_t
 

Functions

void stack_element_init (StackElement_t *stkel)
 
void stack_element_copy (StackElement_t *dst, StackElement_t *src)
 
void stack_element_destroy (StackElement_t *stkel)
 
StackElement_tstack_element_calloc (void)
 
StackElement_tstack_element_clone (StackElement_t *stkel)
 
void stack_element_free (StackElement_t *stkel)
 
bool stack_element_same_id (StackElement_t *stkel, StackElement_t *other)
 
void stack_element_print (StackElement_t *stkel, FILE *stream, String_t prefix)
 
CellIndex_t get_source_layer_offset (StackElement_t *stkel)
 
void stack_element_print_thermal_map (StackElement_t *stkel, Dimensions_t *dimensions, Temperature_t *temperatures, FILE *stream)
 
void stack_element_print_power_map (StackElement_t *stkel, Dimensions_t *dimensions, Source_t *sources, FILE *stream)
 
Quantity_t get_number_of_floorplan_elements_stack_element (StackElement_t *stkel)
 

Typedef Documentation

◆ StackElement_p

Definition of the type StackElement_p

Definition at line 79 of file stack_element.h.

◆ StackElement_t

Definition of the type StackElement_t

Definition at line 128 of file stack_element.h.

Function Documentation

◆ get_number_of_floorplan_elements_stack_element()

Quantity_t get_number_of_floorplan_elements_stack_element ( StackElement_t stkel)

Returns the total number of floorplan elements

Parameters
stkeladdress of the StackElement structure
Returns
the total nyumber of floorplan elements in stkel

Definition at line 350 of file stack_element.c.

◆ get_source_layer_offset()

CellIndex_t get_source_layer_offset ( StackElement_t stkel)

Returns the offset of the source layer of the stack element within the stack

Parameters
stkelpointer to the stack element
Returns
the offset (# layers) of the source layer within the stack

Definition at line 212 of file stack_element.c.

◆ stack_element_calloc()

StackElement_t * stack_element_calloc ( void  )

Allocates memory for a structure of type StackElement_t

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

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

Definition at line 113 of file stack_element.c.

◆ stack_element_clone()

StackElement_t * stack_element_clone ( StackElement_t stkel)

Allocates memory for a new copy of the structure stkel

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

Definition at line 126 of file stack_element.c.

◆ stack_element_copy()

void stack_element_copy ( StackElement_t dst,
StackElement_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 63 of file stack_element.c.

◆ stack_element_destroy()

void stack_element_destroy ( StackElement_t stkel)

Destroys the content of the fields of the structure stkel

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

Parameters
stkelthe address of the structure to destroy

Definition at line 93 of file stack_element.c.

◆ stack_element_free()

void stack_element_free ( StackElement_t stkel)

Frees the memory space pointed by stkel

The function destroys the structure stkel and then frees its memory. The pointer stkel must have been returned by a previous call to stack_element_calloc or stack_element_clone .

If stkel is NULL, no operation is performed.

Parameters
stkelthe pointer to free

Definition at line 143 of file stack_element.c.

◆ stack_element_init()

void stack_element_init ( StackElement_t stkel)

Inits the fields of the stkel structure with default values

Parameters
stkelthe address of the structure to initalize

Definition at line 45 of file stack_element.c.

◆ stack_element_print()

void stack_element_print ( StackElement_t stkel,
FILE *  stream,
String_t  prefix 
)

Prints the stack element declaration as it looks in the stack file

Parameters
stkelthe 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 163 of file stack_element.c.

◆ stack_element_print_power_map()

void stack_element_print_power_map ( StackElement_t stkel,
Dimensions_t dimensions,
Source_t sources,
FILE *  stream 
)

Prints a matrix of source values as the power map of the stack element

Parameters
stkelpointer to the stack element to print
dimensionspointer to the structure storing the dimensions
sourcespointer to the first element of the source array
streamthe reference to the (already opened) stream

Definition at line 290 of file stack_element.c.

◆ stack_element_print_thermal_map()

void stack_element_print_thermal_map ( StackElement_t stkel,
Dimensions_t dimensions,
Temperature_t temperatures,
FILE *  stream 
)

Prints a matrix of temperatures as the thermal map of the stack element

Parameters
stkelpointer to the stack element to print
dimensionspointer to the structure storing the dimensions
temperaturespointer to the first element of the temparature array
streamthe reference to the (already opened) stream

Definition at line 229 of file stack_element.c.

◆ stack_element_same_id()

bool stack_element_same_id ( StackElement_t stkel,
StackElement_t other 
)

Tests if two stack elements have the same Id

Parameters
stkelthe first stack element
otherthe second stack element
Returns
TRUE if stkel and other have the same Id
FALSE otherwise

Definition at line 156 of file stack_element.c.