1/* 2 * Copyright (c) 2011-2012, 2014 ARM Limited 3 * Copyright (c) 2013 Advanced Micro Devices, Inc. 4 * All rights reserved 5 * 6 * The license below extends only to copyright in the software and shall 7 * not be construed as granting a license to any other intellectual 8 * property including but not limited to intellectual property relating --- 35 unchanged lines hidden (view full) --- 44#ifndef __CPU_O3_LSQ_HH__ 45#define __CPU_O3_LSQ_HH__ 46 47#include <map> 48#include <queue> 49 50#include "cpu/o3/lsq_unit.hh" 51#include "cpu/inst_seq.hh" |
52#include "enums/SMTQueuePolicy.hh" |
53#include "mem/port.hh" 54#include "sim/sim_object.hh" 55 56struct DerivO3CPUParams; 57 58template <class Impl> 59class LSQ { 60 public: 61 typedef typename Impl::O3CPU O3CPU; 62 typedef typename Impl::DynInstPtr DynInstPtr; 63 typedef typename Impl::CPUPol::IEW IEW; 64 typedef typename Impl::CPUPol::LSQUnit LSQUnit; 65 |
66 /** Constructs an LSQ with the given parameters. */ 67 LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params); 68 ~LSQ() { } 69 70 /** Returns the name of the LSQ. */ 71 std::string name() const; 72 73 /** Registers statistics of each LSQ unit. */ --- 221 unchanged lines hidden (view full) --- 295 /** The CPU pointer. */ 296 O3CPU *cpu; 297 298 /** The IEW stage pointer. */ 299 IEW *iewStage; 300 301 protected: 302 /** The LSQ policy for SMT mode. */ |
303 SMTQueuePolicy lsqPolicy; |
304 |
305 /** Auxiliary function to calculate per-thread max LSQ allocation limit. 306 * Depending on a policy, number of entries and possibly number of threads 307 * and threshold, this function calculates how many resources each thread 308 * can occupy at most. 309 */ |
310 static uint32_t maxLSQAllocation(SMTQueuePolicy pol, uint32_t entries, |
311 uint32_t numThreads, uint32_t SMTThreshold) { |
312 if (pol == SMTQueuePolicy::Dynamic) { |
313 return entries; |
314 } else if (pol == SMTQueuePolicy::Partitioned) { |
315 //@todo:make work if part_amt doesnt divide evenly. 316 return entries / numThreads; |
317 } else if (pol == SMTQueuePolicy::Threshold) { |
318 //Divide up by threshold amount 319 //@todo: Should threads check the max and the total 320 //amount of the LSQ 321 return SMTThreshold; 322 } 323 return 0; 324 } 325 --- 44 unchanged lines hidden --- |