skip to Main Content

gem5 version:v21.2.0.0,add a new debugflag in src/mem/cache/SConscript,

recompile with scons/build/ARM/gem.opt,

and in build/ARM/debug file still don’t have new debugflag.hh

in this version, how to define a new debugflag to show the details about addr, pc addr, cacheline’s index, cacheline’s offset, write/read, access lenth, L1 hit/miss and index, L2 hit/miss and index

2

Answers


  1. Se.py is not the right file to add your debugging flags. Go to options.py, and add as many as you want in there so that you can pass them in the command line when you run simulations. You could check for these flags in cache.cc to do your data (hits, misses, address and pc on l1d cache).

    Login or Signup to reply.
  2. Per the gem5 documentation, to add a DebugFlag you have to "add new debug flags simply by adding DebugFlag() command to any SConscript file (preferably the one nearest where you are using the new flag). If you use a debug flag in a C++ source file, you would need to include the header file debug/.hh in that file."

    For example, if you wanted to add the flag to src/mem/cache/SConscript, you could add DebugFlag("SampleFlag") to the SConscript. To compile, you cannot use the gem5.fast compilation target (the documentation states that DebugFlags are not included to optimize compilation), but the debug/SampleFlag.hh should be created automatically in the build/<ISA>/ directory (where the path would be build/ISA/debug/SampleFlag.hh).

    Then, to add SampleFlag to the src/mem/cache/cache.cc file, you need to include debug/SampleFlag.hh at the beginning of the file, and can then use the syntax DPRINTF(SampleFlag, "<formatting string of addr, pc addr, cacheline's index, cacheline's offset, write/read, access lenth, L1 hit/miss and index, L2 hit/miss and index>").

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search