-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy paththermal_RC.py
61 lines (42 loc) · 3.1 KB
/
thermal_RC.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
51
52
53
54
55
56
57
58
59
60
61
import common
from power_class import Power_grid
from package_class import Chiplet_package
import time
import argparse
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument('--power_config_file', type=str, default='example_3_heterogeneous_chiplets/power_dist_config_heterogeneous.yml', help='Power distribution configuration file')
parser.add_argument('--power_seq_file', type=str, default='example_3_heterogeneous_chiplets/power_seq_random_3.csv', help='Power sequence file')
parser.add_argument('--material_prop_file', type=str, default='material_prop.yml', help='Material properties file')
parser.add_argument('--geometry_file', type=str, default='example_3_heterogeneous_chiplets/chiplet_geometry_3_chiplets_uniform_nodes.yml', help='Geometry properties file')
parser.add_argument('--output_dir', type=str, default='./example_3_heterogeneous_chiplets/', help='Output directory')
parser.add_argument('--simulation_type', type=str, default='transient', choices=['transient', 'steady'], help='transient or steady state simulation')
parser.add_argument('--generate_DSS', type=lambda x: (str(x).lower() in ['true','1', 'yes']), default=True, help='Generate A and B for DSS')
parser.add_argument('--is_homogeneous', type=lambda x: (str(x).lower() in ['true','1', 'yes']), default=True, help='Are chiplet placement homogeneous?')
parser.add_argument('--time_step', type=float, default=0.1, help='Time step for transient simulation in sec')
parser.add_argument('--power_interval', type=float, default=1, help='Power interval for transient simulation in sec')
parser.add_argument('--total_duration', type=float, default=50, help='Total time for transient simulation in sec')
parser.add_argument('--use_tuned_C', type=lambda x: (str(x).lower() in ['true','1', 'yes']), default=True, help='Use tuned C matrix for simulation')
parser.add_argument('--generate_heatmap', type=lambda x: (str(x).lower() in ['true','1', 'yes']), default=True, help='Generate heatmap of final temperature')
parser.add_argument('--time_heatmap', type=float, default=4, help='Time for heatmap generation in sec')
args = parser.parse_args()
return args
if __name__ == '__main__':
# load material properties from yaml file
args = parse_args()
material_properties = common.load_dict_yaml(args.material_prop_file)
# load geometry properties from yaml file
geometry_dict = common.load_dict_yaml(args.geometry_file)
# power_config_dict = common.load_dict_yaml('power_dist_config.yml')
power_config_dict = common.load_dict_yaml(args.power_config_file)
common_utils = common.Utils(geometry_dict['common'])
# create power grid object
power_grid_class = Power_grid(power_config_dict, args)
power_grid_class.create_power_seq_grid(utils=common_utils)
package = Chiplet_package(material_properties, geometry_dict, power_grid_class, args, common_utils)
package.create_layers()
package.connect_nodes()
package.generate_floorplan()
start = time.time()
package.run_simulation_c_lsoda()
print('Time taken for simulation: ', time.time()-start)