Site

NVMain can be run on trace files or by interfacing with another simulator.

Trace-based Simulation Build

NVMain uses SCons to build the standalone version. To build NVMain for trace-based simulation, you can just run scons from the command line where you cloned nvmain. By default, a release version of NVMain is built, which is fully optimized without debugging information. In order to a build a version which can be run in a debugger, you can select the release type using the build-type option: scons --build-type=debug. The available build types are debug for debugging, prof which enabling profiling support, and fast which is the default, fully optimized build.

NVMain with gem5

Currently NVMain supports gem5 as a CPU/cache simulator. To build for gem5, import for the patch using mercurial. If you don't already have a mercurial queue setup, do this first. It is recommended you use the latest gem5 repository and NOT gem5-stable, since gem5-stable tends to be quite old. You can setup a mercurial queue as follows:

hg qinit

Applying the patches

Assuming NVMain is in /path/to/nvmain:

hg qimport -f /path/to/nvmain/patches/gem5/nvmain2-gem5-XXXX+

where XXXX is a version number related to the gem5 commit that the patch was written and tested on. You should pick a version of the patch that is less than or equal to your gem5 version. You can check the gem5 revision using the command "hg summary" in the gem5 directory.

Make sure to apply the patch before compiling gem5!

It is recommended you do NOT place the nvmain directory within a subdirectory of your gem5 installation. If you do this, note that you will still need to use the EXTRAS directive when building gem5 with scons.

hg qpush

You can verify the patch was pushed using hg qapplied and checking that the nvmain patch is in the list.

Compiling gem5 with NVMain

Once the patch is applied, you can compile in one of two ways. If your NVMain path is NOT a subdirectory of gem5, you will need to also provide the path to NVMain via the EXTRAS variable for scons:

scons EXTRAS=/path/to/nvmain build/X86/gem5.fast

Saving your changes

For your sanity you may want to create a patch containing your changes. This will make it easy for you to update NVMain.

hg qnew mychanges.patch

You can save your changes using qrefresh:

hg qrefresh

Now updating NVMain is simple. Just qrefresh to save your changes, remove the patch using qpop, and re-import the new NVMain patch and push the patches back:

hg qrefresh
hg qpop -a
hg qimport -f /path/to/nvmain/patches/gem5/nvmain
hg qpush -a

If all goes well, you should have successfully updated. You can also follow these steps to get the latest version of gem5!

Other CPU simulators

Don't use gem5? You can follow the instructions in the documentation to create an interface to NVMain at the Simulator Integration page.