1/* |
2 * Copyright (c) 2012 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 * Copyright (c) 2004-2006 The Regents of The University of Michigan 15 * All rights reserved. 16 * 17 * Redistribution and use in source and binary forms, with or without 18 * modification, are permitted provided that the following conditions are 19 * met: redistributions of source code must retain the above copyright 20 * notice, this list of conditions and the following disclaimer; 21 * redistributions in binary form must reproduce the above copyright --- 32 unchanged lines hidden (view full) --- 54 std::string _smtROBPolicy, unsigned _smtROBThreshold, 55 ThreadID _numThreads) 56 : cpu(_cpu), 57 numEntries(_numEntries), 58 squashWidth(_squashWidth), 59 numInstsInROB(0), 60 numThreads(_numThreads) 61{ |
62 std::string policy = _smtROBPolicy; 63 64 //Convert string to lowercase 65 std::transform(policy.begin(), policy.end(), policy.begin(), 66 (int(*)(int)) tolower); 67 68 //Figure out rob policy 69 if (policy == "dynamic") { --- 26 unchanged lines hidden (view full) --- 96 for (ThreadID tid = 0; tid < numThreads; tid++) { 97 maxEntries[tid] = threshold; 98 } 99 } else { 100 assert(0 && "Invalid ROB Sharing Policy.Options Are:{Dynamic," 101 "Partitioned, Threshold}"); 102 } 103 |
104 resetState(); 105} 106 107template <class Impl> 108void 109ROB<Impl>::resetState() 110{ 111 for (ThreadID tid = 0; tid < numThreads; tid++) { 112 doneSquashing[tid] = true; 113 threadEntries[tid] = 0; |
114 squashIt[tid] = instList[tid].end(); |
115 squashedSeqNum[tid] = 0; |
116 } |
117 numInstsInROB = 0; |
118 119 // Initialize the "universal" ROB head & tail point to invalid 120 // pointers 121 head = instList[0].end(); 122 tail = instList[0].end(); 123} 124 125template <class Impl> --- 8 unchanged lines hidden (view full) --- 134ROB<Impl>::setActiveThreads(list<ThreadID> *at_ptr) 135{ 136 DPRINTF(ROB, "Setting active threads list pointer.\n"); 137 activeThreads = at_ptr; 138} 139 140template <class Impl> 141void |
142ROB<Impl>::drainSanityCheck() const |
143{ |
144 for (ThreadID tid = 0; tid < numThreads; tid++) 145 assert(instList[tid].empty()); 146 assert(isEmpty()); |
147} 148 149template <class Impl> 150void 151ROB<Impl>::takeOverFrom() 152{ |
153 resetState(); |
154} 155 156template <class Impl> 157void 158ROB<Impl>::resetEntries() 159{ 160 if (robPolicy != Dynamic || numThreads > 1) { 161 int active_threads = activeThreads->size(); --- 402 unchanged lines hidden --- |