The debug information in gem5 is really amazing. You only need to use DPRINTF(FLAGA,"%d",value); where you want to output debug information.
DPRINTF(FLAGA,"%d",value);
If