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 ;
157 switch (ipoint->
OType)
161 fprintf (stream,
"%sT (%s, %.1f, %.1f, \"%s\", ",
170 fprintf (stream,
"%sTflp (%s, \"%s\", ",
176 fprintf(stream,
"maximum, ");
180 fprintf(stream,
"minimum, ");
184 fprintf(stream,
"average, ");
190 fprintf (stream,
"%sTflpel (%s.%s, \"%s\", ",
197 fprintf(stream,
"maximum, ");
201 fprintf(stream,
"minimum, ");
205 fprintf(stream,
"average, ");
211 fprintf (stream,
"%sTmap (%s, \"%s\", ",
219 fprintf (stream,
"%sPmap (%s, \"%s\", ",
227 fprintf (stream,
"%sTcoolant (%s, \"%s\", ",
233 fprintf(stream,
"maximum, ");
237 fprintf(stream,
"minimum, ");
241 fprintf(stream,
"average, ");
247 fprintf (stderr,
"Undefined inspection point command type %d\n", ipoint->
OType) ;
253 fprintf(stream,
"slot );\n");
257 fprintf(stream,
"step );\n");
261 fprintf(stream,
"final );\n");
289 ipoint->
Yval = yval ;
305 ipoint->
Xval = xval ;
317 if (ipoint->
OType != type)
337 return ipoint->
Quantity == quantity ;
341 fprintf (stderr,
"Error: output type %d not supported\n", type) ;
356 FILE *output_stream = fopen (ipoint->
FileName,
"w") ;
358 if (output_stream == NULL)
361 "Inspection Point: Cannot open output file %s\n",
367 switch (ipoint->
OType)
371 fprintf (output_stream,
372 "%sCell temperature for the location [%s, x=%5.3f,y=%5.3f]\n",
376 fprintf (output_stream,
377 "%sNearest [column, row] indices found= [%d,%d] (locations [x=%5.3f,y=%5.3f])\n",
382 fprintf (output_stream,
383 "%sTime(s) \t Temperature(K)\n", prefix);
389 fprintf (output_stream,
"%s", prefix) ;
393 fprintf (output_stream,
"Maximum ");
397 fprintf (output_stream,
"Minimum ");
401 fprintf (output_stream,
"Average ");
405 fprintf (output_stream,
"Gradient ");
410 "Inspection Point: Error reading output quantity for Tflp\n") ;
415 fprintf (output_stream,
416 "temperatures for the floorplan of the die %s\n",
419 fprintf (output_stream,
"%sTime(s) \t ", prefix);
421 FloorplanElementListNode_t *flpeln ;
425 flpeln = floorplan_element_list_next (flpeln))
429 fprintf (output_stream,
"%s(K) \t ", flpel->
Id);
432 fprintf(output_stream,
"\n") ;
438 fprintf (output_stream,
"%s", prefix) ;
442 fprintf (output_stream,
"Maximum ");
446 fprintf (output_stream,
"Minimum ");
450 fprintf (output_stream,
"Average ");
454 fprintf (output_stream,
"Gradient ");
459 "Inspection Point: Error reading output quantity for Tflpel\n") ;
464 fprintf (output_stream,
465 "temperatures for the floorplan element %s of the die %s\n",
469 fprintf (output_stream,
470 "%sTime(s) \t %s.%s(K)\n",
480 fprintf (output_stream,
481 "%sThermal map for layer %s (please find axis information in \"xyaxis_[stack id].txt\")\n",
486 fprintf (output_stream,
487 "%sThermal map for layer %s (please find axis information in \"xaxis.txt\" and \"yaxis.txt\")\n",
498 fprintf (output_stream,
499 "%sPower map for layer %s (please find axis information in \"xyaxis_[stack id].txt\")\n",
504 fprintf (output_stream,
505 "%sPower map for layer %s (please find axis information in \"xaxis.txt\" and \"yaxis.txt\")\n",
516 fprintf (output_stream,
"%s", prefix) ;
520 fprintf (output_stream,
"Maximum ");
524 fprintf (output_stream,
"Minimum ");
528 fprintf (output_stream,
"Average ");
532 fprintf (output_stream,
"Gradient ");
537 "Inspection Point: Error reading output quantity for Tcoolant\n") ;
542 fprintf (output_stream,
543 "temperatures for the outlet of the channel %s\n",
546 fprintf (output_stream,
"%sTime(s) \t Temperature(K)\n", prefix) ;
552 fprintf (stderr,
"Error reading inspection point instruction\n") ;
557 fclose (output_stream) ;
563 fclose (output_stream) ;
583 FILE *output_stream = fopen (ipoint->
FileName,
"a") ;
585 if (output_stream == NULL)
588 "Inspection Point: Cannot open output file %s\n",
594 switch (ipoint->
OType)
605 for (Non_uniform_cellListNode_t* cell_i = dimensions->
Cell_list.First; cell_i != NULL; cell_i = cell_i->Next)
607 if (cell_i->Data.layer_info == layer_offset)
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
634 fprintf (output_stream,
635 "%5.3f \t %7.3f\n", current_time, *(temperatures + index)) ;
641 fprintf (output_stream,
"%5.3f \t ", current_time) ;
659 dimensions, temperatures, &n_flp_el, NULL) ;
666 dimensions, temperatures, &n_flp_el, NULL) ;
673 dimensions, temperatures, &n_flp_el, NULL) ;
680 dimensions, temperatures, &n_flp_el, NULL) ;
685 "Inspection Point: Error reading output quantity for Tflp\n") ;
690 for (index = 0 ; index != n_flp_el ; index++)
692 fprintf (output_stream,
"%5.3f \t ", result [index]) ;
694 fprintf (output_stream,
"\n") ;
741 "Inspection Point: Error reading output quantity for Tflpel\n") ;
746 fprintf (output_stream,
747 "%5.3f \t %7.3f\n", current_time, temperature) ;
756 temperatures, output_stream) ;
758 fprintf (output_stream,
"\n") ;
767 sources, output_stream) ;
769 fprintf (output_stream,
"\n") ;
780 for (Non_uniform_cellListNode_t* cell_i = dimensions->
Cell_list.First; cell_i != NULL; cell_i = cell_i->Next)
782 if (cell_i->Data.layer_info == layer_offset)
788 temperatures += counter;
825 "Inspection Point: Error reading output quantity for Tcoolant\n") ;
830 fprintf (output_stream,
831 "%5.3f \t %7.3f\n", current_time, temperature) ;
837 fprintf (stderr,
"Error reading inspection point instruction\n") ;
842 fclose (output_stream) ;
848 fclose (output_stream) ;
865 switch (ipoint->
OType)
875 float temperature = *(temperatures + index) ;
897 temperatures, &nflp, NULL) ;
904 temperatures, &nflp, NULL) ;
911 temperatures, &nflp, NULL) ;
918 temperatures, &nflp, NULL) ;
923 "Inspection Point: Error reading output quantity for Tflp\n") ;
930 for (index = 0 ; index != nflp ; index++)
979 "Inspection Point: Error reading output quantity for Tflpel\n") ;
1013 float temperature = *(temperatures + index++) ;
1046 float source = *(sources + index++) ;
1069 dimensions, temperatures) ;
1076 dimensions, temperatures) ;
1083 dimensions, temperatures) ;
1090 dimensions, temperatures) ;
1095 "Inspection Point: Error reading output quantity for Tcoolant\n") ;
1106 fprintf (stderr,
"Error reading inspection point instruction\n") ;
Temperature_t get_max_temperature_channel_outlet(Channel_t *channel, Dimensions_t *dimensions, Temperature_t *temperatures)
Temperature_t get_gradient_temperature_channel_outlet(Channel_t *channel, Dimensions_t *dimensions, Temperature_t *temperatures)
Temperature_t get_min_temperature_channel_outlet(Channel_t *channel, Dimensions_t *dimensions, Temperature_t *temperatures)
Temperature_t get_avg_temperature_channel_outlet(Channel_t *channel, Dimensions_t *dimensions, Temperature_t *temperatures)
ChipDimension_t get_cell_location_y(Dimensions_t *dimensions, CellIndex_t row_index)
ChipDimension_t get_cell_location_x(Dimensions_t *dimensions, CellIndex_t column_index)
CellIndex_t get_cell_offset_in_stack(Dimensions_t *dimensions, CellIndex_t layer_index, CellIndex_t row_index, CellIndex_t column_index)
CellIndex_t last_column(Dimensions_t *dimensions)
void print_axes(Dimensions_t *dimensions)
CellIndex_t get_number_of_rows(Dimensions_t *dimensions)
CellIndex_t first_column(Dimensions_t *dimensions)
CellIndex_t get_number_of_columns(Dimensions_t *dimensions)
CellIndex_t first_row(Dimensions_t *dimensions)
CellIndex_t last_row(Dimensions_t *dimensions)
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)
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)
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)
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)
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)
void string_init(String_t *string)
bool string_equal(String_t *string, String_t *other)
void string_destroy(String_t *string)
void string_copy(String_t *dst, String_t *src)
Collections of all the structures that are needed for the thermal simulation.
Non_uniform_cellList_t Cell_list
Structure containing information about a floorplan element.
FloorplanElementList_t ElementsList
Structure containing info about the output to be printed while simulating.
FloorplanElement_t * FloorplanElement
OutputQuantity_t Quantity
StackElement_t * StackElement
ChipDimension_t ActualXval
ChipDimension_t ActualYval
Structure used to store messages to be sent over network.
@ TDICE_SUCCESS
The function returns with success.
@ TDICE_FAILURE
The function retuerns with a generic error.
@ TDICE_OUTPUT_TYPE_TFLPEL
A single floorplan element.
@ TDICE_OUTPUT_TYPE_TCOOLANT
The coolant leaving the cavity.
@ TDICE_OUTPUT_TYPE_TCELL
Single thermal cell.
@ TDICE_OUTPUT_TYPE_TFLP
All the element in a floorplan.
@ TDICE_OUTPUT_TYPE_PMAP
The power map of a die (its floorplan)
@ TDICE_OUTPUT_TYPE_TMAP
The thermal map of a stack element.
@ TDICE_OUTPUT_TYPE_NONE
Undefined object.
@ TDICE_OUTPUT_INSTANT_STEP
At every internal time step.
@ TDICE_OUTPUT_INSTANT_NONE
Undefined instant.
@ TDICE_OUTPUT_INSTANT_SLOT
At the end of each time slot.
@ TDICE_OUTPUT_QUANTITY_AVERAGE
Average temperature.
@ TDICE_OUTPUT_QUANTITY_MINIMUM
Minimum temperature.
@ TDICE_OUTPUT_QUANTITY_MAXIMUM
Maximum temperature.
@ TDICE_OUTPUT_QUANTITY_NONE
Undefined type.
@ TDICE_OUTPUT_QUANTITY_GRADIENT
Maximum - Minimum temperature.