ChampSim
stats_printer.h
Go to the documentation of this file.
1 /*
2  * Copyright 2023 The ChampSim Contributors
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #include <iostream>
18 #include <vector>
19 
20 #include "cache.h"
21 #include "dram_controller.h"
22 #include "ooo_cpu.h"
23 #include "phase_info.h"
24 
25 namespace champsim
26 {
28 {
29  std::ostream& stream;
30 
34 
35  template <typename T>
36  void print(std::vector<T> stats_list)
37  {
38  for (auto& stats : stats_list)
39  print(stats);
40  }
41 
42 public:
43  plain_printer(std::ostream& str) : stream(str) {}
44  void print(phase_stats& stats);
45  void print(std::vector<phase_stats>& stats);
46 };
47 
49 {
50  std::ostream& stream;
51 
52 public:
53  json_printer(std::ostream& str) : stream(str) {}
54  void print(std::vector<phase_stats>& stats);
55 };
56 } // namespace champsim
Definition: stats_printer.h:49
std::ostream & stream
Definition: stats_printer.h:50
void print(std::vector< phase_stats > &stats)
Definition: json_printer.cc:95
json_printer(std::ostream &str)
Definition: stats_printer.h:53
Definition: stats_printer.h:28
plain_printer(std::ostream &str)
Definition: stats_printer.h:43
std::ostream & stream
Definition: stats_printer.h:29
void print(std::vector< T > stats_list)
Definition: stats_printer.h:36
void print(O3_CPU::stats_type)
Definition: plain_printer.cc:26
Definition: champsim.h:24
Definition: cache.h:40
Definition: phase_info.h:41
Definition: ooo_cpu.h:64
Definition: dram_controller.h:30