Gem5には便利なデバッグオプションがいろいろ入っていることを知った。
../../../../../../../build/ARM/gem5.opt \ --debug-flags=Exec,LSQUnit --outdir result --debug-file lsu.log \ ../../../../../../configs/example/se.py --cpu-type=DerivO3CPU --caches --cmd=hello
すると、result/lsu.log
にLSUの動作詳細が記録される。
598000: system.cpu.iew.lsq.thread0: Executing load PC (0x1450c=>0x14510).(0=>1), [sn:227] 598000: system.cpu.iew.lsq.thread0: Read called, load idx: 38, store idx: 27, storeHead: 26 addr: 0xc67c 598000: system.cpu.iew.lsq.thread0: Doing memory access for inst [sn:227] PC (0x1450c=>0x14510).(0=>1) 598000: system.cpu.iew.lsq.thread0: Memory request (pkt: ReadResp [c67c:c67f]) from inst [sn:227] was sent (cache is blocked: 0, cache_got_blocked: 0) 598000: system.cpu.iew.lsq.thread0: Executing load PC (0x14514=>0x14518).(0=>1), [sn:229] 598000: system.cpu.iew.lsq.thread0: Read called, load idx: 39, store idx: 27, storeHead: 26 addr: 0xc684 598000: system.cpu.iew.lsq.thread0: Doing memory access for inst [sn:229] PC (0x14514=>0x14518).(0=>1) 598000: system.cpu.iew.lsq.thread0: Memory request (pkt: ReadResp [c684:c687]) from inst [sn:229] was sent (cache is blocked: 0, cache_got_blocked: 0) 598000: system.cpu.iew.lsq.thread0: Executing load PC (0x1451c=>0x14520).(0=>1), [sn:231] 598000: system.cpu.iew.lsq.thread0: Read called, load idx: 40, store idx: 28, storeHead: 26 addr: 0x77dbc 598000: system.cpu.iew.lsq.thread0: Doing memory access for inst [sn:231] PC (0x1451c=>0x14520).(0=>1) 598000: system.cpu.iew.lsq.thread0: Memory request (pkt: ReadResp [77dbc:77dbf]) from inst [sn:231] was sent (cache is blocked: 0, cache_got_blocked: 0) 598000: system.cpu.iew.lsq.thread0: Executing store PC (0x14520=>0x14524).(0=>1) [sn:232] 598000: system.cpu.iew.lsq.thread0: Doing write to store idx 27, addr 0x76acc | storeHead:26 [sn:232] 598000: system.cpu.iew.lsq.thread0: Committing head load instruction, PC (0x145a0=>0x145a4).(0=>1) 598000: system.cpu.iew.lsq.thread0: LQ size: 32, #loads occupied: 8 598000: system.cpu.iew.lsq.thread0: SQ size: 32, #stores occupied: 5 592000: system.cpu: T0 : 0x145a4 @_dl_aux_init+432 : ldr r3, [r0] #8 592000: system.cpu: T0 : 0x145a4 @_dl_aux_init+432. 0 : ldr r3, [r0] #8 : MemRead : D=0x0000000000000017 A=0xbeffff50 592000: system.cpu: T0 : 0x145a4 @_dl_aux_init+432. 1 : addi_uop r0, r0, #8 : IntAlu : D=0x00000000beffff58 598500: system.cpu.iew.lsq.thread0: Executing load PC (0x14528=>0x1452c).(0=>1), [sn:234] 598500: system.cpu.iew.lsq.thread0: Read called, load idx: 41, store idx: 30, storeHead: 26 addr: 0xc688 598500: system.cpu.iew.lsq.thread0: Doing memory access for inst [sn:234] PC (0x14528=>0x1452c).(0=>1) 598500: system.cpu.iew.lsq.thread0: Memory request (pkt: ReadResp [c688:c68b]) from inst [sn:234] was sent (cache is blocked: 0, cache_got_blocked: 0)