Hello All,

First of all, I should point out that this is related to a previous
question I have posted in
https://www.mail-archive.com/gem5-users@gem5.org/msg16701.html but I
believe the discussion has diverted from the initial problem so I thought
it might be a good idea to start another thread.

I am trying to understand how the LSQ is implemented in gem5 since I am
seeing some behavior that I can't explain.

So my expectation is that 2 similar load instructions will receive similar
behavior from the LSQ but I am seeing different behaviors in my test. So
here are the traces (--debug-flags=LSQUnit,LSQ,Commit,ROB,IEW,IQ,Decode,
RubySlicc) for 2 loads (856511 and 856518)

Load 856511:
-------------------
15573591436383: system.o3Cpu.decode: [tid:0] Processing instruction [sn:856511]
with PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1)
15573591436716: global: [sn:856511] has 1 ready out of 3 sources. RTI 0)
15573591436716: global: [sn:856511] has 2 ready out of 3 sources. RTI 0)
15573591437382: system.o3Cpu.iew: [tid:0] Issue: Adding PC
(0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) [sn:856511] [tid:0] to IQ.
15573591437382: system.o3Cpu.iew.lsq.thread0: Inserting load PC
(0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1), idx:13 [sn:856511]
15573591437382: system.o3Cpu.iq: Adding instruction [sn:856511] PC
(0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) to the IQ.
15573591441045: system.o3Cpu.iq: Waking up a dependent instruction, [sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1).
15573591441045: global: [sn:856511] has 3 ready out of 3 sources. RTI 0)
15573591441045: system.o3Cpu.iq: Instruction is ready to issue, putting it
onto the ready list, PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1)
opclass:47 [sn:856511].
15573591441045: system.o3Cpu.iq: Thread 0: Issuing instruction PC
(0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) [sn:856511]
15573591441378: system.o3Cpu.iew: Execute: Processing PC
(0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1), [tid:0] [sn:856511].
15573591441378: system.o3Cpu.iew.lsq.thread0: Executing load PC
(0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1), [sn:856511]
15573591441378: system.o3Cpu.iew.lsq.thread0: Doing memory access for inst [
sn:856511] PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1)
15573591441711: system.o3Cpu.iew.lsq.thread0: -- inst [sn:856511] to pktAddr
:0xb9ea4300
15573591441711: system.o3Cpu.iew.lsq.thread0: Conflicting load at addr
0xb9ea4300 [sn:856511]
15573591442377: system.o3Cpu.commit: [tid:0] Can't commit, Instruction
[sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) is head of ROB and not
ready
15573591442710: system.o3Cpu.commit: [tid:0] Can't commit, Instruction
[sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) is head of ROB and not
ready
15573591443043: system.o3Cpu.commit: [tid:0] Can't commit, Instruction
[sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) is head of ROB and not
ready
15573591443376: system.o3Cpu.commit: [tid:0] Can't commit, Instruction
[sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) is head of ROB and not
ready
15573591443709: system.o3Cpu.commit: [tid:0] Can't commit, Instruction
[sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) is head of ROB and not
ready
15573591444042: system.o3Cpu.commit: [tid:0] Can't commit, Instruction
[sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) is head of ROB and not
ready
15573591444375: system.o3Cpu.commit: [tid:0] Can't commit, Instruction
[sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) is head of ROB and not
ready
15573591444708: system.o3Cpu.commit: [tid:0] Can't commit, Instruction
[sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) is head of ROB and not
ready
15573591445041: system.o3Cpu.commit: [tid:0] Can't commit, Instruction
[sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) is head of ROB and not
ready
15573591445374: system.o3Cpu.commit: [tid:0] Can't commit, Instruction
[sn:856511]
PC (0xffffffff8105bc89=>0xffffffff8105bc8d).(0=>1) is head of ROB and not
ready

