simulate.py (8296:be7f03723412) | simulate.py (8664:42052d5bb793) |
---|---|
1# Copyright (c) 2005 The Regents of The University of Michigan 2# Copyright (c) 2010 Advanced Micro Devices, Inc. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 17 unchanged lines hidden (view full) --- 26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27# 28# Authors: Nathan Binkert 29# Steve Reinhardt 30 31import atexit 32import os 33import sys | 1# Copyright (c) 2005 The Regents of The University of Michigan 2# Copyright (c) 2010 Advanced Micro Devices, Inc. 3# All rights reserved. 4# 5# Redistribution and use in source and binary forms, with or without 6# modification, are permitted provided that the following conditions are 7# met: redistributions of source code must retain the above copyright 8# notice, this list of conditions and the following disclaimer; --- 17 unchanged lines hidden (view full) --- 26# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27# 28# Authors: Nathan Binkert 29# Steve Reinhardt 30 31import atexit 32import os 33import sys |
34import json |
|
34 35# import the SWIG-wrapped main C++ functions 36import internal 37import core 38import stats 39import SimObject 40import ticks 41import objects 42from util import fatal | 35 36# import the SWIG-wrapped main C++ functions 37import internal 38import core 39import stats 40import SimObject 41import ticks 42import objects 43from util import fatal |
44from util import attrdict |
|
43 44# define a MaxTick parameter 45MaxTick = 2**63 - 1 46 47# The final hook to generate .ini files. Called from the user script 48# once the config is built. 49def instantiate(ckpt_dir=None): 50 from m5 import options --- 15 unchanged lines hidden (view full) --- 66 67 if options.dump_config: 68 ini_file = file(os.path.join(options.outdir, options.dump_config), 'w') 69 # Print ini sections in sorted order for easier diffing 70 for obj in sorted(root.descendants(), key=lambda o: o.path()): 71 obj.print_ini(ini_file) 72 ini_file.close() 73 | 45 46# define a MaxTick parameter 47MaxTick = 2**63 - 1 48 49# The final hook to generate .ini files. Called from the user script 50# once the config is built. 51def instantiate(ckpt_dir=None): 52 from m5 import options --- 15 unchanged lines hidden (view full) --- 68 69 if options.dump_config: 70 ini_file = file(os.path.join(options.outdir, options.dump_config), 'w') 71 # Print ini sections in sorted order for easier diffing 72 for obj in sorted(root.descendants(), key=lambda o: o.path()): 73 obj.print_ini(ini_file) 74 ini_file.close() 75 |
76 if options.json_config: 77 json_file = file(os.path.join(options.outdir, options.json_config), 'w') 78 d = root.get_config_as_dict() 79 json.dump(d, json_file, indent=4) 80 json_file.close() 81 82 |
|
74 # Initialize the global statistics 75 stats.initSimStats() 76 77 # Create the C++ sim objects and connect ports 78 for obj in root.descendants(): obj.createCCObject() 79 for obj in root.descendants(): obj.connectPorts() 80 81 # Do a second pass to finish initializing the sim objects --- 135 unchanged lines hidden --- | 83 # Initialize the global statistics 84 stats.initSimStats() 85 86 # Create the C++ sim objects and connect ports 87 for obj in root.descendants(): obj.createCCObject() 88 for obj in root.descendants(): obj.connectPorts() 89 90 # Do a second pass to finish initializing the sim objects --- 135 unchanged lines hidden --- |