#!/usr/bin/env bash12# Remove results from previous simulatiosn3rm -f gcc.init4rm -f outputs/*56# Create outputs directory if it doesn't exist7mkdir outputs89# The simulation in `example1` used the fast but less accurate `block`10# thermal model. HotSpot offers the choice of a more accurate but11# relatively slower model called the 'grid' model. The '-model_type12# grid' command line option switches HotSpot to the grid mode. Hence,13# the set of commands to redo the thermal simulation from `example1`14# using the grid model would be:15../../hotspot -c example.config -f ev6.flp -p gcc.ptrace -materials_file example.materials -model_type grid -steady_file outputs/gcc.steady -grid_steady_file outputs/gcc.grid.steady1617cp outputs/gcc.steady gcc.init1819../../hotspot -c example.config -init_file gcc.init -f ev6.flp -p gcc.ptrace -materials_file example.materials -model_type grid -o outputs/gcc.ttrace -grid_transient_file outputs/gcc.grid.ttrace2021# The trade-off between speed and accuracy of the grid model can be22# controlled by specifying the grid model's resolution through the23# command line options '-grid_rows <num>' and '-grid_cols <num>'. The24# default grid size is 64x64 (as can be seen from the 'example.config'25# file). When simulating without SuperLU, grid dimensions are restricted26# to powers of 2 for algorithmic convenience.2728# In addition to the '-steady_file <file>' option that provides29# temperatures at a per-block granularity, the grid model provides an30# additional means to access the finer grid of steady state31# temperatures. The command line option '-grid_steady_file <file>'32# outputs the internal grid temperatures directly (without33# aggregating them into per-block temperatures). This can help in34# learning how temperatures vary 'within' a block. Also, the Perl script35# 'grid_thermal_map.pl' or the Python script `grid_thermal_map.py` can produce color images36# of these temperatures with a superposed drawing of the floorplan for easy37# viewing. Note that we need to first split gcc.grid.steady into layer-specific temperature38# files. Although we've only given a single layer to be simulated, HotSpot is also simulating39# the Thermal Interface Material (TIM), heat spreader, and heat sink as separate layers40../../scripts/split_grid_steady.py outputs/gcc.grid.steady 4 64 6441../../scripts/grid_thermal_map.pl ev6.flp outputs/gcc_layer0.grid.steady > outputs/gcc.svg42../../scripts/grid_thermal_map.py ev6.flp outputs/gcc_layer0.grid.steady outputs/gcc.png4344# HotSpot also provides the `-grid_transient_file <file>` option to view45# transient grid temperatures4647# Since the grid model aggregates the finer grid temperatures into48# per-block temperatures, HotSpot provides a choice to the user in the49# mode of aggregation. The user can select the mapping between the grid50# and block temperatures of the grid model through the command line51# option '-grid_map_mode <mode>'. The four mapping modes supported are:52# 'min', 'max', 'avg' and 'center'. The first three options respectively53# mean that the block's temperature is computed as the minimum, maximum,54# or average temperature of the grid cells in it. The 'center' option55# means that the block's temperature is given by the temperature of the56# grid cell at its center. You can change the `grid_map_mode` in `example.config`5758# HotSpot also models the secondary heat transfer path from the silicon59# to on-chip interconnect layers, C4 pads, packaging substrate, solder60# balls and printed-circuit board. In most cases when there is a heatsink61# with forced air-convection, the effect of secondary heat transfer path62# can be neglected. For special cases such as exposing silicon die to an63# oil flow for infrared thermal measurements, secondary heat transfer64# path should not be omitted. This feature is only available with the grid model.65# Here is an example of how to enable the secondary heat flow path:66#../../hotspot -c example.config -materials_file example.materials -f ev6.flp -p gcc.ptrace -model_type grid -model_secondary 1 -grid_steady_file outputs/gcc.grid.steady676869