Load 856518:
-------------------
15573591436716: system.o3Cpu.decode: [tid:0] Processing instruction [sn:856518]
with PC (0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1)
15573591437049: global: [sn:856518] has 1 ready out of 3 sources. RTI 0)
15573591437049: global: [sn:856518] has 2 ready out of 3 sources. RTI 0)
15573591437715: system.o3Cpu.iew: [tid:0] Issue: Adding PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1) [sn:856518] [tid:0] to IQ.
15573591437715: system.o3Cpu.iew.lsq.thread0: Inserting load PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1), idx:14 [sn:856518]
15573591437715: system.o3Cpu.iq: Adding instruction [sn:856518] PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1) to the IQ.
15573591441045: system.o3Cpu.iq: Waking up a dependent instruction, [sn:856518]
PC (0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1).
15573591441045: global: [sn:856518] has 3 ready out of 3 sources. RTI 0)
15573591441045: system.o3Cpu.iq: Instruction is ready to issue, putting it
onto the ready list, PC (0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1)
opclass:47 [sn:856518].
15573591441045: system.o3Cpu.iq: Thread 0: Issuing instruction PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1) [sn:856518]
15573591441378: system.o3Cpu.iew: Execute: Processing PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1), [tid:0] [sn:856518].
15573591441378: system.o3Cpu.iew.lsq.thread0: Executing load PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1), [sn:856518]
15573591441378: system.o3Cpu.iew.lsq.thread0: Doing memory access for inst [
sn:856518] PC (0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1)
15573591441711: system.o3Cpu.iew.lsq.thread0: -- inst [sn:856518] to pktAddr
:0xb9ea4300
15573591441711: system.o3Cpu.iew.lsq.thread0: Conflicting load at addr
0xb9ea4300 [sn:856518]
15573591443376: system.o3Cpu.iq: Instruction is ready to issue, putting it
onto the ready list, PC (0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1)
opclass:47 [sn:856518].
15573591443376: system.o3Cpu.iq: Thread 0: Issuing instruction PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1) [sn:856518]
15573591443709: system.o3Cpu.iew: Execute: Processing PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1), [tid:0] [sn:856518].
15573591443709: system.o3Cpu.iew.lsq.thread0: Executing load PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1), [sn:856518]
15573591443709: system.o3Cpu.iew.lsq.thread0: Doing memory access for inst [
sn:856518] PC (0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1)
15573591443709: system.o3Cpu.iew.lsq.thread0: Load [sn:856518] not executed
from fault
15573591443709: system.o3Cpu.iew: Sending instructions to commit, [sn:856518]
PC (0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1).
15573591444042: system.o3Cpu.commit: [tid:0] Marking PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1), [sn:856518] ready within
ROB.
15573591445374: system.o3Cpu.iq: Instruction is ready to issue, putting it
onto the ready list, PC (0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1)
opclass:47 [sn:856518].
15573591445374: system.o3Cpu.iq: Thread 0: Issuing instruction PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1) [sn:856518]
15573591445707: system.o3Cpu.iew: Execute: Processing PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1), [tid:0] [sn:856518].
15573591445707: system.o3Cpu.iew.lsq.thread0: Executing load PC
(0xffffffff8105bc95=>0xffffffff8105bc99).(0=>1), [sn:856518]

These trace snippets show that both requests go through exactly the same
steps up until a conflict is detected due to receiving an invalidation
request. After, that both requests behave differently. As far as I
understand by looking at the checkSnoop(...) function that detects the
conflicts, conflicting instructions are marked as faulty (ReExec) and
should be squashed. However, 856511 is stuck not being able to commit while
856518 is re-executed twice eventually leading to the following assertion
failure:

gem5.opt: build/X86_MOESI_hammer/cpu/o3/lsq_unit.hh:621: Fault LSQUnit<Impl
>::read(LSQUnit<Impl>::LSQRequest*, int) [with Impl = O3CPUImpl; Fault =
std::shared_ptr<FaultBase>; LSQUnit<Impl>::LSQRequest = LSQ<O3CPUImpl>::
LSQRequest]: Assertion `!load_inst->isExecuted()' failed.

I don't understand why 856511 and following instructions are not squashed.
I also don't understand why 856518 is being re-executed twice.

Thank you very much in advance,
Shehab
_______________________________________________
gem5-users mailing list
gem5-users@gem5.org
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to