22a048b5b13b19982415cf0eda8948769ead0498
3 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions are
8 * met: redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer;
10 * redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in the
12 * documentation and/or other materials provided with the distribution;
13 * neither the name of the copyright holders nor the names of its
14 * contributors may be used to endorse or promote products derived from
15 * this software without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
18 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
19 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
20 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
21 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
23 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 * Description: See init.h
39 #include "mem/ruby/common/Global.hh"
40 #include "mem/ruby/eventqueue/RubyEventQueue.hh"
41 #include "mem/ruby/system/System.hh"
42 #include "mem/ruby/common/Debug.hh"
43 #include "mem/ruby/profiler/Profiler.hh"
44 #include "mem/ruby/tester/Tester.hh"
45 #include "mem/ruby/init.hh"
52 #include "mem/gems_common/ioutil/confio.hh"
53 #include "mem/gems_common/ioutil/initvar.hh"
55 // A generated file containing the default parameters in string form
56 // The defaults are stored in the variable global_default_param
57 #include "mem/protocol/default_param.hh"
59 static initvar_t
*ruby_initvar_obj
= NULL
;
61 //***************************************************************************
62 static void init_generate_values( void )
64 /* update generated values, based on input configuration */
67 //***************************************************************************
68 void init_variables( void )
70 // allocate the "variable initialization" package
71 ruby_initvar_obj
= new initvar_t( "ruby", "../../../ruby/",
74 &init_generate_values
);
79 // Set things to NULL to make sure we don't de-reference them
80 // without a seg. fault.
83 g_eventQueue_ptr
= NULL
;
85 cout
<< "Ruby Timing Mode" << endl
;
89 g_debug_ptr
= new Debug( DEBUG_FILTER_STRING
,
90 DEBUG_VERBOSITY_STRING
,
92 DEBUG_OUTPUT_FILENAME
);
94 cout
<< "Creating event queue..." << endl
;
95 g_eventQueue_ptr
= new RubyEventQueue
;
96 cout
<< "Creating event queue done" << endl
;
98 cout
<< "Creating system..." << endl
;
99 cout
<< " Processors: " << RubyConfig::numberOfProcessors() << endl
;
101 g_system_ptr
= new RubySystem
;
102 cout
<< "Creating system done" << endl
;
104 cout
<< "Ruby initialization complete" << endl
;
107 void destroy_simulator()
109 cout
<< "Deleting system..." << endl
;
111 cout
<< "Deleting system done" << endl
;
113 cout
<< "Deleting event queue..." << endl
;
114 delete g_eventQueue_ptr
;
115 cout
<< "Deleting event queue done" << endl
;
120 /*-------------------------------------------------------------------------+
121 | DG: These are the external load and unload hooks that will be called by |
122 | M5 in phase 1 integration, and possibly afterwards, too. |
123 +-------------------------------------------------------------------------*/
143 /* I have to put it somewhere for now */
144 void tester_main(int argc
, char **argv
) {
145 std::cout
<< __FILE__
<< "(" << __LINE__
<< "): Not implemented." << std::endl
;