gem5 v24.0.0.0
Loading...
Searching...
No Matches
RubyTester.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 2013 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software
9 * licensed hereunder. You may use the software subject to the license
10 * terms below provided that you ensure that this notice is replicated
11 * unmodified and in its entirety in all distributions of the software,
12 * modified or unmodified, in source code or in binary form.
13 *
14 * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
15 * Copyright (c) 2009 Advanced Micro Devices, Inc.
16 * All rights reserved.
17 *
18 * Redistribution and use in source and binary forms, with or without
19 * modification, are permitted provided that the following conditions are
20 * met: redistributions of source code must retain the above copyright
21 * notice, this list of conditions and the following disclaimer;
22 * redistributions in binary form must reproduce the above copyright
23 * notice, this list of conditions and the following disclaimer in the
24 * documentation and/or other materials provided with the distribution;
25 * neither the name of the copyright holders nor the names of its
26 * contributors may be used to endorse or promote products derived from
27 * this software without specific prior written permission.
28 *
29 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
30 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
31 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
32 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
33 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
34 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
35 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
36 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
37 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
38 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
39 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
40 */
41
42#ifndef __CPU_RUBYTEST_RUBYTESTER_HH__
43#define __CPU_RUBYTEST_RUBYTESTER_HH__
44
45#include <iostream>
46#include <string>
47#include <vector>
48
50#include "mem/packet.hh"
51#include "mem/port.hh"
54#include "params/RubyTester.hh"
55#include "sim/clocked_object.hh"
56
57namespace gem5
58{
59
61{
62 public:
63 class CpuPort : public RequestPort
64 {
65 private:
67 // index for m_last_progress_vector and hitCallback
69
70 public:
71 //
72 // Currently, each instatiation of the RubyTester::CpuPort supports
73 // only instruction or data requests, not both. However, for those
74 // RubyPorts that support both types of requests, separate InstOnly
75 // and DataOnly CpuPorts will map to that RubyPort
76
77 CpuPort(const std::string &_name, RubyTester *_tester, PortID _id,
78 PortID _index)
79 : RequestPort(_name, _id), tester(_tester),
80 globalIdx(_index)
81 {}
82
83 protected:
84 virtual bool recvTimingResp(PacketPtr pkt);
85 virtual void recvReqRetry()
86 { panic("%s does not expect a retry\n", name()); }
87 };
88
90 {
92
93 SenderState(Addr addr, int size) : subBlock(addr, size) {}
94
95 };
96
97 typedef RubyTesterParams Params;
98 RubyTester(const Params &p);
100
101 Port &getPort(const std::string &if_name,
102 PortID idx=InvalidPortID) override;
103
104 bool isInstOnlyCpuPort(int idx);
105 bool isInstDataCpuPort(int idx);
106
109
110 void init() override;
111
112 void wakeup();
113
115
116 void printStats(std::ostream& out) const {}
117 void clearStats() {}
118 void printConfig(std::ostream& out) const {}
119
120 void print(std::ostream& out) const;
121 bool getCheckFlush() { return m_check_flush; }
122
124 protected:
126
128
129 private:
131
132 void checkForDeadlock();
133
134 // Private copy constructor and assignment operator
137
140
153};
154
155inline std::ostream&
156operator<<(std::ostream& out, const RubyTester& obj)
157{
158 obj.print(out);
159 out << std::flush;
160 return out;
161}
162
163} // namespace gem5
164
165#endif // __CPU_RUBYTEST_RUBYTESTER_HH__
const char data[]
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
const std::string _name
Definition named.hh:41
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition packet.hh:295
Ports are used to interface objects to each other.
Definition port.hh:62
const std::string name() const
Return port name (for DPRINTF).
Definition port.hh:111
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Definition port.hh:136
virtual bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
virtual void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Definition RubyTester.hh:85
CpuPort(const std::string &_name, RubyTester *_tester, PortID _id, PortID _index)
Definition RubyTester.hh:77
EventFunctionWrapper checkStartEvent
void checkForDeadlock()
void printStats(std::ostream &out) const
std::vector< RequestPort * > readPorts
bool isInstOnlyCpuPort(int idx)
void printConfig(std::ostream &out) const
RubyTester & operator=(const RubyTester &obj)
void incrementCheckCompletions()
RequestPort * getWritableCpuPort(int idx)
void hitCallback(ruby::NodeID proc, ruby::SubBlock *data)
RubyTester(const Params &p)
Definition RubyTester.cc:55
RequestorID requestorId()
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
bool isInstDataCpuPort(int idx)
std::vector< RequestPort * > writePorts
RubyTester(const RubyTester &obj)
RequestPort * getReadableCpuPort(int idx)
uint64_t m_checks_to_complete
RequestorID _requestorId
CheckTable * m_checkTable_ptr
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
uint64_t m_checks_completed
std::vector< Cycles > m_last_progress_vector
RubyTesterParams Params
Definition RubyTester.hh:97
void print(std::ostream &out) const
STL vector class.
Definition stl.hh:37
ClockedObject declaration and implementation.
#define panic(...)
This implements a cprintf based panic() function.
Definition logging.hh:188
Port Object Declaration.
Bitfield< 0 > p
Bitfield< 3 > addr
Definition types.hh:84
unsigned int NodeID
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
const PortID InvalidPortID
Definition types.hh:246
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition types.hh:245
uint16_t RequestorID
Definition request.hh:95
static std::ostream & operator<<(std::ostream &os, const DummyMatRegContainer &d)
Definition matrix.hh:564
Declaration of the Packet class.
A virtual base opaque structure used to hold state associated with the packet (e.g....
Definition packet.hh:469
SenderState(Addr addr, int size)
Definition RubyTester.hh:93

Generated on Tue Jun 18 2024 16:24:02 for gem5 by doxygen 1.11.0