simulate.py (5773:7434b2271b0c) simulate.py (6001:00251eb95de7)
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 19 unchanged lines hidden (view full) ---

28# Steve Reinhardt
29
30import atexit
31import os
32import sys
33
34# import the SWIG-wrapped main C++ functions
35import internal
1# Copyright (c) 2005 The Regents of The University of Michigan
2# All rights reserved.
3#
4# Redistribution and use in source and binary forms, with or without
5# modification, are permitted provided that the following conditions are
6# met: redistributions of source code must retain the above copyright
7# notice, this list of conditions and the following disclaimer;
8# redistributions in binary form must reproduce the above copyright

--- 19 unchanged lines hidden (view full) ---

28# Steve Reinhardt
29
30import atexit
31import os
32import sys
33
34# import the SWIG-wrapped main C++ functions
35import internal
36import core
37import stats
36from main import options
37import SimObject
38import ticks
39import objects
40
41# The final hook to generate .ini files. Called from the user script
42# once the config is built.
43def instantiate(root):
44 # we need to fix the global frequency
45 ticks.fixGlobalFrequency()
46
47 root.unproxy_all()
48
49 if options.dump_config:
50 ini_file = file(os.path.join(options.outdir, options.dump_config), 'w')
51 root.print_ini(ini_file)
52 ini_file.close()
53
54 # Initialize the global statistics
38from main import options
39import SimObject
40import ticks
41import objects
42
43# The final hook to generate .ini files. Called from the user script
44# once the config is built.
45def instantiate(root):
46 # we need to fix the global frequency
47 ticks.fixGlobalFrequency()
48
49 root.unproxy_all()
50
51 if options.dump_config:
52 ini_file = file(os.path.join(options.outdir, options.dump_config), 'w')
53 root.print_ini(ini_file)
54 ini_file.close()
55
56 # Initialize the global statistics
55 internal.stats.initSimStats()
57 stats.initSimStats()
56
57 # Create the C++ sim objects and connect ports
58 root.createCCObject()
59 root.connectPorts()
60
61 # Do a second pass to finish initializing the sim objects
58
59 # Create the C++ sim objects and connect ports
60 root.createCCObject()
61 root.connectPorts()
62
63 # Do a second pass to finish initializing the sim objects
62 internal.core.initAll()
64 core.initAll()
63
64 # Do a third pass to initialize statistics
65
66 # Do a third pass to initialize statistics
65 internal.core.regAllStats()
67 core.regAllStats()
66
68
67 # Check to make sure that the stats package is properly initialized
68 internal.stats.check()
69 # We're done registering statistics. Enable the stats package now.
70 stats.enable()
69
70 # Reset to put the stats in a consistent state.
71
72 # Reset to put the stats in a consistent state.
71 internal.stats.reset()
73 stats.reset()
72
73def doDot(root):
74 dot = pydot.Dot()
75 instance.outputDot(dot)
76 dot.orientation = "portrait"
77 dot.size = "8.5,11"
78 dot.ranksep="equally"
79 dot.rank="samerank"

--- 108 unchanged lines hidden ---
74
75def doDot(root):
76 dot = pydot.Dot()
77 instance.outputDot(dot)
78 dot.orientation = "portrait"
79 dot.size = "8.5,11"
80 dot.ranksep="equally"
81 dot.rank="samerank"

--- 108 unchanged lines hidden ---