diff -r b93e106a379a -r 132e2bbe723e src/cpu/o3/lsq.hh --- a/src/cpu/o3/lsq.hh Thu Jul 18 16:23:47 2013 -0500 +++ b/src/cpu/o3/lsq.hh Fri Jul 19 12:33:02 2013 -0500 @@ -70,6 +70,9 @@ /** Constructs an LSQ with the given parameters. */ LSQ(O3CPU *cpu_ptr, IEW *iew_ptr, DerivO3CPUParams *params); + ~LSQ() { + if (thread) delete [] thread; + } /** Returns the name of the LSQ. */ std::string name() const; @@ -316,7 +319,7 @@ LSQPolicy lsqPolicy; /** The LSQ units for individual threads. */ - LSQUnit thread[Impl::MaxThreads]; + LSQUnit *thread; /** List of Active Threads in System. */ std::list *activeThreads; diff -r b93e106a379a -r 132e2bbe723e src/cpu/o3/lsq_impl.hh --- a/src/cpu/o3/lsq_impl.hh Thu Jul 18 16:23:47 2013 -0500 +++ b/src/cpu/o3/lsq_impl.hh Fri Jul 19 12:33:02 2013 -0500 @@ -61,6 +61,8 @@ numThreads(params->numThreads), retryTid(-1) { + assert(numThreads > 0 && numThreads <= Impl::MaxThreads); + //**********************************************/ //************ Handle SMT Parameters ***********/ //**********************************************/ @@ -109,6 +111,7 @@ } //Initialize LSQs + thread = new LSQUnit[numThreads]; for (ThreadID tid = 0; tid < numThreads; tid++) { thread[tid].init(cpu, iew_ptr, params, this, maxLQEntries, maxSQEntries, tid); diff -r b93e106a379a -r 132e2bbe723e src/cpu/o3/lsq_unit_impl.hh --- a/src/cpu/o3/lsq_unit_impl.hh Thu Jul 18 16:23:47 2013 -0500 +++ b/src/cpu/o3/lsq_unit_impl.hh Fri Jul 19 12:33:02 2013 -0500 @@ -145,15 +145,13 @@ LSQ *lsq_ptr, unsigned maxLQEntries, unsigned maxSQEntries, unsigned id) { + lsqID = id; cpu = cpu_ptr; iewStage = iew_ptr; + lsq = lsq_ptr; DPRINTF(LSQUnit, "Creating LSQUnit%i object.\n",id); - lsq = lsq_ptr; - - lsqID = id; - // Add 1 for the sentinel entry (they are circular queues). LQEntries = maxLQEntries + 1; SQEntries = maxSQEntries + 1;