It has not been committed. There is a similar issue with loads that I
have been working on, once I have that working, I'll send a new patch
to the list.
- Clint
On Nov 30, 2008, at 1:31 PM, nathan binkert wrote:
> what ever happened with this? Is it correct? did it make it into
> the tree?
>
> On Wed, Nov 12, 2008 at 3:39 PM, Clint Smullen
> <[EMAIL PROTECTED]> wrote:
>> # HG changeset patch
>> # User Clint Smullen <[EMAIL PROTECTED]>
>> # Date 1226530575 18000
>> # Node ID c3e54b6bfd25aab8607a8f608fca17a4e37691a1
>> # Parent c508807529b5b3d43e8036ab8d85dd33fa2346b0
>> Cause the O3 fetch stage to wait on all pending fetch requests to
>> return before finishing the drain request. I attempted to simply
>> have it wait till each fetchStatus was cleared from
>> IcacheWaitResponse, but the status is cleared for squashes, which
>> makes this not always work. Instead, I keep a reference count of
>> how many outstanding fetch requests there are as part of normal
>> fetch processing. When a drain is signaled, if this count is
>> already zero, then it is signalled immediately. If it is not zero,
>> then it will be decremented as responses come back and the signal
>> is sent once the count reaches zero.
>>
>> diff --git a/src/cpu/o3/fetch.hh b/src/cpu/o3/fetch.hh
>> --- a/src/cpu/o3/fetch.hh
>> +++ b/src/cpu/o3/fetch.hh
>> @@ -443,6 +443,9 @@
>> /** Is there a drain pending. */
>> bool drainPending;
>>
>> + /** Number of pending fetch requests. */
>> + int outstandingFetchRequests;
>> +
>> /** Records if fetch is switched out. */
>> bool switchedOut;
>>
>> diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
>> --- a/src/cpu/o3/fetch_impl.hh
>> +++ b/src/cpu/o3/fetch_impl.hh
>> @@ -129,6 +129,7 @@
>> numFetchingThreads(params->smtNumFetchingThreads),
>> interruptPending(false),
>> drainPending(false),
>> + outstandingFetchRequests(0),
>> switchedOut(false)
>> {
>> if (numThreads > Impl::MaxThreads)
>> @@ -368,6 +369,15 @@
>>
>> assert(!pkt->wasNacked());
>>
>> + // Check whether we are done draining fetch requests out of
>> the system.
>> + // We do it here to cover the case where we were still waiting
>> on a
>> + // request, but the fetch state for the thread got squashes
>> elsewhere.
>> + outstandingFetchRequests--;
>> + assert(outstandingFetchRequests >= 0);
>> +
>> + if (drainPending && outstandingFetchRequests == 0)
>> + cpu->signalDrained();
>> +
>> // Only change the status if it's still waiting on the icache
>> access
>> // to return.
>> if (fetchStatus[tid] != IcacheWaitResponse ||
>> @@ -410,8 +420,10 @@
>> bool
>> DefaultFetch<Impl>::drain()
>> {
>> - // Fetch is ready to drain at any time.
>> - cpu->signalDrained();
>> + // Check to see if no fetches are outstanding right now
>> + if (outstandingFetchRequests == 0)
>> + cpu->signalDrained();
>> +
>> drainPending = true;
>> return true;
>> }
>> @@ -649,6 +661,7 @@
>> DPRINTF(Activity, "[tid:%i]: Activity: Waiting on I-cache "
>> "response.\n", tid);
>>
>> + outstandingFetchRequests++;
>> fetchStatus[tid] = IcacheWaitResponse;
>> } else {
>> delete mem_req;
>> @@ -1277,6 +1290,7 @@
>> assert(fetchStatus[retryTid] == IcacheWaitRetry);
>>
>> if (icachePort->sendTiming(retryPkt)) {
>> + outstandingFetchRequests++;
>> fetchStatus[retryTid] = IcacheWaitResponse;
>> retryPkt = NULL;
>> retryTid = -1;
>> _______________________________________________
>> m5-dev mailing list
>> [email protected]
>> http://m5sim.org/mailman/listinfo/m5-dev
>>
>>
> _______________________________________________
> m5-dev mailing list
> [email protected]
> http://m5sim.org/mailman/listinfo/m5-dev
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev