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 |
34 35# import the SWIG-wrapped main C++ functions 36import internal 37import core 38import stats 39import SimObject 40import ticks 41import objects --- 26 unchanged lines hidden (view full) --- 68 if options.dump_config: 69 ini_file = file(os.path.join(options.outdir, options.dump_config), 'w') 70 # Print ini sections in sorted order for easier diffing 71 for obj in sorted(root.descendants(), key=lambda o: o.path()): 72 obj.print_ini(ini_file) 73 ini_file.close() 74 75 if options.json_config: |
76 try: 77 import json 78 json_file = file(os.path.join(options.outdir, options.json_config), 'w') 79 d = root.get_config_as_dict() 80 json.dump(d, json_file, indent=4) 81 json_file.close() 82 except ImportError: 83 pass |
84 85 86 # Initialize the global statistics 87 stats.initSimStats() 88 89 # Create the C++ sim objects and connect ports 90 for obj in root.descendants(): obj.createCCObject() 91 for obj in root.descendants(): obj.connectPorts() --- 137 unchanged lines hidden --- |