elastic_trace.hh (12085:de78ea63e0ca) | elastic_trace.hh (13429:a1e199fd8122) |
---|---|
1/* 2 * Copyright (c) 2013 - 2015 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 --- 76 unchanged lines hidden (view full) --- 85 * 86 * The output trace can be read in and played back by the TraceCPU. 87 */ 88class ElasticTrace : public ProbeListenerObject 89{ 90 91 public: 92 typedef typename O3CPUImpl::DynInstPtr DynInstPtr; | 1/* 2 * Copyright (c) 2013 - 2015 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 --- 76 unchanged lines hidden (view full) --- 85 * 86 * The output trace can be read in and played back by the TraceCPU. 87 */ 88class ElasticTrace : public ProbeListenerObject 89{ 90 91 public: 92 typedef typename O3CPUImpl::DynInstPtr DynInstPtr; |
93 typedef typename O3CPUImpl::DynInstConstPtr DynInstConstPtr; |
|
93 typedef typename std::pair<InstSeqNum, PhysRegIndex> SeqNumRegPair; 94 95 /** Trace record types corresponding to instruction node types */ 96 typedef ProtoMessage::InstDepRecord::RecordType RecordType; 97 typedef ProtoMessage::InstDepRecord Record; 98 99 /** Constructor */ 100 ElasticTrace(const ElasticTraceParams *params); --- 26 unchanged lines hidden (view full) --- 127 void fetchReqTrace(const RequestPtr &req); 128 129 /** 130 * Populate the execute timestamp field in an InstExecInfo object for an 131 * instruction in flight. 132 * 133 * @param dyn_inst pointer to dynamic instruction in flight 134 */ | 94 typedef typename std::pair<InstSeqNum, PhysRegIndex> SeqNumRegPair; 95 96 /** Trace record types corresponding to instruction node types */ 97 typedef ProtoMessage::InstDepRecord::RecordType RecordType; 98 typedef ProtoMessage::InstDepRecord Record; 99 100 /** Constructor */ 101 ElasticTrace(const ElasticTraceParams *params); --- 26 unchanged lines hidden (view full) --- 128 void fetchReqTrace(const RequestPtr &req); 129 130 /** 131 * Populate the execute timestamp field in an InstExecInfo object for an 132 * instruction in flight. 133 * 134 * @param dyn_inst pointer to dynamic instruction in flight 135 */ |
135 void recordExecTick(const DynInstPtr &dyn_inst); | 136 void recordExecTick(const DynInstConstPtr& dyn_inst); |
136 137 /** 138 * Populate the timestamp field in an InstExecInfo object for an 139 * instruction in flight when it is execution is complete and it is ready 140 * to commit. 141 * 142 * @param dyn_inst pointer to dynamic instruction in flight 143 */ | 137 138 /** 139 * Populate the timestamp field in an InstExecInfo object for an 140 * instruction in flight when it is execution is complete and it is ready 141 * to commit. 142 * 143 * @param dyn_inst pointer to dynamic instruction in flight 144 */ |
144 void recordToCommTick(const DynInstPtr &dyn_inst); | 145 void recordToCommTick(const DynInstConstPtr& dyn_inst); |
145 146 /** 147 * Record a Read After Write physical register dependency if there has 148 * been a write to the source register and update the physical register 149 * map. For this look up the physRegDepMap with this instruction as the 150 * writer of its destination register. If the dependency falls outside the 151 * window it is assumed as already complete. Duplicate entries are avoided. 152 * 153 * @param dyn_inst pointer to dynamic instruction in flight 154 */ | 146 147 /** 148 * Record a Read After Write physical register dependency if there has 149 * been a write to the source register and update the physical register 150 * map. For this look up the physRegDepMap with this instruction as the 151 * writer of its destination register. If the dependency falls outside the 152 * window it is assumed as already complete. Duplicate entries are avoided. 153 * 154 * @param dyn_inst pointer to dynamic instruction in flight 155 */ |
155 void updateRegDep(const DynInstPtr &dyn_inst); | 156 void updateRegDep(const DynInstConstPtr& dyn_inst); |
156 157 /** 158 * When an instruction gets squashed the destination register mapped to it 159 * is freed up in the rename stage. Remove the register entry from the 160 * physRegDepMap as well to avoid dependencies on squashed instructions. 161 * 162 * @param inst_reg_pair pair of inst. sequence no. and the register 163 */ 164 void removeRegDepMapEntry(const SeqNumRegPair &inst_reg_pair); 165 166 /** 167 * Add an instruction that is at the head of the ROB and is squashed only 168 * if it is a load and a request was sent for it. 169 * 170 * @param head_inst pointer to dynamic instruction to be squashed 171 */ | 157 158 /** 159 * When an instruction gets squashed the destination register mapped to it 160 * is freed up in the rename stage. Remove the register entry from the 161 * physRegDepMap as well to avoid dependencies on squashed instructions. 162 * 163 * @param inst_reg_pair pair of inst. sequence no. and the register 164 */ 165 void removeRegDepMapEntry(const SeqNumRegPair &inst_reg_pair); 166 167 /** 168 * Add an instruction that is at the head of the ROB and is squashed only 169 * if it is a load and a request was sent for it. 170 * 171 * @param head_inst pointer to dynamic instruction to be squashed 172 */ |
172 void addSquashedInst(const DynInstPtr &head_inst); | 173 void addSquashedInst(const DynInstConstPtr& head_inst); |
173 174 /** 175 * Add an instruction that is at the head of the ROB and is committed. 176 * 177 * @param head_inst pointer to dynamic instruction to be committed 178 */ | 174 175 /** 176 * Add an instruction that is at the head of the ROB and is committed. 177 * 178 * @param head_inst pointer to dynamic instruction to be committed 179 */ |
179 void addCommittedInst(const DynInstPtr &head_inst); | 180 void addCommittedInst(const DynInstConstPtr& head_inst); |
180 181 /** Register statistics for the elastic trace. */ 182 void regStats(); 183 184 /** Event to trigger registering this listener for all probe points. */ 185 EventFunctionWrapper regEtraceListenersEvent; 186 187 private: --- 192 unchanged lines hidden (view full) --- 380 * container. A record is inserted per committed instruction and in the same 381 * order as the order in which instructions are committed. 382 * 383 * @param head_inst Pointer to the instruction which is head of the 384 * ROB and ready to commit 385 * @param exec_info_ptr Pointer to InstExecInfo for that instruction 386 * @param commit True if instruction is committed, false if squashed 387 */ | 181 182 /** Register statistics for the elastic trace. */ 183 void regStats(); 184 185 /** Event to trigger registering this listener for all probe points. */ 186 EventFunctionWrapper regEtraceListenersEvent; 187 188 private: --- 192 unchanged lines hidden (view full) --- 381 * container. A record is inserted per committed instruction and in the same 382 * order as the order in which instructions are committed. 383 * 384 * @param head_inst Pointer to the instruction which is head of the 385 * ROB and ready to commit 386 * @param exec_info_ptr Pointer to InstExecInfo for that instruction 387 * @param commit True if instruction is committed, false if squashed 388 */ |
388 void addDepTraceRecord(const DynInstPtr &head_inst, | 389 void addDepTraceRecord(const DynInstConstPtr& head_inst, |
389 InstExecInfo* exec_info_ptr, bool commit); 390 391 /** 392 * Clear entries in the temporary store of execution info objects to free 393 * allocated memory until the present instruction being added to the trace. 394 * 395 * @param head_inst pointer to dynamic instruction 396 */ | 390 InstExecInfo* exec_info_ptr, bool commit); 391 392 /** 393 * Clear entries in the temporary store of execution info objects to free 394 * allocated memory until the present instruction being added to the trace. 395 * 396 * @param head_inst pointer to dynamic instruction 397 */ |
397 void clearTempStoreUntil(const DynInstPtr head_inst); | 398 void clearTempStoreUntil(const DynInstConstPtr& head_inst); |
398 399 /** 400 * Calculate the computational delay between an instruction and a 401 * subsequent instruction that has an ROB (order) dependency on it 402 * 403 * @param past_record Pointer to instruction 404 * 405 * @param new_record Pointer to subsequent instruction having an ROB --- 156 unchanged lines hidden --- | 399 400 /** 401 * Calculate the computational delay between an instruction and a 402 * subsequent instruction that has an ROB (order) dependency on it 403 * 404 * @param past_record Pointer to instruction 405 * 406 * @param new_record Pointer to subsequent instruction having an ROB --- 156 unchanged lines hidden --- |