3D-ICE 3.0.0
inspection_point.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 <stdlib.h> // For the memory functions malloc/free
40
41#include "inspection_point.h"
42
43/******************************************************************************/
44
46{
47 string_init (&ipoint->FileName) ;
48
52 ipoint->Xval = (ChipDimension_t) 0.0 ;
53 ipoint->ActualXval = (ChipDimension_t) 0.0 ;
54 ipoint->Yval = (ChipDimension_t) 0.0 ;
55 ipoint->ActualYval = (ChipDimension_t) 0.0 ;
56 ipoint->RowIndex = (CellIndex_t) 0u ;
57 ipoint->ColumnIndex = (CellIndex_t) 0u ;
58 ipoint->StackElement = NULL ;
59 ipoint->FloorplanElement = NULL ;
60}
61
62/******************************************************************************/
63
65{
67
68 dst->Instant = src->Instant ;
69 dst->OType = src->OType ;
70 dst->Quantity = src->Quantity ;
71 dst->Xval = src->Xval ;
72 dst->ActualXval = src->ActualXval ;
73 dst->Yval = src->Yval ;
74 dst->ActualYval = src->ActualYval ;
75 dst->RowIndex = src->RowIndex ;
76 dst->ColumnIndex = src->ColumnIndex ;
77 dst->StackElement = src->StackElement ;
78 dst->FloorplanElement = src->FloorplanElement ;
79
80 string_copy (&dst->FileName, &src->FileName) ;
81}
82
83/******************************************************************************/
84
86{
87 string_destroy (&ipoint->FileName) ;
88
89 inspection_point_init (ipoint) ;
90}
91
92/******************************************************************************/
93
95{
96 InspectionPoint_t *ipoint =
97
98 (InspectionPoint_t *) malloc (sizeof(InspectionPoint_t)) ;
99
100 if (ipoint != NULL)
101
102 inspection_point_init (ipoint) ;
103
104 return ipoint ;
105}
106
107/******************************************************************************/
108
110{
111 if (ipoint == NULL)
112
113 return NULL ;
114
116
117 if (newi != NULL)
118
119 inspection_point_copy (newi, ipoint) ;
120
121 return newi ;
122}
123
124/******************************************************************************/
125
127{
128 if (ipoint == NULL)
129
130 return ;
131
132 inspection_point_destroy (ipoint) ;
133
134 free (ipoint) ;
135}
136
137/******************************************************************************/
138
140(
141 InspectionPoint_t *ipoint,
142 InspectionPoint_t *other
143)
144{
145 return string_equal (&ipoint->FileName, &other->FileName) ;
146}
147
148/******************************************************************************/
149
151(
152 InspectionPoint_t *ipoint,
153 FILE *stream,
154 String_t prefix
155)
156{
157 switch (ipoint->OType)
158 {
160
161 fprintf (stream, "%sT (%s, %.1f, %.1f, \"%s\", ",
162 prefix, ipoint->StackElement->Id,
163 ipoint->Xval, ipoint->Yval,
164 ipoint->FileName) ;
165
166 break ;
167
169
170 fprintf (stream, "%sTflp (%s, \"%s\", ",
171 prefix, ipoint->StackElement->Id,
172 ipoint->FileName) ;
173
175
176 fprintf(stream, "maximum, ");
177
178 else if (ipoint->Quantity==TDICE_OUTPUT_QUANTITY_MINIMUM)
179
180 fprintf(stream, "minimum, ");
181
182 else
183
184 fprintf(stream, "average, ");
185
186 break ;
187
189
190 fprintf (stream, "%sTflpel (%s.%s, \"%s\", ",
191 prefix, ipoint->StackElement->Id,
192 ipoint->FloorplanElement->Id,
193 ipoint->FileName) ;
194
196
197 fprintf(stream, "maximum, ");
198
199 else if (ipoint->Quantity==TDICE_OUTPUT_QUANTITY_MINIMUM)
200
201 fprintf(stream, "minimum, ");
202
203 else
204
205 fprintf(stream, "average, ");
206
207 break ;
208
210
211 fprintf (stream, "%sTmap (%s, \"%s\", ",
212 prefix, ipoint->StackElement->Id,
213 ipoint->FileName) ;
214
215 break ;
216
218
219 fprintf (stream, "%sPmap (%s, \"%s\", ",
220 prefix, ipoint->StackElement->Id,
221 ipoint->FileName) ;
222
223 break ;
224
226
227 fprintf (stream, "%sTcoolant (%s, \"%s\", ",
228 prefix, ipoint->StackElement->Id,
229 ipoint->FileName) ;
230
232
233 fprintf(stream, "maximum, ");
234
235 else if (ipoint->Quantity==TDICE_OUTPUT_QUANTITY_MINIMUM)
236
237 fprintf(stream, "minimum, ");
238
239 else
240
241 fprintf(stream, "average, ");
242
243 break ;
244
245 default :
246
247 fprintf (stderr, "Undefined inspection point command type %d\n", ipoint->OType) ;
248 break ;
249 }
250
251 if (ipoint->Instant == TDICE_OUTPUT_INSTANT_SLOT)
252
253 fprintf(stream, "slot );\n");
254
255 else if (ipoint->Instant == TDICE_OUTPUT_INSTANT_STEP)
256
257 fprintf(stream, "step );\n");
258
259 else
260
261 fprintf(stream, "final );\n");
262}
263
264/******************************************************************************/
265
267(
268 InspectionPoint_t *ipoint,
269 ChipDimension_t xval,
270 ChipDimension_t yval,
271 Dimensions_t *dimensions
272)
273{
274
275 CellIndex_t row ;
276
277 for (row = first_row (dimensions) ; row <= last_row (dimensions) ; row++)
278 {
279 ipoint->RowIndex = row ;
280
281 if ( yval >= get_cell_location_y (dimensions, row)
282 && yval < get_cell_location_y (dimensions, row + 1))
283 {
284 ipoint->ActualYval = get_cell_location_y (dimensions, row) ;
285 break ;
286 }
287 }
288
289 ipoint->Yval = yval ;
290
291 CellIndex_t column ;
292
293 for (column = first_column (dimensions) ; column <= last_column (dimensions) ; column++)
294 {
295 ipoint->ColumnIndex = column ;
296
297 if ( xval >= get_cell_location_x (dimensions, column)
298 && xval < get_cell_location_x (dimensions, column + 1))
299 {
300 ipoint->ActualXval = get_cell_location_x (dimensions, column) ;
301 break ;
302 }
303 }
304
305 ipoint->Xval = xval ;
306}
307
308/******************************************************************************/
309
311(
312 InspectionPoint_t *ipoint,
313 OutputType_t type,
314 OutputQuantity_t quantity
315)
316{
317 if (ipoint->OType != type)
318
319 return false ;
320
321 switch (type)
322 {
324
325 return false ;
326
330
331 return true ;
332
336
337 return ipoint->Quantity == quantity ;
338
339 default :
340
341 fprintf (stderr, "Error: output type %d not supported\n", type) ;
342
343 return false ;
344 }
345}
346
347/******************************************************************************/
348
350(
351 InspectionPoint_t *ipoint,
352 Dimensions_t *dimensions,
353 String_t prefix
354)
355{
356 FILE *output_stream = fopen (ipoint->FileName, "w") ;
357
358 if (output_stream == NULL)
359 {
360 fprintf (stderr,
361 "Inspection Point: Cannot open output file %s\n",
362 ipoint->FileName);
363
364 return TDICE_FAILURE ;
365 }
366
367 switch (ipoint->OType)
368 {
370
371 fprintf (output_stream,
372 "%sCell temperature for the location [%s, x=%5.3f,y=%5.3f]\n",
373 prefix,
374 ipoint->StackElement->Id, ipoint->Xval, ipoint->Yval) ;
375
376 fprintf (output_stream,
377 "%sNearest [column, row] indices found= [%d,%d] (locations [x=%5.3f,y=%5.3f])\n",
378 prefix,
379 ipoint->ColumnIndex, ipoint->RowIndex,
380 ipoint->ActualXval, ipoint->ActualYval);
381
382 fprintf (output_stream,
383 "%sTime(s) \t Temperature(K)\n", prefix);
384
385 break ;
386
388
389 fprintf (output_stream, "%s", prefix) ;
390
392
393 fprintf (output_stream, "Maximum ");
394
395 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_MINIMUM)
396
397 fprintf (output_stream, "Minimum ");
398
399 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_AVERAGE)
400
401 fprintf (output_stream, "Average ");
402
403 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_GRADIENT)
404
405 fprintf (output_stream, "Gradient ");
406
407 else
408 {
409 fprintf (stderr,
410 "Inspection Point: Error reading output quantity for Tflp\n") ;
411
412 goto header_error ;
413 }
414
415 fprintf (output_stream,
416 "temperatures for the floorplan of the die %s\n",
417 ipoint->StackElement->Id) ;
418
419 fprintf (output_stream, "%sTime(s) \t ", prefix);
420
421 FloorplanElementListNode_t *flpeln ;
422
423 for (flpeln = floorplan_element_list_begin (&ipoint->StackElement->Pointer.Die->Floorplan.ElementsList) ;
424 flpeln != NULL ;
425 flpeln = floorplan_element_list_next (flpeln))
426 {
427 FloorplanElement_t *flpel = floorplan_element_list_data (flpeln) ;
428
429 fprintf (output_stream, "%s(K) \t ", flpel->Id);
430
431 }
432 fprintf(output_stream, "\n") ;
433
434 break ;
435
437
438 fprintf (output_stream, "%s", prefix) ;
439
441
442 fprintf (output_stream, "Maximum ");
443
444 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_MINIMUM)
445
446 fprintf (output_stream, "Minimum ");
447
448 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_AVERAGE)
449
450 fprintf (output_stream, "Average ");
451
452 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_GRADIENT)
453
454 fprintf (output_stream, "Gradient ");
455
456 else
457 {
458 fprintf (stderr,
459 "Inspection Point: Error reading output quantity for Tflpel\n") ;
460
461 goto header_error ;
462 }
463
464 fprintf (output_stream,
465 "temperatures for the floorplan element %s of the die %s\n",
466 ipoint->FloorplanElement->Id,
467 ipoint->StackElement->Id) ;
468
469 fprintf (output_stream,
470 "%sTime(s) \t %s.%s(K)\n",
471 prefix,
472 ipoint->StackElement->Id,
473 ipoint->FloorplanElement->Id) ;
474
475 break ;
476
478 if (dimensions->NonUniform == 1)
479 {
480 fprintf (output_stream,
481 "%sThermal map for layer %s (please find axis information in \"xyaxis_[stack id].txt\")\n",
482 prefix, ipoint->StackElement->Id);
483 }
484 else
485 {
486 fprintf (output_stream,
487 "%sThermal map for layer %s (please find axis information in \"xaxis.txt\" and \"yaxis.txt\")\n",
488 prefix, ipoint->StackElement->Id);
489
490 print_axes (dimensions) ;
491 }
492
493 break ;
494
496 if (dimensions->NonUniform == 1)
497 {
498 fprintf (output_stream,
499 "%sPower map for layer %s (please find axis information in \"xyaxis_[stack id].txt\")\n",
500 prefix, ipoint->StackElement->Id);
501 }
502 else
503 {
504 fprintf (output_stream,
505 "%sPower map for layer %s (please find axis information in \"xaxis.txt\" and \"yaxis.txt\")\n",
506 prefix, ipoint->StackElement->Id);
507
508 print_axes (dimensions) ;
509
510 }
511
512 break ;
513
515
516 fprintf (output_stream, "%s", prefix) ;
517
519
520 fprintf (output_stream, "Maximum ");
521
522 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_MINIMUM)
523
524 fprintf (output_stream, "Minimum ");
525
526 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_AVERAGE)
527
528 fprintf (output_stream, "Average ");
529
530 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_GRADIENT)
531
532 fprintf (output_stream, "Gradient ");
533
534 else
535 {
536 fprintf (stderr,
537 "Inspection Point: Error reading output quantity for Tcoolant\n") ;
538
539 goto header_error ;
540 }
541
542 fprintf (output_stream,
543 "temperatures for the outlet of the channel %s\n",
544 ipoint->StackElement->Id) ;
545
546 fprintf (output_stream, "%sTime(s) \t Temperature(K)\n", prefix) ;
547
548 break ;
549
550 default :
551
552 fprintf (stderr, "Error reading inspection point instruction\n") ;
553
554 goto header_error ;
555 }
556
557 fclose (output_stream) ;
558
559 return TDICE_SUCCESS ;
560
561header_error :
562
563 fclose (output_stream) ;
564
565 return TDICE_FAILURE ;
566}
567
568/******************************************************************************/
569
571(
572 InspectionPoint_t *ipoint,
573 Dimensions_t *dimensions,
574 Temperature_t *temperatures,
575 Source_t *sources,
576 Time_t current_time
577)
578{
579 Quantity_t index = 0;
580 Quantity_t n_flp_el;
581 Temperature_t temperature, *result ;
582
583 FILE *output_stream = fopen (ipoint->FileName, "a") ;
584
585 if (output_stream == NULL)
586 {
587 fprintf (stderr,
588 "Inspection Point: Cannot open output file %s\n",
589 ipoint->FileName);
590
591 return TDICE_FAILURE ;
592 }
593
594 switch (ipoint->OType)
595 {
597
598 if (dimensions->NonUniform == 1)
599 {
600 // find the thermal cell in the nou-uniform grid scenario
601 CellIndex_t counter = 0;
602 ChipDimension_t x = ipoint->Xval;
603 ChipDimension_t y = ipoint->Yval;
604 CellIndex_t layer_offset = get_source_layer_offset(ipoint->StackElement) ;
605 for (Non_uniform_cellListNode_t* cell_i = dimensions->Cell_list.First; cell_i != NULL; cell_i = cell_i->Next)
606 {
607 if (cell_i->Data.layer_info == layer_offset)
608 {
609 if (
610 x >= cell_i->Data.left_x &&
611 x <= cell_i->Data.left_x + cell_i->Data.length &&
612 y >= cell_i->Data.left_y &&
613 y <= cell_i->Data.left_y + cell_i->Data.width
614 )
615 {
616 index = counter;
617 break;
618 }
619 }
620 counter++;
621 }
622 }
623 else
624 {
626
627 (dimensions,
629 ipoint->RowIndex, ipoint->ColumnIndex) ;
630 }
631
632
633
634 fprintf (output_stream,
635 "%5.3f \t %7.3f\n", current_time, *(temperatures + index)) ;
636
637 break ;
638
640
641 fprintf (output_stream, "%5.3f \t ", current_time) ;
642
643 if (dimensions->NonUniform != 1)
644 {
645 temperatures += get_cell_offset_in_stack
646
647 (dimensions,
649 first_row (dimensions), first_column (dimensions)) ;
650 }
651
652 result = NULL ;
653
655
657
658 (&ipoint->StackElement->Pointer.Die->Floorplan,
659 dimensions, temperatures, &n_flp_el, NULL) ;
660
661 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_MINIMUM)
662
664
665 (&ipoint->StackElement->Pointer.Die->Floorplan,
666 dimensions, temperatures, &n_flp_el, NULL) ;
667
668 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_AVERAGE)
669
671
672 (&ipoint->StackElement->Pointer.Die->Floorplan,
673 dimensions, temperatures, &n_flp_el, NULL) ;
674
675 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_GRADIENT)
676
678
679 (&ipoint->StackElement->Pointer.Die->Floorplan,
680 dimensions, temperatures, &n_flp_el, NULL) ;
681
682 else
683 {
684 fprintf (stderr,
685 "Inspection Point: Error reading output quantity for Tflp\n") ;
686
687 break ;
688 }
689
690 for (index = 0 ; index != n_flp_el ; index++)
691
692 fprintf (output_stream, "%5.3f \t ", result [index]) ;
693
694 fprintf (output_stream, "\n") ;
695
696 free (result) ;
697
698 break ;
699
701
702 // offset the temperature pointer in unifrom grid scenario, while it doesn't need to
703 // offset the temperature pointer in non-uniform grid scenario.
704 if (dimensions->NonUniform != 1)
705 {
706 temperatures += get_cell_offset_in_stack
707
708 (dimensions,
710 first_row (dimensions), first_column (dimensions)) ;
711 }
712
713
715
717
718 (ipoint->FloorplanElement, dimensions, temperatures) ;
719
720 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_MINIMUM)
721
723
724 (ipoint->FloorplanElement, dimensions, temperatures) ;
725
726 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_AVERAGE)
727
729
730 (ipoint->FloorplanElement, dimensions, temperatures) ;
731
732 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_GRADIENT)
733
735
736 (ipoint->FloorplanElement, dimensions, temperatures) ;
737
738 else
739 {
740 fprintf (stderr,
741 "Inspection Point: Error reading output quantity for Tflpel\n") ;
742
743 break ;
744 }
745
746 fprintf (output_stream,
747 "%5.3f \t %7.3f\n", current_time, temperature) ;
748
749 break ;
750
752
754
755 (ipoint->StackElement, dimensions,
756 temperatures, output_stream) ;
757
758 fprintf (output_stream, "\n") ;
759
760 break ;
761
763
765
766 (ipoint->StackElement, dimensions,
767 sources, output_stream) ;
768
769 fprintf (output_stream, "\n") ;
770
771 break ;
772
774
775 if (dimensions->NonUniform == 1)
776 {
777 // output all of the cells' temperature in the layer for non-uniform scenario
778 CellIndex_t counter = 0;
779 CellIndex_t layer_offset = get_source_layer_offset(ipoint->StackElement) ;
780 for (Non_uniform_cellListNode_t* cell_i = dimensions->Cell_list.First; cell_i != NULL; cell_i = cell_i->Next)
781 {
782 if (cell_i->Data.layer_info == layer_offset)
783 {
784 break ;
785 }
786 counter++;
787 }
788 temperatures += counter;
789 }
790 else{
791 temperatures += get_cell_offset_in_stack
792
793 (dimensions,
795 first_row (dimensions), first_column (dimensions)) ;
796 }
797
799
801
802 (ipoint->StackElement->Pointer.Channel, dimensions, temperatures) ;
803
804 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_MINIMUM)
805
807
808 (ipoint->StackElement->Pointer.Channel, dimensions, temperatures) ;
809
810 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_AVERAGE)
811
813
814 (ipoint->StackElement->Pointer.Channel, dimensions, temperatures) ;
815
816 else if (ipoint->Quantity == TDICE_OUTPUT_QUANTITY_GRADIENT)
817
819
820 (ipoint->StackElement->Pointer.Channel, dimensions, temperatures) ;
821
822 else
823 {
824 fprintf (stderr,
825 "Inspection Point: Error reading output quantity for Tcoolant\n") ;
826
827 break ;
828 }
829
830 fprintf (output_stream,
831 "%5.3f \t %7.3f\n", current_time, temperature) ;
832
833 break ;
834
835 default :
836
837 fprintf (stderr, "Error reading inspection point instruction\n") ;
838
839 goto output_error ;
840 }
841
842 fclose (output_stream) ;
843
844 return TDICE_SUCCESS ;
845
846output_error :
847
848 fclose (output_stream) ;
849
850 return TDICE_FAILURE ;
851}
852
853/******************************************************************************/
854
856(
857 InspectionPoint_t *ipoint,
858 OutputQuantity_t output_quantity,
859 Dimensions_t *dimensions,
860 Temperature_t *temperatures,
861 Source_t *sources,
862 NetworkMessage_t *message
863)
864{
865 switch (ipoint->OType)
866 {
868 {
870
871 (dimensions,
873 ipoint->RowIndex, ipoint->ColumnIndex) ;
874
875 float temperature = *(temperatures + index) ;
876
877 insert_message_word (message, &temperature) ;
878
879 break ;
880 }
882 {
883 temperatures += get_cell_offset_in_stack
884
885 (dimensions,
887 first_row (dimensions), first_column (dimensions)) ;
888
889 Temperature_t *tmp ;
890 Quantity_t nflp, index ;
891
892 if (output_quantity == TDICE_OUTPUT_QUANTITY_MAXIMUM)
893
895
896 (&ipoint->StackElement->Pointer.Die->Floorplan, dimensions,
897 temperatures, &nflp, NULL) ;
898
899 else if (output_quantity == TDICE_OUTPUT_QUANTITY_MINIMUM)
900
902
903 (&ipoint->StackElement->Pointer.Die->Floorplan, dimensions,
904 temperatures, &nflp, NULL) ;
905
906 else if (output_quantity == TDICE_OUTPUT_QUANTITY_AVERAGE)
907
909
910 (&ipoint->StackElement->Pointer.Die->Floorplan, dimensions,
911 temperatures, &nflp, NULL) ;
912
913 else if (output_quantity == TDICE_OUTPUT_QUANTITY_GRADIENT)
914
916
917 (&ipoint->StackElement->Pointer.Die->Floorplan, dimensions,
918 temperatures, &nflp, NULL) ;
919
920 else
921 {
922 fprintf (stderr,
923 "Inspection Point: Error reading output quantity for Tflp\n") ;
924
925 break ;
926 }
927
928 insert_message_word (message, &nflp) ;
929
930 for (index = 0 ; index != nflp ; index++)
931 {
932 Temperature_t t = tmp [ index ] ;
933
934 insert_message_word (message, &t) ;
935 }
936
937 free (tmp) ;
938
939 break ;
940 }
942 {
943 temperatures += get_cell_offset_in_stack
944
945 (dimensions,
947 first_row (dimensions), first_column (dimensions)) ;
948
949
950 float temperature ;
951
952 if (output_quantity == TDICE_OUTPUT_QUANTITY_MAXIMUM)
953
955
956 (ipoint->FloorplanElement, dimensions, temperatures) ;
957
958 else if (output_quantity == TDICE_OUTPUT_QUANTITY_MINIMUM)
959
961
962 (ipoint->FloorplanElement, dimensions, temperatures) ;
963
964 else if (output_quantity == TDICE_OUTPUT_QUANTITY_AVERAGE)
965
967
968 (ipoint->FloorplanElement, dimensions, temperatures) ;
969
970 else if (output_quantity == TDICE_OUTPUT_QUANTITY_GRADIENT)
971
973
974 (ipoint->FloorplanElement, dimensions, temperatures) ;
975
976 else
977 {
978 fprintf (stderr,
979 "Inspection Point: Error reading output quantity for Tflpel\n") ;
980
981 break ;
982 }
983
984 insert_message_word (message, &temperature) ;
985
986 break ;
987 }
989 {
990 CellIndex_t n ;
991
992 n = get_number_of_rows (dimensions) ;
993
994 insert_message_word (message, &n) ;
995
996 n = get_number_of_columns (dimensions) ;
997
998 insert_message_word (message, &n) ;
999
1001
1002 (dimensions,
1004 first_row (dimensions), first_column (dimensions)) ;
1005
1006 CellIndex_t row ;
1007 CellIndex_t column ;
1008
1009 for (row = first_row (dimensions) ; row <= last_row (dimensions) ; row++)
1010 {
1011 for (column = first_column (dimensions) ; column <= last_column (dimensions) ; column++)
1012 {
1013 float temperature = *(temperatures + index++) ;
1014
1015 insert_message_word (message, &temperature) ;
1016 }
1017 }
1018
1019 break ;
1020 }
1022 {
1023 CellIndex_t n ;
1024
1025 n = get_number_of_rows (dimensions) ;
1026
1027 insert_message_word (message, &n) ;
1028
1029 n = get_number_of_columns (dimensions) ;
1030
1031 insert_message_word (message, &n) ;
1032
1034
1035 (dimensions,
1037 first_row (dimensions), first_column (dimensions)) ;
1038
1039 CellIndex_t row ;
1040 CellIndex_t column ;
1041
1042 for (row = first_row (dimensions) ; row <= last_row (dimensions) ; row++)
1043 {
1044 for (column = first_column (dimensions) ; column <= last_column (dimensions) ; column++)
1045 {
1046 float source = *(sources + index++) ;
1047
1048 insert_message_word (message, &source) ;
1049 }
1050 }
1051
1052 break ;
1053 }
1055 {
1056 temperatures += get_cell_offset_in_stack
1057
1058 (dimensions,
1060 first_row (dimensions), first_column (dimensions)) ;
1061
1062 float temperature ;
1063
1064 if (output_quantity == TDICE_OUTPUT_QUANTITY_MAXIMUM)
1065
1067
1068 (ipoint->StackElement->Pointer.Channel,
1069 dimensions, temperatures) ;
1070
1071 else if (output_quantity == TDICE_OUTPUT_QUANTITY_MINIMUM)
1072
1074
1075 (ipoint->StackElement->Pointer.Channel,
1076 dimensions, temperatures) ;
1077
1078 else if (output_quantity == TDICE_OUTPUT_QUANTITY_AVERAGE)
1079
1081
1082 (ipoint->StackElement->Pointer.Channel,
1083 dimensions, temperatures) ;
1084
1085 else if (output_quantity == TDICE_OUTPUT_QUANTITY_GRADIENT)
1086
1088
1089 (ipoint->StackElement->Pointer.Channel,
1090 dimensions, temperatures) ;
1091
1092 else
1093 {
1094 fprintf (stderr,
1095 "Inspection Point: Error reading output quantity for Tcoolant\n") ;
1096
1097 break ;
1098 }
1099
1100 insert_message_word (message, &temperature) ;
1101
1102 break ;
1103 }
1104 default :
1105
1106 fprintf (stderr, "Error reading inspection point instruction\n") ;
1107 }
1108}
1109
1110/******************************************************************************/
Temperature_t get_max_temperature_channel_outlet(Channel_t *channel, Dimensions_t *dimensions, Temperature_t *temperatures)
Definition: channel.c:345
Temperature_t get_gradient_temperature_channel_outlet(Channel_t *channel, Dimensions_t *dimensions, Temperature_t *temperatures)
Definition: channel.c:432
Temperature_t get_min_temperature_channel_outlet(Channel_t *channel, Dimensions_t *dimensions, Temperature_t *temperatures)
Definition: channel.c:374
Temperature_t get_avg_temperature_channel_outlet(Channel_t *channel, Dimensions_t *dimensions, Temperature_t *temperatures)
Definition: channel.c:403
ChipDimension_t get_cell_location_y(Dimensions_t *dimensions, CellIndex_t row_index)
Definition: dimensions.c:621
ChipDimension_t get_cell_location_x(Dimensions_t *dimensions, CellIndex_t column_index)
Definition: dimensions.c:602
CellIndex_t get_cell_offset_in_stack(Dimensions_t *dimensions, CellIndex_t layer_index, CellIndex_t row_index, CellIndex_t column_index)
Definition: dimensions.c:686
CellIndex_t last_column(Dimensions_t *dimensions)
Definition: dimensions.c:456
void print_axes(Dimensions_t *dimensions)
Definition: dimensions.c:284
CellIndex_t get_number_of_rows(Dimensions_t *dimensions)
Definition: dimensions.c:638
CellIndex_t first_column(Dimensions_t *dimensions)
CellIndex_t get_number_of_columns(Dimensions_t *dimensions)
Definition: dimensions.c:645
CellIndex_t first_row(Dimensions_t *dimensions)
CellIndex_t last_row(Dimensions_t *dimensions)
Definition: dimensions.c:442
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)
Definition: floorplan.c:447
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)
Definition: floorplan.c:366
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)
Definition: floorplan.c:406
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)
Definition: floorplan.c:326
Temperature_t get_gradient_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_max_temperature_floorplan_element(FloorplanElement_t *flpel, Dimensions_t *dimensions, Temperature_t *temperatures)
InspectionPoint_t * inspection_point_calloc(void)
bool inspection_point_same_filename(InspectionPoint_t *ipoint, InspectionPoint_t *other)
Error_t generate_inspection_point_output(InspectionPoint_t *ipoint, Dimensions_t *dimensions, Temperature_t *temperatures, Source_t *sources, Time_t current_time)
InspectionPoint_t * inspection_point_clone(InspectionPoint_t *ipoint)
void inspection_point_free(InspectionPoint_t *ipoint)
Error_t generate_inspection_point_header(InspectionPoint_t *ipoint, Dimensions_t *dimensions, String_t prefix)
void inspection_point_print(InspectionPoint_t *ipoint, FILE *stream, String_t prefix)
void inspection_point_destroy(InspectionPoint_t *ipoint)
void align_tcell(InspectionPoint_t *ipoint, ChipDimension_t xval, ChipDimension_t yval, Dimensions_t *dimensions)
void fill_message_inspection_point(InspectionPoint_t *ipoint, OutputQuantity_t output_quantity, Dimensions_t *dimensions, Temperature_t *temperatures, Source_t *sources, NetworkMessage_t *message)
bool is_inspection_point(InspectionPoint_t *ipoint, OutputType_t type, OutputQuantity_t quantity)
void inspection_point_init(InspectionPoint_t *ipoint)
void inspection_point_copy(InspectionPoint_t *dst, InspectionPoint_t *src)
void insert_message_word(NetworkMessage_t *message, void *word)
void stack_element_print_power_map(StackElement_t *stkel, Dimensions_t *dimensions, Source_t *sources, FILE *stream)
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)
char * String_t
Definition: string_t.h:55
void string_init(String_t *string)
Definition: string_t.c:46
bool string_equal(String_t *string, String_t *other)
Definition: string_t.c:71
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
Floorplan_t Floorplan
Definition: die.h:94
Collections of all the structures that are needed for the thermal simulation.
Definition: dimensions.h:311
uint8_t NonUniform
Definition: dimensions.h:326
Non_uniform_cellList_t Cell_list
Definition: dimensions.h:337
Structure containing information about a floorplan element.
FloorplanElementList_t ElementsList
Definition: floorplan.h:80
Structure containing info about the output to be printed while simulating.
FloorplanElement_t * FloorplanElement
OutputQuantity_t Quantity
OutputInstant_t Instant
ChipDimension_t Yval
CellIndex_t ColumnIndex
StackElement_t * StackElement
ChipDimension_t Xval
ChipDimension_t ActualXval
ChipDimension_t ActualYval
OutputType_t OType
Structure used to store messages to be sent over network.
StackElement_p Pointer
Error_t
Definition: types.h:401
@ TDICE_SUCCESS
The function returns with success.
Definition: types.h:402
@ TDICE_FAILURE
The function retuerns with a generic error.
Definition: types.h:403
OutputType_t
Definition: types.h:500
@ TDICE_OUTPUT_TYPE_TFLPEL
A single floorplan element.
Definition: types.h:504
@ TDICE_OUTPUT_TYPE_TCOOLANT
The coolant leaving the cavity.
Definition: types.h:507
@ TDICE_OUTPUT_TYPE_TCELL
Single thermal cell.
Definition: types.h:502
@ TDICE_OUTPUT_TYPE_TFLP
All the element in a floorplan.
Definition: types.h:503
@ TDICE_OUTPUT_TYPE_PMAP
The power map of a die (its floorplan)
Definition: types.h:506
@ TDICE_OUTPUT_TYPE_TMAP
The thermal map of a stack element.
Definition: types.h:505
@ TDICE_OUTPUT_TYPE_NONE
Undefined object.
Definition: types.h:501
OutputInstant_t
Definition: types.h:525
@ TDICE_OUTPUT_INSTANT_STEP
At every internal time step.
Definition: types.h:529
@ TDICE_OUTPUT_INSTANT_NONE
Undefined instant.
Definition: types.h:526
@ TDICE_OUTPUT_INSTANT_SLOT
At the end of each time slot.
Definition: types.h:528
double Time_t
Definition: types.h:65
double ChipDimension_t
Definition: types.h:187
double Temperature_t
Definition: types.h:71
OutputQuantity_t
Definition: types.h:477
@ TDICE_OUTPUT_QUANTITY_AVERAGE
Average temperature.
Definition: types.h:479
@ TDICE_OUTPUT_QUANTITY_MINIMUM
Minimum temperature.
Definition: types.h:481
@ TDICE_OUTPUT_QUANTITY_MAXIMUM
Maximum temperature.
Definition: types.h:480
@ TDICE_OUTPUT_QUANTITY_NONE
Undefined type.
Definition: types.h:478
@ TDICE_OUTPUT_QUANTITY_GRADIENT
Maximum - Minimum temperature.
Definition: types.h:482
double Source_t
Definition: types.h:77
uint32_t Quantity_t
Definition: types.h:59
uint32_t CellIndex_t
Definition: types.h:213
Channel_t * Channel
Definition: stack_element.h:74