#!/usr/bin/env bash12# Remove results from previous simulatiosn3rm -f gcc.init4rm -f outputs/*56# Create outputs directory if it doesn't exist7mkdir outputs/89# The thermal model is bundled as a trace-level simulator that takes a10# power trace file and a floorplan file as inputs and outputs the11# corresponding transient temperatures onto a temperature trace file.12# There is also an option to output the final steady state temperatures13# onto a file. The formats of the input files can be gleaned from the14# sample files included with this distribution. For instance, with15# 'ev6.flp' as the given floorplan, 'gcc.ptrace' as the given power16# trace file, the set of commands to generate the temperature trace file17# 'gcc.ttrace' are given below. First, let us run the simulations with a18# set of default model parameters listed in the file 'hotspot.config'19# and gather the steady state temperatures onto a file. This is done by:20../../hotspot -c example.config -f ev6.flp -p gcc.ptrace -materials_file example.materials -model_type block -steady_file outputs/gcc.steady -o outputs/gcc.ttrace2122# Now, 'gcc.ttrace' does contain a thermal trace but the initial23# temperatures that were used to generate it were default constant24# values. These might not be representative if the simulation is not25# long enough to warm up the chip and package. However, the steady state26# temperatures are a good estimate of what the correct set of initial27# temperatures are. So, we now use the steady state temperatures28# produced as the set of initial temperatures for the next 'true' run:29cp outputs/gcc.steady gcc.init30../../hotspot -c example.config -init_file gcc.init -f ev6.flp -p gcc.ptrace -materials_file example.materials -model_type block -o outputs/gcc.ttrace3132# Note that the '-o <file>' command line flag is optional. Omitting it33# makes HotSpot compute the steady state temperatures directly without34# going through the transient simulation, thereby making the run faster.35# So, in the first command above, since we are interested only in the36# steady state temperatures, we could have actually omitted the '-o37# gcc.ttrace' part. Also, in the second command above, note that we have38# omitted the '-steady_file <file>' option.3940# HotSpot integrates a simple model for heatsink, air flow and fan. This41# can assist cooling package design and exploration of the impact of42# cooling configurations on silicon temperatures. The package model also43# supports natural convection (which results in a much higher thermal44# resistance, and can cause thermal runaway for high-power chips). By45# default, HotSpot uses a single lumped thermal convection resistance46# (r_convec) at the air-sink interface. Detailed package configuration47# may be provided in a file (e.g. 'package.config'). An example of using the48# package model is given by:49#../../hotspot -c example.config -f ev6.flp -p gcc.ptrace -package_model_used 1 -package_config_file package.config -steady_file outputs/gcc_detailed_package.steady505152