gem5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
trace_cpu.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013 - 2016 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  *
37  * Authors: Radhika Jagtap
38  * Andreas Hansson
39  * Thomas Grass
40  */
41 
42 #ifndef __CPU_TRACE_TRACE_CPU_HH__
43 #define __CPU_TRACE_TRACE_CPU_HH__
44 
45 #include <array>
46 #include <cstdint>
47 #include <queue>
48 #include <set>
49 #include <unordered_map>
50 
51 #include "arch/registers.hh"
52 #include "base/statistics.hh"
53 #include "cpu/base.hh"
54 #include "debug/TraceCPUData.hh"
55 #include "debug/TraceCPUInst.hh"
56 #include "params/TraceCPU.hh"
57 #include "proto/inst_dep_record.pb.h"
58 #include "proto/packet.pb.h"
59 #include "proto/protoio.hh"
60 #include "sim/sim_events.hh"
61 
144 class TraceCPU : public BaseCPU
145 {
146 
147  public:
148  TraceCPU(TraceCPUParams *params);
149  ~TraceCPU();
150 
151  void init();
152 
161  {
162  return 0;
163  }
164 
172  {
173  return numOps.value();
174  }
175 
176  /*
177  * Set the no. of ops when elastic data generator completes executing a
178  * node.
179  */
180  void updateNumOps(uint64_t rob_num);
181 
182  /* Pure virtual function in BaseCPU. Do nothing. */
183  void wakeup(ThreadID tid = 0)
184  {
185  return;
186  }
187 
188  /*
189  * When resuming from checkpoint in FS mode, the TraceCPU takes over from
190  * the old cpu. This function overrides the takeOverFrom() function in the
191  * BaseCPU. It unbinds the ports of the old CPU and binds the ports of the
192  * TraceCPU.
193  */
194  void takeOverFrom(BaseCPU *oldCPU);
195 
200  void icacheRetryRecvd();
201 
206  void dcacheRetryRecvd();
207 
215 
221  void schedDcacheNextEvent(Tick when);
222 
223  protected:
224 
228  class IcachePort : public MasterPort
229  {
230  public:
233  : MasterPort(_cpu->name() + ".icache_port", _cpu),
234  owner(_cpu)
235  { }
236 
237  public:
246  bool recvTimingResp(PacketPtr pkt);
247 
254 
259  void recvReqRetry();
260 
261  private:
263  };
264 
268  class DcachePort : public MasterPort
269  {
270 
271  public:
274  : MasterPort(_cpu->name() + ".dcache_port", _cpu),
275  owner(_cpu)
276  { }
277 
278  public:
279 
287  bool recvTimingResp(PacketPtr pkt);
288 
295  { }
296 
303  { }
304 
309  void recvReqRetry();
310 
316  bool isSnooping() const { return true; }
317 
318  private:
320  };
321 
324 
327 
330 
333 
336 
344  {
345 
346  private:
347 
351  struct TraceElement {
352 
355 
358 
361 
364 
367 
370 
376  bool isValid() const {
377  return cmd != MemCmd::InvalidCmd;
378  }
379 
383  void clear() {
385  }
386  };
387 
394  {
395 
396  private:
397 
398  // Input file stream for the protobuf trace
400 
401  public:
402 
408  InputStream(const std::string& filename);
409 
414  void reset();
415 
424  bool read(TraceElement* element);
425  };
426 
427  public:
428  /* Constructor */
429  FixedRetryGen(TraceCPU& _owner, const std::string& _name,
430  MasterPort& _port, MasterID master_id,
431  const std::string& trace_file)
432  : owner(_owner),
433  port(_port),
434  masterID(master_id),
435  trace(trace_file),
436  genName(owner.name() + ".fixedretry" + _name),
437  retryPkt(nullptr),
438  delta(0),
439  traceComplete(false)
440  {
441  }
442 
449  Tick init();
450 
457  bool tryNext();
458 
460  const std::string& name() const { return genName; }
461 
475  bool send(Addr addr, unsigned size, const MemCmd& cmd,
476  Request::FlagsType flags, Addr pc);
477 
479  void exit();
480 
488  bool nextExecute();
489 
496  bool isTraceComplete() { return traceComplete; }
497 
498  int64_t tickDelta() { return delta; }
499 
500  void regStats();
501 
502  private:
503 
506 
509 
512 
515 
517  std::string genName;
518 
521 
527  int64_t delta;
528 
533 
536 
544 
545  };
546 
559  {
560 
561  private:
562 
564  typedef uint64_t NodeSeqNum;
565 
567  typedef uint64_t NodeRobNum;
568 
569  typedef ProtoMessage::InstDepRecord::RecordType RecordType;
570  typedef ProtoMessage::InstDepRecord Record;
571 
578  class GraphNode {
579 
580  public:
586  static const uint8_t maxRobDep = 2;
587 
589  typedef std::array<NodeSeqNum, maxRobDep> RobDepArray;
590 
592  typedef std::array<NodeSeqNum, TheISA::MaxInstSrcRegs> RegDepArray;
593 
596 
599 
602 
605 
608 
610  uint32_t asid;
611 
613  uint32_t size;
614 
617 
620 
623 
625  uint8_t numRobDep;
626 
628  uint64_t compDelay;
629 
635 
637  uint8_t numRegDep;
638 
645 
647  bool isLoad() const { return (type == Record::LOAD); }
648 
650  bool isStore() const { return (type == Record::STORE); }
651 
653  bool isComp() const { return (type == Record::COMP); }
654 
656  void clearRegDep();
657 
659  void clearRobDep();
660 
662  bool removeRegDep(NodeSeqNum reg_dep);
663 
665  bool removeRobDep(NodeSeqNum rob_dep);
666 
668  bool removeDepOnInst(NodeSeqNum done_seq_num);
669 
671  bool isStrictlyOrdered() const {
673  }
678  void writeElementAsTrace() const;
679 
681  std::string typeToStr() const;
682  };
683 
685  struct ReadyNode
686  {
689 
692  };
693 
700  {
701  public:
709  HardwareResource(uint16_t max_rob, uint16_t max_stores,
710  uint16_t max_loads);
711 
717  void occupy(const GraphNode* new_node);
718 
724  void release(const GraphNode* done_node);
725 
727  void releaseStoreBuffer();
728 
735  bool isAvailable(const GraphNode* new_node) const;
736 
744  bool awaitingResponse() const;
745 
747  void printOccupancy();
748 
749  private:
754  const uint16_t sizeROB;
755 
760  const uint16_t sizeStoreBuffer;
761 
766  const uint16_t sizeLoadBuffer;
767 
778  std::map<NodeSeqNum, NodeRobNum> inFlightNodes;
779 
782 
785 
788  };
789 
796  {
797 
798  private:
799 
802 
809  const double timeMultiplier;
810 
812  uint64_t microOpCount;
813 
818  uint32_t windowSize;
819  public:
820 
827  InputStream(const std::string& filename,
828  const double time_multiplier);
829 
834  void reset();
835 
845  bool read(GraphNode* element);
846 
848  uint32_t getWindowSize() const { return windowSize; }
849 
851  uint64_t getMicroOpCount() const { return microOpCount; }
852  };
853 
854  public:
855  /* Constructor */
856  ElasticDataGen(TraceCPU& _owner, const std::string& _name,
857  MasterPort& _port, MasterID master_id,
858  const std::string& trace_file, TraceCPUParams *params)
859  : owner(_owner),
860  port(_port),
861  masterID(master_id),
862  trace(trace_file, 1.0 / params->freqMultiplier),
863  genName(owner.name() + ".elastic" + _name),
864  retryPkt(nullptr),
865  traceComplete(false),
866  nextRead(false),
867  execComplete(false),
868  windowSize(trace.getWindowSize()),
869  hwResource(params->sizeROB, params->sizeStoreBuffer,
870  params->sizeLoadBuffer)
871  {
872  DPRINTF(TraceCPUData, "Window size in the trace is %d.\n",
873  windowSize);
874  }
875 
882  Tick init();
883 
891 
893  const std::string& name() const { return genName; }
894 
896  void exit();
897 
905  bool readNextWindow();
906 
917  template<typename T> void addDepsOnParent(GraphNode *new_node,
918  T& dep_array,
919  uint8_t& num_dep);
920 
930  void execute();
931 
942  PacketPtr executeMemReq(GraphNode* node_ptr);
943 
951  void addToSortedReadyList(NodeSeqNum seq_num, Tick exec_tick);
952 
954  void printReadyList();
955 
961  void completeMemAccess(PacketPtr pkt);
962 
969  bool isExecComplete() const { return execComplete; }
970 
981  bool checkAndIssue(const GraphNode* node_ptr, bool first = true);
982 
984  uint64_t getMicroOpCount() const { return trace.getMicroOpCount(); }
985 
986  void regStats();
987 
988  private:
989 
992 
995 
998 
1001 
1003  std::string genName;
1004 
1007 
1010 
1012  bool nextRead;
1013 
1016 
1026  const uint32_t windowSize;
1027 
1033 
1035  std::unordered_map<NodeSeqNum, GraphNode*> depGraph;
1036 
1044  std::queue<const GraphNode*> depFreeQueue;
1045 
1048 
1061  };
1062 
1065 
1068 
1075  void schedIcacheNext();
1076 
1082  void schedDcacheNext();
1083 
1086 
1089 
1091  void checkAndSchedExitEvent();
1092 
1095 
1103 
1110  static int numTraceCPUs;
1111 
1118 
1123  const bool enableEarlyExit;
1124 
1129  const uint64_t progressMsgInterval;
1130 
1131  /*
1132  * The progress msg threshold is kept updated to the next multiple of the
1133  * progress msg interval. As soon as the threshold is reached, an info
1134  * message is printed.
1135  */
1137 
1140 
1145 
1146  public:
1147 
1150 
1153 
1154  void regStats();
1155 };
1156 #endif // __CPU_TRACE_TRACE_CPU_HH__
A MasterPort is a specialisation of a BaseMasterPort, which implements the default protocol for the t...
Definition: port.hh:167
InputStream trace
Input stream used for reading the input trace file.
Definition: trace_cpu.hh:1000
void execute()
This is the main execute function which consumes nodes from the sorted readyList. ...
Definition: trace_cpu.cc:440
Struct to store a ready-to-execute node and its execution tick.
Definition: trace_cpu.hh:685
Counter value() const
Return the current value of this stat as its base type.
Definition: statistics.hh:677
void schedDcacheNext()
This is the control flow that uses the functionality of the dcacheGen to replay the trace...
Definition: trace_cpu.cc:191
MasterPort & getDataPort()
Used to get a reference to the dcache port.
Definition: trace_cpu.hh:1152
#define DPRINTF(x,...)
Definition: trace.hh:212
Stats::Scalar maxReadyListSize
Definition: trace_cpu.hh:1051
The HardwareResource class models structures that hold the in-flight nodes.
Definition: trace_cpu.hh:699
const uint16_t sizeStoreBuffer
The size of store buffer.
Definition: trace_cpu.hh:760
std::string genName
String to store the name of the FixedRetryGen.
Definition: trace_cpu.hh:1003
const uint64_t progressMsgInterval
Interval of committed instructions specified by the user at which a progress info message is printed...
Definition: trace_cpu.hh:1129
bool send(Addr addr, unsigned size, const MemCmd &cmd, Request::FlagsType flags, Addr pc)
Creates a new request assigning the request parameters passed by the arguments.
Definition: trace_cpu.cc:1156
Addr blocksize
The size of the access for the request.
Definition: trace_cpu.hh:360
Stats::Scalar dataLastTick
Tick when ElasticDataGen completes execution.
Definition: trace_cpu.hh:1060
IcachePort icachePort
Port to connect to L1 instruction cache.
Definition: trace_cpu.hh:323
TraceCPU & owner
Reference of the TraceCPU.
Definition: trace_cpu.hh:991
NodeSeqNum seqNum
The sequence number of the ready node.
Definition: trace_cpu.hh:688
void exit()
Exit the FixedRetryGen.
Definition: trace_cpu.cc:1119
Definition: packet.hh:73
void recvReqRetry()
Handle a retry signalled by the cache if data access failed in the first attempt. ...
Definition: trace_cpu.cc:1262
uint32_t windowSize
The window size that is read from the header of the protobuf trace and used to process the dependency...
Definition: trace_cpu.hh:818
bool isComp() const
Is the node a compute (non load/store) node.
Definition: trace_cpu.hh:653
bool isTraceComplete()
Returns the traceComplete variable which is set when end of the input trace file is reached...
Definition: trace_cpu.hh:496
ProtoMessage::InstDepRecord::RecordType RecordType
Definition: trace_cpu.hh:569
void recvTimingSnoopReq(PacketPtr pkt)
Required functionally but do nothing.
Definition: trace_cpu.hh:253
bool removeRegDep(NodeSeqNum reg_dep)
Remove completed instruction from register dependency array.
Definition: trace_cpu.cc:1377
std::list< ReadyNode > readyList
List of nodes that are ready to execute.
Definition: trace_cpu.hh:1047
uint16_t numInFlightStores
Number of ready stores for which request may or may not be sent.
Definition: trace_cpu.hh:787
Request::Flags flags
Request flags if any.
Definition: trace_cpu.hh:616
RecordType type
Type of the node corresponding to the instruction modelled by it.
Definition: trace_cpu.hh:601
PacketPtr retryPkt
PacketPtr used to store the packet to retry.
Definition: trace_cpu.hh:1006
Stats::Scalar numSchedIcacheEvent
Definition: trace_cpu.hh:1139
uint32_t FlagsType
Definition: request.hh:90
bool nextExecute()
Reads a line of the trace file.
Definition: trace_cpu.cc:1125
const std::string name() const
Return port name (for DPRINTF).
Definition: port.hh:99
void updateNumOps(uint64_t rob_num)
Definition: trace_cpu.cc:96
~TraceCPU()
Definition: trace_cpu.cc:84
HardwareResource(uint16_t max_rob, uint16_t max_stores, uint16_t max_loads)
Constructor that initializes the sizes of the structures.
Definition: trace_cpu.cc:887
PacketPtr executeMemReq(GraphNode *node_ptr)
Creates a new request for a load or store assigning the request parameters.
Definition: trace_cpu.cc:634
Request::FlagsType flags
Potential request flags to use.
Definition: trace_cpu.hh:366
Stats::Scalar numSOStores
Definition: trace_cpu.hh:1058
void completeMemAccess(PacketPtr pkt)
When a load writeback is received, that is when the load completes, release the dependents on it...
Definition: trace_cpu.cc:746
ip6_addr_t addr
Definition: inet.hh:335
std::map< NodeSeqNum, NodeRobNum > inFlightNodes
A map from the sequence number to the ROB number of the in- flight nodes.
Definition: trace_cpu.hh:778
void init()
Definition: trace_cpu.cc:123
Tick traceOffset
This stores the time offset in the trace, which is taken away from the ready times of requests...
Definition: trace_cpu.hh:1102
std::string instTraceFile
File names for input instruction and data traces.
Definition: trace_cpu.hh:335
ProtoMessage::InstDepRecord Record
Definition: trace_cpu.hh:570
void exit()
Exit the ElasticDataGen.
Definition: trace_cpu.cc:351
bool isSet() const
Definition: flags.hh:62
void regStats()
Definition: trace_cpu.cc:226
uint32_t asid
The address space id which is set if the virtual address is set.
Definition: trace_cpu.hh:610
static const uint8_t maxRobDep
The maximum no.
Definition: trace_cpu.hh:586
bool recvTimingResp(PacketPtr pkt)
Receive the timing reponse and simply delete the packet since instruction fetch requests are issued a...
Definition: trace_cpu.cc:1224
const uint16_t sizeROB
The size of the ROB used to throttle the max.
Definition: trace_cpu.hh:754
void checkAndSchedExitEvent()
This is called when either generator finishes executing from the trace.
Definition: trace_cpu.cc:205
bool oneTraceComplete
Set to true when one of the generators finishes replaying its trace.
Definition: trace_cpu.hh:1094
Stats::Scalar numRetrySucceeded
Definition: trace_cpu.hh:541
uint64_t getMicroOpCount() const
Get number of micro-ops modelled in the TraceCPU replay.
Definition: trace_cpu.hh:851
PacketPtr retryPkt
PacketPtr used to store the packet to retry.
Definition: trace_cpu.hh:520
void schedIcacheNext()
This is the control flow that uses the functionality of the icacheGen to replay the trace...
Definition: trace_cpu.cc:166
Stats::Scalar numSchedDcacheEvent
Definition: trace_cpu.hh:1138
MemCmd cmd
Specifies if the request is to be a read or a write.
Definition: trace_cpu.hh:354
Bitfield< 23, 0 > offset
Definition: types.hh:149
MasterPort & port
Reference of the port to be used to issue memory requests.
Definition: trace_cpu.hh:508
void clearRobDep()
Initialize register dependency array to all zeroes.
Definition: trace_cpu.cc:1421
DcachePort(TraceCPU *_cpu)
Default constructor.
Definition: trace_cpu.hh:273
uint64_t NodeSeqNum
Node sequence number type.
Definition: trace_cpu.hh:564
bool readNextWindow()
Reads a line of the trace file.
Definition: trace_cpu.cc:357
void reset()
Reset the stream such that it can be played once again.
Definition: trace_cpu.cc:1291
Stats::Scalar maxDependents
Stats for data memory accesses replayed.
Definition: trace_cpu.hh:1050
uint8_t numRegDep
Number of register dependencies.
Definition: trace_cpu.hh:637
bool execComplete
Set true when execution of trace is complete.
Definition: trace_cpu.hh:1015
void addDepsOnParent(GraphNode *new_node, T &dep_array, uint8_t &num_dep)
Iterate over the dependencies of a new node and add the new node to the list of dependents of the par...
Definition: trace_cpu.cc:410
Stats::Scalar numSendSucceeded
Definition: trace_cpu.hh:1053
void reset()
Reset the stream such that it can be played once again.
Definition: trace_cpu.cc:1498
Stats::Scalar numSendAttempted
Stats for instruction accesses replayed.
Definition: trace_cpu.hh:538
EventWrapper< TraceCPU,&TraceCPU::schedIcacheNext > icacheNextEvent
Event for the control flow method schedIcacheNext()
Definition: trace_cpu.hh:1085
Declaration of Statistics objects.
The InputStream encapsulates a trace file and the internal buffers and populates TraceElements based ...
Definition: trace_cpu.hh:393
bool traceComplete
Set to true when end of trace is reached.
Definition: trace_cpu.hh:1009
const std::string & name() const
Returns name of the FixedRetryGen instance.
Definition: trace_cpu.hh:460
Tick init()
Called from TraceCPU init().
Definition: trace_cpu.cc:314
This is a simple scalar statistic, like a counter.
Definition: statistics.hh:2475
void clearRegDep()
Initialize register dependency array to all zeroes.
Definition: trace_cpu.cc:1413
const uint32_t windowSize
Window size within which to check for dependencies.
Definition: trace_cpu.hh:1026
STL vector class.
Definition: stl.hh:40
std::queue< const GraphNode * > depFreeQueue
Queue of dependency-free nodes that are pending issue because resources are not available.
Definition: trace_cpu.hh:1044
uint32_t getWindowSize() const
Get window size from trace.
Definition: trace_cpu.hh:848
bool isAvailable(const GraphNode *new_node) const
Check if structures required to issue a node are free.
Definition: trace_cpu.cc:965
IcachePort(TraceCPU *_cpu)
Default constructor.
Definition: trace_cpu.hh:232
The elastic data memory request generator to read protobuf trace containing execution trace annotated...
Definition: trace_cpu.hh:558
ProtoInputStream trace
Input file stream for the protobuf trace.
Definition: trace_cpu.hh:801
CountedExitEvent * execCompleteEvent
A CountedExitEvent which when serviced decrements the counter.
Definition: trace_cpu.hh:1117
const double timeMultiplier
A multiplier for the compute delays in the trace to modulate the Trace CPU frequency either up or dow...
Definition: trace_cpu.hh:809
uint64_t getMicroOpCount() const
Get number of micro-ops modelled in the TraceCPU replay.
Definition: trace_cpu.hh:984
bool isExecComplete() const
Returns the execComplete variable which is set when the last node is executed.
Definition: trace_cpu.hh:969
The trace cpu replays traces generated using the elastic trace probe attached to the O3 CPU model...
Definition: trace_cpu.hh:144
std::vector< GraphNode * > dependents
A vector of nodes dependent (outgoing) on this node.
Definition: trace_cpu.hh:644
uint64_t progressMsgThreshold
Definition: trace_cpu.hh:1136
NodeRobNum robNum
ROB occupancy number.
Definition: trace_cpu.hh:598
std::array< NodeSeqNum, maxRobDep > RobDepArray
Typedef for the array containing the ROB dependencies.
Definition: trace_cpu.hh:589
bool isStrictlyOrdered() const
Return true if node has a request which is strictly ordered.
Definition: trace_cpu.hh:671
DcachePort dcachePort
Port to connect to L1 data cache.
Definition: trace_cpu.hh:326
TraceCPU(TraceCPUParams *params)
Definition: trace_cpu.cc:49
const MasterID dataMasterID
Master id for data read and write requests.
Definition: trace_cpu.hh:332
uint64_t Tick
Tick count type.
Definition: types.hh:63
A ProtoInputStream wraps a coded stream, potentially with decompression, based on looking at the file...
Definition: protoio.hh:142
const bool enableEarlyExit
Exit when any one Trace CPU completes its execution.
Definition: trace_cpu.hh:1123
Counter totalInsts() const
This is a pure virtual function in BaseCPU.
Definition: trace_cpu.hh:160
void wakeup(ThreadID tid=0)
Definition: trace_cpu.hh:183
int64_t delta
Stores the difference in the send ticks of the current and last packets.
Definition: trace_cpu.hh:527
bool isSnooping() const
Required functionally.
Definition: trace_cpu.hh:316
The struct GraphNode stores an instruction in the trace file.
Definition: trace_cpu.hh:578
bool nextRead
Set to true when the next window of instructions need to be read.
Definition: trace_cpu.hh:1012
const MasterID masterID
MasterID used for the requests being sent.
Definition: trace_cpu.hh:511
bool isValid() const
Check validity of this element.
Definition: trace_cpu.hh:376
This struct stores a line in the trace file.
Definition: trace_cpu.hh:351
The InputStream encapsulates a trace file and the internal buffers and populates GraphNodes based on ...
Definition: trace_cpu.hh:795
Stats::Scalar instLastTick
Last simulated tick by the FixedRetryGen.
Definition: trace_cpu.hh:543
TraceCPU & owner
Reference of the TraceCPU.
Definition: trace_cpu.hh:505
void dcacheRetryRecvd()
When data cache port receives a retry, schedule event dcacheNextEvent.
Definition: trace_cpu.cc:1198
FixedRetryGen icacheGen
Instance of FixedRetryGen to replay instruction read requests.
Definition: trace_cpu.hh:1064
void recvReqRetry()
Handle a retry signalled by the cache if instruction read failed in the first attempt.
Definition: trace_cpu.cc:1235
STL list class.
Definition: stl.hh:54
void writeElementAsTrace() const
Write out element in trace-compatible format using debug flag TraceCPUData.
Definition: trace_cpu.cc:1444
void clear()
Make this element invalid.
Definition: trace_cpu.hh:383
Stats::Scalar numSendFailed
Definition: trace_cpu.hh:540
std::string genName
String to store the name of the FixedRetryGen.
Definition: trace_cpu.hh:517
const std::string & name() const
Returns name of the ElasticDataGen instance.
Definition: trace_cpu.hh:893
Generator to read protobuf trace containing memory requests at fixed timestamps, perform flow control...
Definition: trace_cpu.hh:343
TraceElement currElement
Store an element read from the trace to send as the next packet.
Definition: trace_cpu.hh:535
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
void release(const GraphNode *done_node)
Release appropriate structures for a completed node.
Definition: trace_cpu.cc:917
uint16_t MasterID
Definition: request.hh:85
uint16_t numInFlightLoads
Number of ready loads for which request may or may not be sent.
Definition: trace_cpu.hh:784
uint64_t compDelay
Computational delay.
Definition: trace_cpu.hh:628
MasterPort & port
Reference of the port to be used to issue memory requests.
Definition: trace_cpu.hh:994
static int numTraceCPUs
Number of Trace CPUs in the system used as a shared variable and passed to the CountedExitEvent event...
Definition: trace_cpu.hh:1110
Stats::Formula cpi
Stat for the CPI.
Definition: trace_cpu.hh:1144
int64_t Counter
Statistics counter type.
Definition: types.hh:58
void dcacheRecvTimingResp(PacketPtr pkt)
When data cache port receives a response, this calls the dcache generator method handle to complete t...
Definition: trace_cpu.cc:1241
A Packet is used to encapsulate a transfer between two objects in the memory system (e...
Definition: packet.hh:245
Tick execTick
The tick at which the ready node must be executed.
Definition: trace_cpu.hh:691
NodeRobNum oldestInFlightRobNum
The ROB number of the oldest in-flight node.
Definition: trace_cpu.hh:781
const uint16_t sizeLoadBuffer
The size of load buffer.
Definition: trace_cpu.hh:766
const MasterID instMasterID
Master id for instruction read requests.
Definition: trace_cpu.hh:329
A formula for statistics that is calculated when printed.
Definition: statistics.hh:2895
Stats::Scalar numOps
Stat for number of simulated micro-ops.
Definition: trace_cpu.hh:1142
int16_t ThreadID
Thread index/ID type.
Definition: types.hh:171
bool checkAndIssue(const GraphNode *node_ptr, bool first=true)
Attempts to issue a node once the node's source dependencies are complete.
Definition: trace_cpu.cc:706
const MasterID masterID
MasterID used for the requests being sent.
Definition: trace_cpu.hh:997
Tick tick
The time at which the request should be sent.
Definition: trace_cpu.hh:363
bool recvTimingResp(PacketPtr pkt)
Receive the timing reponse and call dcacheRecvTimingResp() method of the dcacheGen to handle completi...
Definition: trace_cpu.cc:1248
int size()
Definition: pagetable.hh:146
ElasticDataGen(TraceCPU &_owner, const std::string &_name, MasterPort &_port, MasterID master_id, const std::string &trace_file, TraceCPUParams *params)
Definition: trace_cpu.hh:856
uint8_t numRobDep
Number of order dependencies.
Definition: trace_cpu.hh:625
IcachePort class that interfaces with L1 Instruction Cache.
Definition: trace_cpu.hh:228
Stats::Scalar numSendFailed
Definition: trace_cpu.hh:1054
void schedDcacheNextEvent(Tick when)
Schedule event dcacheNextEvent at the given tick.
Definition: trace_cpu.cc:1208
Counter totalOps() const
Return totalOps as the number of committed micro-ops plus the speculatively issued loads that are mod...
Definition: trace_cpu.hh:171
EventWrapper< TraceCPU,&TraceCPU::schedDcacheNext > dcacheNextEvent
Event for the control flow method schedDcacheNext()
Definition: trace_cpu.hh:1088
std::string dataTraceFile
Definition: trace_cpu.hh:335
Stats::Scalar numSendAttempted
Definition: trace_cpu.hh:1052
ElasticDataGen dcacheGen
Instance of ElasticDataGen to replay data read and write requests.
Definition: trace_cpu.hh:1067
FixedRetryGen(TraceCPU &_owner, const std::string &_name, MasterPort &_port, MasterID master_id, const std::string &trace_file)
Definition: trace_cpu.hh:429
bool isLoad() const
Is the node a load.
Definition: trace_cpu.hh:647
Addr virtAddr
The virtual address for the request if any.
Definition: trace_cpu.hh:607
uint32_t size
Size of request if any.
Definition: trace_cpu.hh:613
void printReadyList()
Print readyList for debugging using debug flag TraceCPUData.
Definition: trace_cpu.cc:870
InputStream(const std::string &filename, const double time_multiplier)
Create a trace input stream for a given file name.
Definition: trace_cpu.cc:1267
void releaseStoreBuffer()
Release store buffer entry for a completed store.
Definition: trace_cpu.cc:958
void adjustInitTraceOffset(Tick &offset)
Adjust traceOffset based on what TraceCPU init() determines on comparing the offsets in the fetch req...
Definition: trace_cpu.cc:344
void occupy(const GraphNode *new_node)
Occupy appropriate structures for an issued node.
Definition: trace_cpu.cc:898
The request is required to be strictly ordered by CPU models and is non-speculative.
Definition: request.hh:124
RegDepArray regDep
Array of register dependencies (incoming) if any.
Definition: trace_cpu.hh:634
Stats::Scalar numRetrySucceeded
Definition: trace_cpu.hh:1055
std::string typeToStr() const
Return string specifying the type of the node.
Definition: trace_cpu.cc:1477
Addr addr
The address for the request.
Definition: trace_cpu.hh:357
Tick init()
Called from TraceCPU init().
Definition: trace_cpu.cc:1055
Stats::Scalar numSendSucceeded
Definition: trace_cpu.hh:539
bool isStore() const
Is the node a store.
Definition: trace_cpu.hh:650
void icacheRetryRecvd()
When instruction cache port receives a retry, schedule event icacheNextEvent.
Definition: trace_cpu.cc:1188
std::unordered_map< NodeSeqNum, GraphNode * > depGraph
Store the depGraph of GraphNodes.
Definition: trace_cpu.hh:1035
IntReg pc
Definition: remote_gdb.hh:91
bool traceComplete
Set to true when end of trace is reached.
Definition: trace_cpu.hh:532
Addr physAddr
The address for the request if any.
Definition: trace_cpu.hh:604
std::array< NodeSeqNum, TheISA::MaxInstSrcRegs > RegDepArray
Typedef for the array containing the register dependencies.
Definition: trace_cpu.hh:592
bool awaitingResponse() const
Check if there are any outstanding requests, i.e.
Definition: trace_cpu.cc:1009
Stats::Scalar numSplitReqs
Definition: trace_cpu.hh:1056
void printOccupancy()
Print resource occupancy for debugging.
Definition: trace_cpu.cc:1015
void recvFunctionalSnoop(PacketPtr pkt)
Required functionally but do nothing.
Definition: trace_cpu.hh:302
void addToSortedReadyList(NodeSeqNum seq_num, Tick exec_tick)
Add a ready node to the readyList.
Definition: trace_cpu.cc:813
DcachePort class that interfaces with L1 Data Cache.
Definition: trace_cpu.hh:268
bool read(TraceElement *element)
Attempt to read a trace element from the stream, and also notify the caller if the end of the file wa...
Definition: trace_cpu.cc:1504
RobDepArray robDep
Array of order dependencies.
Definition: trace_cpu.hh:622
void takeOverFrom(BaseCPU *oldCPU)
Definition: trace_cpu.cc:106
void recvTimingSnoopReq(PacketPtr pkt)
Required functionally but do nothing.
Definition: trace_cpu.hh:294
uint64_t NodeRobNum
Node ROB number type.
Definition: trace_cpu.hh:567
bool read(GraphNode *element)
Attempt to read a trace element from the stream, and also notify the caller if the end of the file wa...
Definition: trace_cpu.cc:1297
Declaration of a wrapper for protobuf output streams and input streams.
uint64_t microOpCount
Count of committed ops read from trace plus the filtered ops.
Definition: trace_cpu.hh:812
NodeSeqNum seqNum
Instruction sequence number.
Definition: trace_cpu.hh:595
Stats::Scalar numSOLoads
Definition: trace_cpu.hh:1057
InputStream trace
Input stream used for reading the input trace file.
Definition: trace_cpu.hh:514
bool removeRobDep(NodeSeqNum rob_dep)
Remove completed instruction from order dependency array.
Definition: trace_cpu.cc:1396
HardwareResource hwResource
Hardware resources required to contain in-flight nodes and to throttle issuing of new nodes when reso...
Definition: trace_cpu.hh:1032
bool removeDepOnInst(NodeSeqNum done_seq_num)
Check for all dependencies on completed inst.
Definition: trace_cpu.cc:1429
MasterPort & getInstPort()
Used to get a reference to the icache port.
Definition: trace_cpu.hh:1149
InputStream(const std::string &filename)
Create a trace input stream for a given file name.
Definition: trace_cpu.cc:1482
bool tryNext()
This tries to send current or retry packet and returns true if successfull.
Definition: trace_cpu.cc:1070

Generated on Fri Jun 9 2017 13:03:45 for gem5 by doxygen 1.8.6