gem5 v24.1.0.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
CacheRecorder.hh
Go to the documentation of this file.
1/*
2 * Copyright (c) 1999-2012 Mark D. Hill and David A. Wood
3 * Copyright (c) 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/*
31 * Recording cache requests made to a ruby cache at certain ruby
32 * time. Also dump the requests to a gziped file.
33 */
34
35#ifndef __MEM_RUBY_SYSTEM_CACHERECORDER_HH__
36#define __MEM_RUBY_SYSTEM_CACHERECORDER_HH__
37
38#include <vector>
39
40#include "base/types.hh"
44#include "mem/ruby/protocol/RubyRequestType.hh"
45
46namespace gem5
47{
48
49namespace ruby
50{
51
52class Sequencer;
53class RubyPort;
61{
62 public:
67 RubyRequestType m_type;
68 uint8_t m_data[0];
69
70 void print(std::ostream& out) const;
71};
72
74{
75 public:
76 // Construction requires block size.
77 CacheRecorder() = delete;
78 CacheRecorder(uint8_t* uncompressed_trace,
79 uint64_t uncompressed_trace_size,
80 std::vector<RubyPort*>& ruby_port_map,
81 uint64_t trace_block_size_bytes,
82 uint64_t system_block_size_bytes);
84
85 void addRecord(int cntrl, Addr data_addr, Addr pc_addr,
86 RubyRequestType type, Tick time, DataBlock& data);
87
88 uint64_t aggregateRecords(uint8_t **data, uint64_t size);
89
90 uint64_t getNumRecords() const;
91
101
110
111 private:
112 // Private copy constructor and assignment operator
115
120 uint64_t m_bytes_read;
124};
125
126inline bool
128{
129 return n1->m_time > n2->m_time;
130}
131
132inline std::ostream&
133operator<<(std::ostream& out, const TraceRecord& obj)
134{
135 obj.print(out);
136 out << std::flush;
137 return out;
138}
139
140} // namespace ruby
141} // namespace gem5
142
143#endif //__MEM_RUBY_SYSTEM_CACHERECORDER_HH__
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
const char data[]
uint64_t aggregateRecords(uint8_t **data, uint64_t size)
uint64_t getNumRecords() const
void addRecord(int cntrl, Addr data_addr, Addr pc_addr, RubyRequestType type, Tick time, DataBlock &data)
CacheRecorder & operator=(const CacheRecorder &obj)
std::vector< TraceRecord * > m_records
void enqueueNextFetchRequest()
Function for fetching warming up the memory and the caches.
CacheRecorder(const CacheRecorder &obj)
void enqueueNextFlushRequest()
Function for flushing the memory contents of the caches to the main memory.
std::vector< RubyPort * > m_ruby_port_map
Class for recording cache contents.
void print(std::ostream &out) const
STL vector class.
Definition stl.hh:37
bool compareTraceRecords(const TraceRecord *n1, const TraceRecord *n2)
Copyright (c) 2024 Arm Limited All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
uint64_t Tick
Tick count type.
Definition types.hh:58
std::ostream & operator<<(std::ostream &os, const BaseSemihosting::InPlaceArg &ipa)

Generated on Mon Jan 13 2025 04:28:41 for gem5 by doxygen 1.9.8