From 43d833246fcfe092a0c08dde1fdf7e3d409d1af9 Mon Sep 17 00:00:00 2001 From: Nathanael Premillieu Date: Wed, 5 Apr 2017 12:46:06 -0500 Subject: cpu: Physical register structural + flat indexing Mimic the changes done on the architectural register indexes on the physical register indexes. This is specific to the O3 model. The structure, called PhysRegId, contains a register class, a register index and a flat register index. The flat register index is kept because it is useful in some cases where the type of register is not important (dependency graph and scoreboard for example). Instead of directly using the structure, most of the code is working with a const PhysRegId* (typedef to PhysRegIdPtr). The actual PhysRegId objects are stored in the regFile. Change-Id: Ic879a3cc608aa2f34e2168280faac1846de77667 Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/2701 Reviewed-by: Anthony Gutierrez Maintainer: Andreas Sandberg --- src/cpu/o3/probe/elastic_trace.cc | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) (limited to 'src/cpu/o3/probe/elastic_trace.cc') diff --git a/src/cpu/o3/probe/elastic_trace.cc b/src/cpu/o3/probe/elastic_trace.cc index 05b16805f..76f7e439a 100644 --- a/src/cpu/o3/probe/elastic_trace.cc +++ b/src/cpu/o3/probe/elastic_trace.cc @@ -239,10 +239,11 @@ ElasticTrace::updateRegDep(const DynInstPtr &dyn_inst) int8_t max_regs = dyn_inst->numSrcRegs(); for (int src_idx = 0; src_idx < max_regs; src_idx++) { // Get the physical register index of the i'th source register. - PhysRegIndex src_reg = dyn_inst->renamedSrcRegIdx(src_idx); - DPRINTFR(ElasticTrace, "[sn:%lli] Check map for src reg %i\n", seq_num, - src_reg); - auto itr_last_writer = physRegDepMap.find(src_reg); + PhysRegIdPtr src_reg = dyn_inst->renamedSrcRegIdx(src_idx); + DPRINTFR(ElasticTrace, "[sn:%lli] Check map for src reg" + " %i (%s)\n", seq_num, + src_reg->regIdx, RegClassStrings[src_reg->regClass]); + auto itr_last_writer = physRegDepMap.find(src_reg->flatIdx); if (itr_last_writer != physRegDepMap.end()) { InstSeqNum last_writer = itr_last_writer->second; // Additionally the dependency distance is kept less than the window @@ -267,10 +268,11 @@ ElasticTrace::updateRegDep(const DynInstPtr &dyn_inst) !dest_reg.isZeroReg()) { // Get the physical register index of the i'th destination // register. - PhysRegIndex phys_dest_reg = dyn_inst->renamedDestRegIdx(dest_idx); - DPRINTFR(ElasticTrace, "[sn:%lli] Update map for dest reg %i\n", - seq_num, dest_reg.regIdx); - physRegDepMap[phys_dest_reg] = seq_num; + PhysRegIdPtr phys_dest_reg = dyn_inst->renamedDestRegIdx(dest_idx); + DPRINTFR(ElasticTrace, "[sn:%lli] Update map for dest reg" + " %i (%s)\n", seq_num, dest_reg.regIdx, + RegClassStrings[dest_reg.regClass]); + physRegDepMap[phys_dest_reg->flatIdx] = seq_num; } } maxPhysRegDepMapSize = std::max(physRegDepMap.size(), @@ -281,7 +283,7 @@ void ElasticTrace::removeRegDepMapEntry(const SeqNumRegPair &inst_reg_pair) { DPRINTFR(ElasticTrace, "Remove Map entry for Reg %i\n", - inst_reg_pair.second); + inst_reg_pair.second); auto itr_regdep_map = physRegDepMap.find(inst_reg_pair.second); if (itr_regdep_map != physRegDepMap.end()) physRegDepMap.erase(itr_regdep_map); -- cgit v1.2.3