3D-ICE 3.0.0
stack_description.c
1/******************************************************************************
2 * This file is part of 3D-ICE, version 3.1.0 . *
3 * *
4 * 3D-ICE is free software: you can redistribute it and/or modify it under *
5 * the terms of the GNU General Public License as published by the Free *
6 * Software Foundation, either version 3 of the License, or any later *
7 * version. *
8 * *
9 * 3D-ICE is distributed in the hope that it will be useful, but WITHOUT *
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for *
12 * more details. *
13 * *
14 * You should have received a copy of the GNU General Public License along *
15 * with 3D-ICE. If not, see <http://www.gnu.org/licenses/>. *
16 * *
17 * Copyright (C) 2021 *
18 * Embedded Systems Laboratory - Ecole Polytechnique Federale de Lausanne *
19 * All Rights Reserved. *
20 * *
21 * Authors: Arvind Sridhar Alessandro Vincenzi *
22 * Giseong Bak Martino Ruggiero *
23 * Thomas Brunschwiler Eder Zulian *
24 * Federico Terraneo Darong Huang *
25 * Luis Costero Marina Zapater *
26 * David Atienza *
27 * *
28 * For any comment, suggestion or request about 3D-ICE, please register and *
29 * write to the mailing list (see http://listes.epfl.ch/doc.cgi?liste=3d-ice) *
30 * Any usage of 3D-ICE for research, commercial or other purposes must be *
31 * properly acknowledged in the resulting products or publications. *
32 * *
33 * EPFL-STI-IEL-ESL Mail : 3d-ice@listes.epfl.ch *
34 * Batiment ELG, ELG 130 (SUBSCRIPTION IS NECESSARY) *
35 * Station 11 *
36 * 1015 Lausanne, Switzerland Url : http://esl.epfl.ch/3d-ice *
37 ******************************************************************************/
38
39#include "stack_description.h"
40
41/******************************************************************************/
42
44{
45 string_init (&stkd->FileName) ;
46
47 stkd->TopHeatSink = NULL ;
48 stkd->BottomHeatSink = NULL ;
49 stkd->Channel = NULL ;
50 stkd->Dimensions = NULL ;
51
52 material_list_init (&stkd->Materials) ;
53 layer_list_init (&stkd->Layers) ;
54 die_list_init (&stkd->Dies) ;
55 stack_element_list_init (&stkd->StackElements) ;
56}
57
58/******************************************************************************/
59
61{
62 string_destroy (&stkd->FileName) ;
63
66 channel_free (stkd->Channel) ;
68
69 material_list_destroy (&stkd->Materials) ;
70 layer_list_destroy (&stkd->Layers) ;
71 die_list_destroy (&stkd->Dies) ;
72 stack_element_list_destroy (&stkd->StackElements) ;
73
75}
76
77/******************************************************************************/
78
80(
82 FILE *stream,
83 String_t prefix
84)
85{
86 material_list_print (&stkd->Materials, stream, prefix) ;
87
88 if (stkd->TopHeatSink != NULL)
89 {
90 heat_sink_print (stkd->TopHeatSink, stream, prefix) ;
91
92 fprintf (stream, "%s\n", prefix) ;
93 }
94
95 if (stkd->BottomHeatSink != NULL)
96 {
97 heat_sink_print (stkd->BottomHeatSink, stream, prefix) ;
98
99 fprintf (stream, "%s\n", prefix) ;
100 }
101
102 if (stkd->Channel != NULL)
103 {
104 channel_print (stkd->Channel, stream, prefix, stkd->Dimensions) ;
105
106 fprintf (stream, "%s\n", prefix) ;
107 }
108
109 layer_list_print (&stkd->Layers, stream, prefix) ;
110
111 fprintf (stream, "%s\n", prefix) ;
112
113 die_list_print (&stkd->Dies, stream, prefix) ;
114
115 fprintf (stream, "%s\n", prefix) ;
116
117 dimensions_print (stkd->Dimensions, stream, prefix) ;
118
119 fprintf (stream, "%s\n", prefix) ;
120
121 fprintf (stream, "%sstack :\n", prefix) ;
122
123 stack_element_list_print (&stkd->StackElements, stream, prefix) ;
124
125 fprintf (stream, "%s\n", prefix) ;
126}
127
128/******************************************************************************/
129
131(
132 StackDescription_t *stkd,
133 String_t stack_element_id
134)
135{
136 StackElement_t stkel ;
137
138 stack_element_init (&stkel) ;
139
140 string_copy (&stkel.Id, &stack_element_id) ;
141
142 StackElement_t *tmp = stack_element_list_find (&stkd->StackElements, &stkel) ;
143
144 if (tmp == NULL)
145 {
146 stack_element_destroy (&stkel) ;
147
148 return 0u ;
149 }
150
151 stack_element_destroy (&stkel) ;
152
154}
155
156/******************************************************************************/
157
159{
160 Quantity_t tmp = 0u ;
161
162 StackElementListNode_t *stkeln ;
163
164 for (stkeln = stack_element_list_begin (&stkd->StackElements) ;
165 stkeln != NULL ;
166 stkeln = stack_element_list_next (stkeln))
167 {
168 StackElement_t *stkel = stack_element_list_data (stkeln) ;
169
171 }
172
173 return tmp ;
174}
175
176/******************************************************************************/
void channel_print(Channel_t *channel, FILE *stream, String_t prefix, Dimensions_t *dimensions)
Definition: channel.c:135
void channel_free(Channel_t *channel)
Definition: channel.c:121
void dimensions_print(Dimensions_t *dimensions, FILE *stream, String_t prefix)
Definition: dimensions.c:263
void dimensions_free(Dimensions_t *dimensions)
Definition: dimensions.c:249
void heat_sink_free(HeatSink_t *hsink)
Definition: heat_sink.c:158
void heat_sink_print(HeatSink_t *hsink, FILE *stream, String_t prefix)
Definition: heat_sink.c:188
void stack_description_destroy(StackDescription_t *stkd)
Quantity_t get_number_of_floorplan_elements(StackDescription_t *stkd, String_t stack_element_id)
void stack_description_init(StackDescription_t *stkd)
void stack_description_print(StackDescription_t *stkd, FILE *stream, String_t prefix)
Quantity_t get_total_number_of_floorplan_elements(StackDescription_t *stkd)
void stack_element_destroy(StackElement_t *stkel)
Definition: stack_element.c:93
void stack_element_init(StackElement_t *stkel)
Definition: stack_element.c:45
Quantity_t get_number_of_floorplan_elements_stack_element(StackElement_t *stkel)
char * String_t
Definition: string_t.h:55
void string_init(String_t *string)
Definition: string_t.c:46
void string_destroy(String_t *string)
Definition: string_t.c:78
void string_copy(String_t *dst, String_t *src)
Definition: string_t.c:53
Structure containing all the informations related to the 3d stack.
MaterialList_t Materials
HeatSink_t * BottomHeatSink
Dimensions_t * Dimensions
StackElementList_t StackElements
HeatSink_t * TopHeatSink
Structure used to store data about the stack element that compose the 2D/3D stack.
Definition: stack_element.h:93
uint32_t Quantity_t
Definition: types.h:59