0

I am learning gem5 recently. I read the official documentation of gem5, but sometimes I always feel that the description is too formal and I cannot understand it in detail. I want to use gem5 to do research on branch prediction or prefetching. When I used it, I encountered some things that I didn't understand. There may be a lot of questions, I hope someone can help me, thank you very much!

  1. When I was looking at the source code of some papers, I found that they often start with checkpoints.But according to the introduction of checkpoint document, Checkpoints are just simulated snapshots, so is the meaning of checkpoints used when simulating long-term code? In order to prevent problems in the middle, Or reduce the running time in the future? According to this answer, gem5's classic memory system does not save any cache state. Does this mean that checkpoint is not appropriate in the prefetch experiment?

Moreover, According to the official documentation, the --checkpoint-at-end option can be used to create a checkpoint at the end of the simulation. But the source code of a top conference paper I saw did not use this option when creating a checkpoint. When I don't use --checkpoint-at-end, I see that the corresponding directories and files are generated. Does this mean that this option can be omitted? When I generated the checkpoint, a warn: Checkpoints for file descriptors currently do not work appeared. What is going on?

  1. If I do prefetching or branch prediction experiments, I should warm up the cache before the formal experiment. I looked at the --warmup-insts option. In the introduction of this option, it is mentioned that --standard-switch is required. And I see that many people use:

    --fast-forward=1000000 --standard-switch=$WARMUP_INSTS --warmup-insts=$WARMUP_INSTS Their explanations are:

(1). --fast-forward: Number of instructions to fast forward before switching

(2) --warmup-insts: Warmup period in total instructions (requires --standard-switch)

(3)--standard-switch: switch from timing to Detailed CPU after warmup period of

Looking at each item individually, I seem to understand it, but specifically, I don't seem to understand it at all.

  1. I want to do a prefetch experiment, but how do I get the trace of the command? So that I can analyze, is there any tool for this?

These questions may seem stupid, but they have troubled me for a long time. Thank you very much for someone who can answer them!

Yujie
  • 395
  • 2
  • 12
  • Yujie, the main goal of checkpointing is to speed up experiments as you suggested. Notably to fastforward up to after kernel boot. And yes, like you said, it will produce slightly different results than a direct run since not all microarchitectural state can be correctly restored. However, I think that in general it does not matter much for the experiment, since hopefully the experiment will run for enough instructions that the different initial state is just a perturbation that becomes insignificant. – Ciro Santilli Jun 21 '21 at 17:11
  • I'm not super familiar with the other command line options you mention. Maybe they can be used to do smart things, but I'm not sure. I think just using `m5 checkpoint` to skip boot and then running the experiment directly would be a reasonable first step. Then only if it really looks like the data has been made worse by checkpointing would I start to think about more advanced options. – Ciro Santilli Jun 21 '21 at 17:12
  • Not sure about `Checkpoints for file descriptors currently do not work appeared`. Is this SE mode? If yes then I'd expect guest it's doing e.g. `open` syscall and that might not be supported. not sure. If fullsystem I don't know. – Ciro Santilli Jun 21 '21 at 17:15
  • Thank you very much! It's in SE mode. – Yujie Jun 22 '21 at 07:07

0 Answers0