gem5  v21.1.0.2
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 
46 namespace gem5
47 {
48 
49 namespace ruby
50 {
51 
52 class Sequencer;
53 
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  CacheRecorder();
78 
79  CacheRecorder(uint8_t* uncompressed_trace,
80  uint64_t uncompressed_trace_size,
81  std::vector<Sequencer*>& SequencerMap,
82  uint64_t block_size_bytes);
83  void addRecord(int cntrl, Addr data_addr, Addr pc_addr,
84  RubyRequestType type, Tick time, DataBlock& data);
85 
86  uint64_t aggregateRecords(uint8_t **data, uint64_t size);
87 
97 
106 
107  private:
108  // Private copy constructor and assignment operator
109  CacheRecorder(const CacheRecorder& obj);
111 
116  uint64_t m_bytes_read;
117  uint64_t m_records_read;
120 };
121 
122 inline bool
124 {
125  return n1->m_time > n2->m_time;
126 }
127 
128 inline std::ostream&
129 operator<<(std::ostream& out, const TraceRecord& obj)
130 {
131  obj.print(out);
132  out << std::flush;
133  return out;
134 }
135 
136 } // namespace ruby
137 } // namespace gem5
138 
139 #endif //__MEM_RUBY_SYSTEM_CACHERECORDER_HH__
gem5::ruby::TraceRecord
Class for recording cache contents.
Definition: CacheRecorder.hh:60
gem5::ruby::CacheRecorder::m_records_flushed
uint64_t m_records_flushed
Definition: CacheRecorder.hh:118
data
const char data[]
Definition: circlebuf.test.cc:48
gem5::ruby::CacheRecorder::m_seq_map
std::vector< Sequencer * > m_seq_map
Definition: CacheRecorder.hh:115
gem5::ruby::operator<<
std::ostream & operator<<(std::ostream &os, const BoolVec &myvector)
Definition: BoolVec.cc:49
gem5::ruby::TraceRecord::m_data
uint8_t m_data[0]
Definition: CacheRecorder.hh:68
gem5::ruby::CacheRecorder::m_records
std::vector< TraceRecord * > m_records
Definition: CacheRecorder.hh:112
gem5::ruby::CacheRecorder::m_block_size_bytes
uint64_t m_block_size_bytes
Definition: CacheRecorder.hh:119
gem5::ruby::CacheRecorder::enqueueNextFlushRequest
void enqueueNextFlushRequest()
Function for flushing the memory contents of the caches to the main memory.
Definition: CacheRecorder.cc:87
std::vector
STL vector class.
Definition: stl.hh:37
gem5::ruby::CacheRecorder::operator=
CacheRecorder & operator=(const CacheRecorder &obj)
gem5::ruby::CacheRecorder::m_bytes_read
uint64_t m_bytes_read
Definition: CacheRecorder.hh:116
gem5::ruby::CacheRecorder::aggregateRecords
uint64_t aggregateRecords(uint8_t **data, uint64_t size)
Definition: CacheRecorder.cc:175
gem5::ruby::CacheRecorder::enqueueNextFetchRequest
void enqueueNextFetchRequest()
Function for fetching warming up the memory and the caches.
Definition: CacheRecorder.cc:109
gem5::ruby::TraceRecord::print
void print(std::ostream &out) const
Definition: CacheRecorder.cc:43
gem5::ruby::CacheRecorder::CacheRecorder
CacheRecorder()
Definition: CacheRecorder.cc:50
gem5::ruby::CacheRecorder::m_uncompressed_trace
uint8_t * m_uncompressed_trace
Definition: CacheRecorder.hh:113
gem5::ruby::TraceRecord::m_cntrl_id
int m_cntrl_id
Definition: CacheRecorder.hh:63
DataBlock.hh
TypeDefines.hh
gem5::Tick
uint64_t Tick
Tick count type.
Definition: types.hh:58
gem5::X86ISA::type
type
Definition: misc.hh:733
gem5::ruby::TraceRecord::m_time
Tick m_time
Definition: CacheRecorder.hh:64
gem5::ruby::TraceRecord::m_pc_address
Addr m_pc_address
Definition: CacheRecorder.hh:66
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::ruby::TraceRecord::m_data_address
Addr m_data_address
Definition: CacheRecorder.hh:65
gem5::ruby::CacheRecorder::addRecord
void addRecord(int cntrl, Addr data_addr, Addr pc_addr, RubyRequestType type, Tick time, DataBlock &data)
Definition: CacheRecorder.cc:158
gem5::ruby::TraceRecord::m_type
RubyRequestType m_type
Definition: CacheRecorder.hh:67
Address.hh
types.hh
gem5::ruby::CacheRecorder::~CacheRecorder
~CacheRecorder()
Definition: CacheRecorder.cc:77
gem5::ruby::DataBlock
Definition: DataBlock.hh:60
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: decoder.cc:40
gem5::ruby::compareTraceRecords
bool compareTraceRecords(const TraceRecord *n1, const TraceRecord *n2)
Definition: CacheRecorder.hh:123
gem5::ruby::CacheRecorder
Definition: CacheRecorder.hh:73
gem5::ruby::CacheRecorder::m_uncompressed_trace_size
uint64_t m_uncompressed_trace_size
Definition: CacheRecorder.hh:114
gem5::ruby::CacheRecorder::m_records_read
uint64_t m_records_read
Definition: CacheRecorder.hh:117

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