gem5 [DEVELOP-FOR-25.0]
Loading...
Searching...
No Matches
Check.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 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_RUBYTEST_CHECK_HH__
31#define __CPU_RUBYTEST_CHECK_HH__
32
33#include <iostream>
34
35#include "base/random.hh"
38#include "mem/ruby/protocol/RubyAccessMode.hh"
39#include "mem/ruby/protocol/TesterStatus.hh"
40
41namespace gem5
42{
43
44namespace ruby
45{
46class SubBlock;
47} // namespace ruby
48
49const int CHECK_SIZE_BITS = 2;
50const int CHECK_SIZE = (1 << CHECK_SIZE_BITS);
51const int CACHE_LINE_BITS = 6;
52
53class Check
54{
55 public:
56 Check(Addr address, Addr pc, int _num_writers,
57 int _num_readers, RubyTester* _tester);
58
59 void initiate(Cycles current_time); // Does Action or Check or nether
61 Cycles curTime);
62 Addr getAddress() const { return m_address; }
63 void changeAddress(Addr address);
64
65 void print(std::ostream& out) const;
66
67 private:
68 void initiateFlush(Cycles current_time);
69 void initiatePrefetch(Cycles current_time);
70 void initiateAction(Cycles current_time);
71 void initiateCheck(Cycles current_time);
72
73 void pickValue();
74 void pickInitiatingNode();
75
76 void debugPrint();
77
78 ruby::TesterStatus m_status;
79 uint8_t m_value;
84 ruby::RubyAccessMode m_access_mode;
89};
90
91inline std::ostream&
92operator<<(std::ostream& out, const Check& obj)
93{
94 obj.print(out);
95 out << std::flush;
96 return out;
97}
98
99} // namespace gem5
100
101#endif // __CPU_RUBYTEST_CHECK_HH__
const char data[]
void initiateFlush(Cycles current_time)
Definition Check.cc:145
void changeAddress(Addr address)
Definition Check.cc:363
Addr m_pc
Definition Check.hh:83
ruby::RubyAccessMode m_access_mode
Definition Check.hh:84
void pickInitiatingNode()
Definition Check.cc:382
void print(std::ostream &out) const
Definition Check.cc:394
void initiatePrefetch(Cycles current_time)
Definition Check.cc:86
int m_store_count
Definition Check.hh:80
Addr getAddress() const
Definition Check.hh:62
Random::RandomPtr rng
Definition Check.hh:88
void performCallback(ruby::NodeID proc, ruby::SubBlock *data, Cycles curTime)
Definition Check.cc:296
void pickValue()
Definition Check.cc:374
void initiate(Cycles current_time)
Definition Check.cc:58
Addr m_address
Definition Check.hh:82
void initiateCheck(Cycles current_time)
Definition Check.cc:240
RubyTester * m_tester_ptr
Definition Check.hh:87
ruby::NodeID m_initiatingNode
Definition Check.hh:81
void debugPrint()
Definition Check.cc:406
ruby::TesterStatus m_status
Definition Check.hh:78
uint8_t m_value
Definition Check.hh:79
Check(Addr address, Addr pc, int _num_writers, int _num_readers, RubyTester *_tester)
Definition Check.cc:41
int m_num_writers
Definition Check.hh:85
void initiateAction(Cycles current_time)
Definition Check.cc:177
int m_num_readers
Definition Check.hh:86
Cycles is a wrapper class for representing cycle counts, i.e.
Definition types.hh:79
static RandomPtr genRandom(Random *r=nullptr)
Definition random.hh:68
std::shared_ptr< Random > RandomPtr
Definition random.hh:65
Bitfield< 4 > pc
unsigned int NodeID
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
const int CHECK_SIZE_BITS
Definition Check.hh:49
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
const int CHECK_SIZE
Definition Check.hh:50
static std::ostream & operator<<(std::ostream &os, const DummyMatRegContainer &d)
Definition matrix.hh:564
const int CACHE_LINE_BITS
Definition Check.hh:51

Generated on Mon May 26 2025 09:19:08 for gem5 by doxygen 1.13.2