On Tue, September 20, 2011 9:57 am, Ali Saidi wrote:
> How is moving those lines going to make it wok with Ruby?

Ruby overwrites the senderState pointer with another pointer. The pointer
restored only when Ruby gets done with the packet. LSQ makes use of
senderState just after sendTiming() returns. But the dynamic_cast returns
a NULL pointer since Ruby's senderState pointer is from a different class.
Storing the senderState pointer before calling sendTiming() does away with
the problem.

>
> It looks like it should be ok, but either way you're going to have to do
> some testing.

I will run regression tests, but I am not going to perform any directed
tests as of now.

>
> Ali
>
> On Sep 20, 2011, at 7:31 AM, Nilay Vaish wrote:
>
>> Hi
>>
>> I am thinking of making the O3 CPU work with Ruby. I would need to move
>> the following lines in O3's LSQ implementation to make a single O3 CPU
>> work with Ruby. Would this change affect the LSQ's current behavior,
>> other than that it would start working fine with Ruby?
>>
>> diff -r dee1f3ab92e4 src/cpu/o3/lsq_unit_impl.hh
>> --- a/src/cpu/o3/lsq_unit_impl.hh    Mon Sep 19 06:17:21 2011 -0700
>> +++ b/src/cpu/o3/lsq_unit_impl.hh    Tue Sep 20 07:26:30 2011 -0500
>> @@ -1191,10 +1191,10 @@
>>         DPRINTF(LSQUnit, "Receiving retry: store blocked\n");
>>         assert(retryPkt != NULL);
>>
>> +        LSQSenderState *state =
>> +            dynamic_cast<LSQSenderState *>(retryPkt->senderState);
>> +
>>         if (dcachePort->sendTiming(retryPkt)) {
>> -            LSQSenderState *state =
>> -                dynamic_cast<LSQSenderState *>(retryPkt->senderState);
>> -
>>             // Don't finish the store unless this is the last packet.
>>             if (!TheISA::HasUnalignedMemAcc || !state->pktToSend ||
>>                     state->pendingPacket == retryPkt) {
>>

--
Nilay

_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to