RubyTester.hh (8922:17f037ad8918) RubyTester.hh (8932:1b2c17565ac8)
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * Copyright (c) 2009 Advanced Micro Devices, Inc.
4 * All rights reserved.
5 *
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

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

46{
47 public:
48 class CpuPort : public MasterPort
49 {
50 private:
51 RubyTester *tester;
52
53 public:
1/*
2 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3 * Copyright (c) 2009 Advanced Micro Devices, Inc.
4 * All rights reserved.
5 *
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

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

46{
47 public:
48 class CpuPort : public MasterPort
49 {
50 private:
51 RubyTester *tester;
52
53 public:
54 CpuPort(const std::string &_name, RubyTester *_tester, int _idx)
55 : MasterPort(_name, _tester), tester(_tester), idx(_idx)
54 //
55 // Currently, each instatiation of the RubyTester::CpuPort supports
56 // only instruction or data requests, not both. However, for those
57 // RubyPorts that support both types of requests, separate InstOnly
58 // and DataOnly CpuPorts will map to that RubyPort
59 //
60 enum Type
61 {
62 // Port supports only instruction requests
63 InstOnly,
64 // Port supports only data requests
65 DataOnly
66 };
67
68 CpuPort(const std::string &_name, RubyTester *_tester, int _idx,
69 Type _type)
70 : MasterPort(_name, _tester), tester(_tester), idx(_idx),
71 type(_type)
56 {}
57
58 int idx;
72 {}
73
74 int idx;
75 Type type;
59
60 protected:
61 virtual bool recvTiming(PacketPtr pkt);
62 virtual void recvRetry()
63 { panic("%s does not expect a retry\n", name()); }
64 virtual Tick recvAtomic(PacketPtr pkt);
65 virtual void recvFunctional(PacketPtr pkt) { }
66 };

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

85
86 typedef RubyTesterParams Params;
87 RubyTester(const Params *p);
88 ~RubyTester();
89
90 virtual MasterPort &getMasterPort(const std::string &if_name,
91 int idx = -1);
92
76
77 protected:
78 virtual bool recvTiming(PacketPtr pkt);
79 virtual void recvRetry()
80 { panic("%s does not expect a retry\n", name()); }
81 virtual Tick recvAtomic(PacketPtr pkt);
82 virtual void recvFunctional(PacketPtr pkt) { }
83 };

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

102
103 typedef RubyTesterParams Params;
104 RubyTester(const Params *p);
105 ~RubyTester();
106
107 virtual MasterPort &getMasterPort(const std::string &if_name,
108 int idx = -1);
109
93 MasterPort* getCpuPort(int idx);
110 MasterPort* getReadableCpuPort(int idx);
111 MasterPort* getWritableCpuPort(int idx);
94
95 virtual void init();
96
97 void wakeup();
98
99 void incrementCheckCompletions() { m_checks_completed++; }
100
101 void printStats(std::ostream& out) const {}

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

131
132 // Private copy constructor and assignment operator
133 RubyTester(const RubyTester& obj);
134 RubyTester& operator=(const RubyTester& obj);
135
136 CheckTable* m_checkTable_ptr;
137 std::vector<Time> m_last_progress_vector;
138
112
113 virtual void init();
114
115 void wakeup();
116
117 void incrementCheckCompletions() { m_checks_completed++; }
118
119 void printStats(std::ostream& out) const {}

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

149
150 // Private copy constructor and assignment operator
151 RubyTester(const RubyTester& obj);
152 RubyTester& operator=(const RubyTester& obj);
153
154 CheckTable* m_checkTable_ptr;
155 std::vector<Time> m_last_progress_vector;
156
157 int m_num_cpus;
139 uint64 m_checks_completed;
158 uint64 m_checks_completed;
140 std::vector<CpuPort*> ports;
159 std::vector<CpuPort*> writePorts;
160 std::vector<CpuPort*> readPorts;
141 uint64 m_checks_to_complete;
142 int m_deadlock_threshold;
161 uint64 m_checks_to_complete;
162 int m_deadlock_threshold;
143 int m_num_cpu_sequencers;
163 int m_num_writers;
164 int m_num_readers;
144 int m_wakeup_frequency;
145 bool m_check_flush;
165 int m_wakeup_frequency;
166 bool m_check_flush;
167 int m_num_inst_ports;
146};
147
148inline std::ostream&
149operator<<(std::ostream& out, const RubyTester& obj)
150{
151 obj.print(out);
152 out << std::flush;
153 return out;
154}
155
156#endif // __CPU_RUBYTEST_RUBYTESTER_HH__
168};
169
170inline std::ostream&
171operator<<(std::ostream& out, const RubyTester& obj)
172{
173 obj.print(out);
174 out << std::flush;
175 return out;
176}
177
178#endif // __CPU_RUBYTEST_RUBYTESTER_HH__