-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_hotspot_hs.py
51 lines (44 loc) · 1.41 KB
/
run_hotspot_hs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
from system import System_25D
import os
import sys
import time
import csv
import util.fill_space
import subprocess
if len(sys.argv) != 2:
print("Usage: python3 run_hotspot.py <step_file>")
print("<step_file>: TAP2.5D step, e.g. step_1")
sys.exit(1)
def run_hotspot(path, filename):
proc = subprocess.Popen(["./util/hotspot",
"-c",path+"new_hotspot.config",
"-f",path+filename+"L4_ChipLayer.flp",
"-p",path+filename+".ptrace",
"-steady_file",path+filename+".steady",
"-grid_steady_file",path+filename+".grid.steady",
"-model_type","grid",
"-detailed_3D","on",
"-grid_layer_file",path+filename+"layers.lcf"],
stdout=subprocess.PIPE, stderr = subprocess.PIPE)
stdout, stderr = proc.communicate()
outlist = stdout.split()
return (max(list(map(float,outlist[3::2])))-273.15)
def clean_hotspot(path, filename):
os.system('rm ' + path + filename + '{*.flp,*.lcf,*.ptrace,*.steady}')
tstart = time.time()
path = "./output/micro150"
temp_new = run_hotspot("./output/micro150/", sys.argv[1])
tend = time.time()
#-- get all chiplets temp
entries = list(csv.reader(open("./output/micro150/"+sys.argv[1]+".steady", 'r'), delimiter='\t'))
cols = list(zip(*entries))
cnames = cols[0]
temps = cols[1]
print("HotSpot result")
i = 0
for cn in cnames:
if ('layer_4_Chiplet' in cn):
print(cn, ":", float(temps[i])-273.15)
i += 1
print("max temp:", temp_new)
print("runtime:", tend-tstart)