#!/usr/bin/env bash12# Remove results from previous simulations3rm -f *.init4rm -f outputs/*56# Create outputs directory if it doesn't exist7mkdir outputs89# HotSpot's grid model is capable of modeling stacked 3-D chips. To be10# able to do that, one has to specify what is called the 'Layer11# Configuration File' (LCF). An LCF specifies the set of vertical layers12# to be modeled including its physical properties (thickness,13# conductivity etc.) and the floorplan of the die in that layer.1415# Let us now look at an example of how to model stacked 3-D chips. Let16# us use a simple, 3-block floorplan file 'floorplan1.flp' in addition to17# the more detailed original 'floorplan2.flp'. In the chip we will model, layer 0 is18# power dissipating silicon with a floorplan of 'floorplan1.flp', followed19# by a layer of non-dissipating (passive) TIM. This is then followed by20# another layer of active silicon with a floorplan of 'floorplan2.flp' and21# another layer of passive TIM. Such a layer configuration is described22# in 'example.lcf'. Note that the floorplan files of all layers are specified23# in the LCF instead of via the command line24../../hotspot -c example.config -p example.ptrace -grid_layer_file example.lcf -materials_file example.materials -model_type grid -detailed_3D on -steady_file outputs/example.steady -grid_steady_file outputs/example.grid.steady2526# Copy steady-state results over to initial temperatures27cp outputs/example.steady example.init2829# Transient simulation30../../hotspot -c example.config -p example.ptrace -grid_layer_file example.lcf -materials_file example.materials -model_type grid -detailed_3D on -o outputs/example.ttrace -grid_transient_file outputs/example.grid.ttrace3132# Visualize Heat Map of Layer 0 with Perl and with Python script33../../scripts/split_grid_steady.py outputs/example.grid.steady 6 64 6434../../scripts/grid_thermal_map.py floorplan2.flp outputs/example_layer2.grid.steady 64 64 outputs/layer2.png35../../scripts/grid_thermal_map.pl floorplan2.flp outputs/example_layer2.grid.steady 64 64 > outputs/layer2.svg363738