gem5  v21.1.0.2
RubyDirectedTester.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 1999-2008 Mark D. Hill and David A. Wood
3  * Copyright (c) 2009-2010 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
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.
16  *
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.
28  */
29 
30 #ifndef __CPU_DIRECTEDTEST_RUBYDIRECTEDTESTER_HH__
31 #define __CPU_DIRECTEDTEST_RUBYDIRECTEDTESTER_HH__
32 
33 #include <iostream>
34 #include <string>
35 #include <vector>
36 
37 #include "mem/packet.hh"
38 #include "mem/port.hh"
42 #include "params/RubyDirectedTester.hh"
43 #include "sim/clocked_object.hh"
44 
45 namespace gem5
46 {
47 
48 class DirectedGenerator;
49 
51 {
52  public:
53  class CpuPort : public RequestPort
54  {
55  private:
57 
58  public:
59  CpuPort(const std::string &_name, RubyDirectedTester *_tester,
60  PortID _id)
61  : RequestPort(_name, _tester, _id), tester(_tester)
62  {}
63 
64  protected:
65  virtual bool recvTimingResp(PacketPtr pkt);
66  virtual void recvReqRetry()
67  { panic("%s does not expect a retry\n", name()); }
68  };
69 
70  typedef RubyDirectedTesterParams Params;
71  RubyDirectedTester(const Params &p);
73 
74  Port &getPort(const std::string &if_name,
75  PortID idx=InvalidPortID) override;
76 
77  RequestPort* getCpuPort(int idx);
78 
79  void init() override;
80 
81  void wakeup();
82 
84 
85  void printStats(std::ostream& out) const {}
86  void clearStats() {}
87  void printConfig(std::ostream& out) const {}
88 
89  void print(std::ostream& out) const;
90 
91  protected:
93 
94  private:
95  void hitCallback(ruby::NodeID proc, Addr addr);
96 
97  void checkForDeadlock();
98 
99  // Private copy constructor and assignment operator
102 
107 };
108 
109 } // namespace gem5
110 
111 #endif // __CPU_DIRECTEDTEST_RUBYDIRECTEDTESTER_HH__
gem5::PortID
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:252
gem5::RubyDirectedTester::print
void print(std::ostream &out) const
gem5::RubyDirectedTester::wakeup
void wakeup()
Definition: RubyDirectedTester.cc:132
gem5::Port::name
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:111
gem5::RubyDirectedTester::CpuPort::CpuPort
CpuPort(const std::string &_name, RubyDirectedTester *_tester, PortID _id)
Definition: RubyDirectedTester.hh:59
gem5::RubyDirectedTester::incrementCycleCompletions
void incrementCycleCompletions()
Definition: RubyDirectedTester.hh:83
gem5::RubyDirectedTester::hitCallback
void hitCallback(ruby::NodeID proc, Addr addr)
Definition: RubyDirectedTester.cc:120
gem5::RubyDirectedTester::CpuPort
Definition: RubyDirectedTester.hh:53
gem5::DirectedGenerator
Definition: DirectedGenerator.hh:40
gem5::RubyDirectedTester::directedStartEvent
EventFunctionWrapper directedStartEvent
Definition: RubyDirectedTester.hh:92
std::vector
STL vector class.
Definition: stl.hh:37
gem5::RubyDirectedTester::printConfig
void printConfig(std::ostream &out) const
Definition: RubyDirectedTester.hh:87
gem5::RubyDirectedTester::m_requests_completed
uint64_t m_requests_completed
Definition: RubyDirectedTester.hh:103
gem5::InvalidPortID
const PortID InvalidPortID
Definition: types.hh:253
gem5::RubyDirectedTester::printStats
void printStats(std::ostream &out) const
Definition: RubyDirectedTester.hh:85
gem5::RubyDirectedTester::~RubyDirectedTester
~RubyDirectedTester()
Definition: RubyDirectedTester.cc:71
packet.hh
gem5::RubyDirectedTester::CpuPort::recvReqRetry
virtual void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
Definition: RubyDirectedTester.hh:66
gem5::RubyDirectedTester::checkForDeadlock
void checkForDeadlock()
gem5::RequestPort
A RequestPort is a specialisation of a Port, which implements the default protocol for the three diff...
Definition: port.hh:77
gem5::RubyDirectedTester::ports
std::vector< RequestPort * > ports
Definition: RubyDirectedTester.hh:104
gem5::RubyDirectedTester::RubyDirectedTester
RubyDirectedTester(const Params &p)
Definition: RubyDirectedTester.cc:52
gem5::Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:283
DataBlock.hh
gem5::MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:326
TypeDefines.hh
gem5::RubyDirectedTester::generator
DirectedGenerator * generator
Definition: RubyDirectedTester.hh:106
gem5::RubyDirectedTester::Params
RubyDirectedTesterParams Params
Definition: RubyDirectedTester.hh:70
port.hh
gem5::RubyDirectedTester::operator=
RubyDirectedTester & operator=(const RubyDirectedTester &obj)
gem5::RubyDirectedTester::m_requests_to_complete
uint64_t m_requests_to_complete
Definition: RubyDirectedTester.hh:105
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::RubyDirectedTester::getCpuPort
RequestPort * getCpuPort(int idx)
Definition: RubyDirectedTester.cc:112
gem5::RubyDirectedTester::CpuPort::tester
RubyDirectedTester * tester
Definition: RubyDirectedTester.hh:56
gem5::ClockedObject
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
Definition: clocked_object.hh:234
gem5::EventFunctionWrapper
Definition: eventq.hh:1115
gem5::RubyDirectedTester::clearStats
void clearStats()
Definition: RubyDirectedTester.hh:86
gem5::RubyDirectedTester
Definition: RubyDirectedTester.hh:50
gem5::Port
Ports are used to interface objects to each other.
Definition: port.hh:61
clocked_object.hh
gem5::ruby::NodeID
unsigned int NodeID
Definition: TypeDefines.hh:40
gem5::RubyDirectedTester::init
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
Definition: RubyDirectedTester.cc:78
gem5::RubyDirectedTester::getPort
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Definition: RubyDirectedTester.cc:85
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
SubBlock.hh
gem5::Named::_name
const std::string _name
Definition: named.hh:41
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:177
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84
gem5::RubyDirectedTester::CpuPort::recvTimingResp
virtual bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
Definition: RubyDirectedTester.cc:100

Generated on Tue Sep 21 2021 12:25:09 for gem5 by doxygen 1.8.17