inorder/alpha-isa: create eaComp object visible to StaticInst through ISA
[gem5.git] / src / cpu / ozone / checker_builder.cc
1 /*
2 * Copyright (c) 2006 The Regents of The University of Michigan
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;
9 * redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution;
12 * neither the name of the copyright holders nor the names of its
13 * contributors may be used to endorse or promote products derived from
14 * this software without specific prior written permission.
15 *
16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
17 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
18 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
19 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
20 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 *
28 * Authors: Kevin Lim
29 */
30
31 #include <string>
32
33 #include "cpu/checker/cpu_impl.hh"
34 #include "cpu/inst_seq.hh"
35 #include "cpu/ozone/dyn_inst.hh"
36 #include "cpu/ozone/ozone_impl.hh"
37 #include "params/OzoneChecker.hh"
38 #include "sim/process.hh"
39 #include "sim/sim_object.hh"
40
41 class MemObject;
42
43 template
44 class Checker<RefCountingPtr<OzoneDynInst<OzoneImpl> > >;
45
46 /**
47 * Specific non-templated derived class used for SimObject configuration.
48 */
49 class OzoneChecker :
50 public Checker<RefCountingPtr<OzoneDynInst<OzoneImpl> > >
51 {
52 public:
53 OzoneChecker(Params *p)
54 : Checker<RefCountingPtr<OzoneDynInst<OzoneImpl> > >(p)
55 { }
56 };
57
58 ////////////////////////////////////////////////////////////////////////
59 //
60 // CheckerCPU Simulation Object
61 //
62 OzoneChecker *
63 OzoneCheckerParams::create()
64 {
65 OzoneChecker::Params *params = new OzoneChecker::Params();
66 params->name = name;
67 params->numberOfThreads = 1;
68 params->max_insts_any_thread = 0;
69 params->max_insts_all_threads = 0;
70 params->max_loads_any_thread = 0;
71 params->max_loads_all_threads = 0;
72 params->exitOnError = exitOnError;
73 params->updateOnError = updateOnError;
74 params->warnOnlyOnLoadError = warnOnlyOnLoadError;
75 params->deferRegistration = defer_registration;
76 params->functionTrace = function_trace;
77 params->functionTraceStart = function_trace_start;
78 params->clock = clock;
79 // Hack to touch all parameters. Consider not deriving Checker
80 // from BaseCPU..it's not really a CPU in the end.
81 Counter temp;
82 temp = max_insts_any_thread;
83 temp = max_insts_all_threads;
84 temp = max_loads_any_thread;
85 temp = max_loads_all_threads;
86 Tick temp2 = progress_interval;
87 temp2++;
88 params->progress_interval = 0;
89
90 params->itb = itb;
91 params->dtb = dtb;
92 params->system = system;
93 params->cpu_id = cpu_id;
94 #if FULL_SYSTEM
95 params->profile = profile;
96 #else
97 params->process = workload;
98 #endif
99
100 OzoneChecker *cpu = new OzoneChecker(params);
101 return cpu;
102 }