gem5  v20.0.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 class DirectedGenerator;
46 
48 {
49  public:
50  class CpuPort : public MasterPort
51  {
52  private:
54 
55  public:
56  CpuPort(const std::string &_name, RubyDirectedTester *_tester,
57  PortID _id)
58  : MasterPort(_name, _tester, _id), tester(_tester)
59  {}
60 
61  protected:
62  virtual bool recvTimingResp(PacketPtr pkt);
63  virtual void recvReqRetry()
64  { panic("%s does not expect a retry\n", name()); }
65  };
66 
67  typedef RubyDirectedTesterParams Params;
68  RubyDirectedTester(const Params *p);
70 
71  Port &getPort(const std::string &if_name,
72  PortID idx=InvalidPortID) override;
73 
74  MasterPort* getCpuPort(int idx);
75 
76  void init() override;
77 
78  void wakeup();
79 
81 
82  void printStats(std::ostream& out) const {}
83  void clearStats() {}
84  void printConfig(std::ostream& out) const {}
85 
86  void print(std::ostream& out) const;
87 
88  protected:
90 
91  private:
92  void hitCallback(NodeID proc, Addr addr);
93 
94  void checkForDeadlock();
95 
96  // Private copy constructor and assignment operator
99 
104 };
105 
106 #endif // __CPU_DIRECTEDTEST_RUBYDIRECTEDTESTER_HH__
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
Definition: port.hh:71
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:163
Ports are used to interface objects to each other.
Definition: port.hh:56
virtual void recvReqRetry()
Called by the peer if sendTimingReq was called on this peer (causing recvTimingReq to be called on th...
const PortID InvalidPortID
Definition: types.hh:236
MasterPort * getCpuPort(int idx)
CpuPort(const std::string &_name, RubyDirectedTester *_tester, PortID _id)
ip6_addr_t addr
Definition: inet.hh:330
void init() override
init() is called after all C++ SimObjects have been created and all ports are connected.
STL vector class.
Definition: stl.hh:37
void print(std::ostream &out) const
unsigned int NodeID
Definition: TypeDefines.hh:34
The ClockedObject class extends the SimObject with a clock and accessor functions to relate ticks to ...
ClockedObject declaration and implementation.
Port Object Declaration.
void printStats(std::ostream &out) const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:140
std::vector< MasterPort * > ports
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:249
EventFunctionWrapper directedStartEvent
RubyDirectedTesterParams Params
Port & getPort(const std::string &if_name, PortID idx=InvalidPortID) override
Get a port with a given name and index.
Declaration of the Packet class.
void printConfig(std::ostream &out) const
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:102
virtual bool recvTimingResp(PacketPtr pkt)
Receive a timing response from the peer.
RubyDirectedTester & operator=(const RubyDirectedTester &obj)
int16_t PortID
Port index/ID type, and a symbolic name for an invalid port id.
Definition: types.hh:235
DirectedGenerator * generator
RubyDirectedTester(const Params *p)
Bitfield< 0 > p
void hitCallback(NodeID proc, Addr addr)

Generated on Thu May 28 2020 16:21:31 for gem5 by doxygen 1.8.13