Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
uvahotspot
GitHub Repository: uvahotspot/HotSpot
Path: blob/master/examples/example2/newrun.sh
612 views
1
#!/usr/bin/env bash
2
3
if [ $# -gt 1 ]; then
4
echo "Running simulation for grid $1 x $2"
5
else
6
echo "Usage: ./run <rows> <cols>"
7
exit 1
8
fi
9
10
# Remove results from previous simulatiosn
11
rm -f gcc.init
12
rm -f outputs/*
13
14
# Create outputs directory if it doesn't exist
15
mkdir outputs
16
17
# The simulation in `example1` used the fast but less accurate `block`
18
# thermal model. HotSpot offers the choice of a more accurate but
19
# relatively slower model called the 'grid' model. The '-model_type
20
# grid' command line option switches HotSpot to the grid mode. Hence,
21
# the set of commands to redo the thermal simulation from `example1`
22
# using the grid model would be:
23
echo "RUNNING HOTSPOT with grid $1 x $2"
24
../../hotspot -c example.config -f ev6.flp -p gcc.ptrace -materials_file example.materials -model_type grid -grid_rows $1 -grid_cols $2 -steady_file outputs/gcc.steady -grid_steady_file outputs/gcc.grid.steady
25
26
cp outputs/gcc.steady gcc.init
27
28
# Report average heater temperatures to screen
29
echo "Average temperatures across active regions:"
30
head -n 2 outputs/gcc.steady
31
32
33
#hotspot -c example.config -init_file gcc.init -f ev6.flp -p gcc.ptrace -materials_file example.materials -model_type grid -grid_rows $1 -grid_cols $2 -o outputs/gcc.ttrace -grid_transient_file outputs/gcc.grid.ttrace
34
35
# The trade-off between speed and accuracy of the grid model can be
36
# controlled by specifying the grid model's resolution through the
37
# command line options '-grid_rows <num>' and '-grid_cols <num>'. The
38
# default grid size is 64x64 (as can be seen from the 'example.config'
39
# file). When simulating without SuperLU, grid dimensions are restricted
40
# to powers of 2 for algorithmic convenience.
41
42
# In addition to the '-steady_file <file>' option that provides
43
# temperatures at a per-block granularity, the grid model provides an
44
# additional means to access the finer grid of steady state
45
# temperatures. The command line option '-grid_steady_file <file>'
46
# outputs the internal grid temperatures directly (without
47
# aggregating them into per-block temperatures). This can help in
48
# learning how temperatures vary 'within' a block. Also, the Perl script
49
# 'grid_thermal_map.pl' or the Python script `grid_thermal_map.py` can produce color images
50
# of these temperatures with a superposed drawing of the floorplan for easy
51
# viewing. Note that we need to first split gcc.grid.steady into layer-specific temperature
52
# files. Although we've only given a single layer to be simulated, HotSpot is also simulating
53
# the Thermal Interface Material (TIM), heat spreader, and heat sink as separate layers
54
python3 ../../scripts/split_grid_steady.py outputs/gcc.grid.steady 4 $1 $2
55
#perl ../scripts/grid_thermal_map.pl ev6.flp outputs/gcc_layer0.grid.steady > outputs/gcc.svg
56
python3 ../../scripts/grid_thermal_map.py ev6.flp outputs/gcc_layer0.grid.steady $1 $2 outputs/gcc.png
57
58
# HotSpot also provides the `-grid_transient_file <file>` option to view
59
# transient grid temperatures
60
61
# Since the grid model aggregates the finer grid temperatures into
62
# per-block temperatures, HotSpot provides a choice to the user in the
63
# mode of aggregation. The user can select the mapping between the grid
64
# and block temperatures of the grid model through the command line
65
# option '-grid_map_mode <mode>'. The four mapping modes supported are:
66
# 'min', 'max', 'avg' and 'center'. The first three options respectively
67
# mean that the block's temperature is computed as the minimum, maximum,
68
# or average temperature of the grid cells in it. The 'center' option
69
# means that the block's temperature is given by the temperature of the
70
# grid cell at its center. You can change the `grid_map_mode` in `example.config`
71
72
# HotSpot also models the secondary heat transfer path from the silicon
73
# to on-chip interconnect layers, C4 pads, packaging substrate, solder
74
# balls and printed-circuit board. In most cases when there is a heatsink
75
# with forced air-convection, the effect of secondary heat transfer path
76
# can be neglected. For special cases such as exposing silicon die to an
77
# oil flow for infrared thermal measurements, secondary heat transfer
78
# path should not be omitted. This feature is only available with the grid model.
79
# Here is an example of how to enable the secondary heat flow path:
80
#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.steady
81
82