It seems that the instructions on the wire from the fetch stage to the decode are not squashed. Suppose the fetch stage go the result of the translation and it created an instruction out of it and placed it on the wire to the decode stage. But the stage also received a signal that the commit stage is squashing all the instructions. A cycle later the decode stage gets to see this instruction, but since it is also in the squashing phase, the instruction is not processed. This is caught by the assert statement in the sortInsts() function in decode_impl.hh.

So who should be responsible for squashing those instructions that are on the wire? The fetch stage or the decode stage?

Here is a trace that made me arrive that above conclusion --


61053036000: system.cpu0.decode: Instructions fetched: 0
61053036000: system.cpu0.decode: Processing [tid:0]

...

61053036000: system.cpu0: Scheduling next tick!
61053036500: system.cpu0: CPU already running.
61053036500: system.cpu0.fetch: [tid:0] Got back req with addr 0 but expected 0 61053036500: system.cpu0.fetch: [tid:0]: Translation faulted, building noop. 61053036500: global: DynInst: [sn:69396409] Instruction created. Instcount for system.cpu0 = 71 61053036500: system.cpu0.fetch: [tid:0]: Instruction PC 0 (0) created [sn:69396409].
61053036500: system.cpu0.fetch: [tid:0]: Instruction is:   NOP

...

FullO3CPU: Ticking main, FullO3CPU.
61053036500: system.cpu0.fetch: [tid:0]: Squashing instructions due to squash from commit.
61053036500: system.cpu0.fetch: [tid:0]: Squash from commit.
61053036500: system.cpu0.fetch: [tid:0]: Squashing, setting PC to: (0xffffffff802763f0=>0xffffffff802763f8).(0=>1). 61053036500: system.cpu0: Thread 0: Deleting instructions from instruction list.
61053036500: system.cpu0: ROB is not empty, squashing insts not in ROB.
61053036500: system.cpu0: Squashing instruction, [tid:0] [sn:69396409] PC (0=>0x8).(0=>1)

...

61053037000: system.cpu0.fetch: [tid:0]: ROB is still squashing.
61053037000: system.cpu0.fetch: Running stage.
61053037000: system.cpu0.fetch: There are no more threads available to fetch from.
61053037000: system.cpu0.fetch: [tid:0]: Fetch is squashing!
61053037000: system.cpu0.decode: Instructions fetched: 1
 61053037000: system.cpu0.decode: Processing [tid:0]
61053037000: system.cpu0.decode: [tid:0]: ROB is still squashing.
61053037000: system.cpu0.decode: Decode status: 3, instructions to process before: 1 61053037000: system.cpu0.decode: Decode status: 3, instructions to process after: 1

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

Reply via email to