Search code examples
memoryarmgem5

DRAMSim2 on GEM5 is only printing refresh command


I have successfully setup GEM5 in fs mode and with DRAMSim2 memory type. The command I am using is:

build/ARM/gem5.opt configs/example/fs.py --disk-image=/home/prakhar/full_system_2/disks/linux-arm-ael.img --mem-type=DRAMSim2

Everything is working fine. Now, I have added some comments in DRAMSim2 code to analyze the flow of code and to study command sequence. Then, I have again compile the ARM system to save the changes.

scons build/ARM/gem5.opt

Now, when I am running gem5 arm in fs mode again, it is just showing the comments of refresh commands. Like this:

6 0----------
refresh...
6 0----------
refresh...
6 0----------
refresh...
6 0----------
refresh...
6 0----------
refresh...
6 0----------
refresh...
6 0----------
refresh...
6 0----------
refresh...
6 0----------

Why can't I see other commands like ACT,READ,WRITE etc.There should be some read,write,act even when the OS is booting up? I have added comments in /gem5/ext/dramsim2/DRAMSim2/MemoryController.cpp

Steps to add DRAMSim2 in gem5:

  1. Go to ext/dramsim2 in gem5 directory.
  2. Clone DRAMSim2: git clone git://github.com/dramninjasUMD/DRAMSim2.git
  3. Re-build the system by scons.
  4. Run again in fs mode adding --mem-type=DRAMSim2 at last.

In the ext/dramsim2/DRAMSim2 there is a file MemoryController.cpp.In that file there is a function update().There is a switch-case of different commands like READ,WRITE,ACTIVATE.In respective cases for each command i have added cout like cout<<"read...." in read case, cout<<"refresh..." for refresh case. Again rebuild the system and run with fs mode and --mem-type=DRAMSim2. Now i m just getting comments of "refresh...." and not others, but there should be other comments also like "read..." and all as there is some read,write,activate while booting of OS.


Solution

  • I was trying yesterday and got the solution. Initially i was using the command:

    build/ARM/gem5.opt configs/example/fs.py --disk-image=/home/prakhar/full_system_2/disks/linux-arm-ael.img --mem-type=DRAMSim2
    

    In this command the default cpu type is AtomicSimpleCpu , which was only giving refresh commands.Now i have specified cpu type as TimingSimpleCPU and it is giving all commands.

    The command is:

    build/ARM/gem5.opt configs/example/fs.py --disk-image=/home/prakhar/full_system_2/disks/linux-arm-ael.img --mem-type=DRAMSim2 --cpu-type=TimingSimpleCPU