gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
nativetrace.hh
Go to the documentation of this file.
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: Gabe Black
29  */
30 
31 #ifndef __ARCH_ARM_NATIVETRACE_HH__
32 #define __ARCH_ARM_NATIVETRACE_HH__
33 
34 #include "base/types.hh"
35 #include "cpu/nativetrace.hh"
36 #include "params/ArmNativeTrace.hh"
37 
38 namespace Trace {
39 
41 {
42  public:
43  enum StateID {
72  };
73 
74  protected:
75  struct ThreadState {
77  uint64_t state[2][STATE_NUMVALS];
78  uint64_t *newState;
79  uint64_t *oldState;
80  int current;
81  void update(NativeTrace *parent);
82  void update(ThreadContext *tc);
83 
85  {
86  for (int i = 0; i < STATE_NUMVALS; i++) {
87  changed[i] = false;
88  state[0][i] = state[1][i] = 0;
89  current = 0;
90  newState = state[0];
91  oldState = state[1];
92  }
93  }
94  };
95 
97 
99 
100  public:
101  typedef ArmNativeTraceParams Params;
102 
103  const Params *
104  params() const
105  {
106  return dynamic_cast<const Params *>(_params);
107  }
108 
110  NativeTrace(p), stopOnPCError(p->stop_on_pc_error)
111  {}
112 
113  void check(NativeTraceRecord *record);
114 };
115 
116 } // namespace Trace
117 
118 #endif // __ARCH_ARM_NATIVETRACE_HH__
ArmNativeTrace(const Params *p)
Definition: nativetrace.hh:109
Bitfield< 7 > i
Definition: miscregs.hh:1378
const Params * params() const
Definition: nativetrace.hh:104
ThreadContext is the external interface to all thread state for anything outside of the CPU...
ArmNativeTraceParams Params
Definition: nativetrace.hh:101
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
const SimObjectParams * _params
Cached copy of the object parameters.
Definition: sim_object.hh:107
void update(NativeTrace *parent)
Definition: nativetrace.cc:67
Bitfield< 0 > p
void check(NativeTraceRecord *record)
Definition: nativetrace.cc:138
uint64_t state[2][STATE_NUMVALS]
Definition: nativetrace.hh:77

Generated on Fri Jun 9 2017 13:03:39 for gem5 by doxygen 1.8.6