Frequently Asked Questions

From gem5

Jump to: navigation, search

Contents

Device Related

How can I see the packets on the ethernet link?

Compiling Related

M5 build fails during linking, but SCons passes check for libpython2.X

How do I compile a version of M5 that can use EIO traces?

How do I compile M5 as a shared library?

scons -j 4 build/X86_SE/libm5_debug.so CPU_MODELS=TimingSimpleCPU

OS/Linux Related

What is a disk image?
How do I add files to a disk image?
What if I need more space than is available on the disk image?
  1. You can get the blank image script from the m5/util directory, create a new blank image that is the desired size, and then mount both images and copy the contents of the 50MB one to your new one.
  2. You can use the 50MB image to boot the system but then mount a second disk image that has your benchmark on it by adding the image to FSConfig.py and then mounting it with an rcS script
  3. You can build an entirely new image of the desired size with PTX dist (available from the Download page).
Can I use MIPS SDE Lite to cross-compile for M5?

Running Related

I compiled an executable to run in syscall emulation mode but it doesn't work.
How many CPUs can M5 run?
How do I see what options I can set?
How do I run SPEC cpu2000 benchmarks on M5?
How do I run SPEC cpu2006 benchmarks on M5?
How do I run SPLASH benchmarks on M5?
When I try to run the simulator and I get an error: ImportError: Can't find a path to system files.
How do I run multiprogram workloads on M5?
How do I terminate multiprogram workloads?
  1. Terminate as soon as any thread reaches a particular maximum number of instructions. This option is equivalent to max_insts_any_thread. The potential problem here is that because of the inherent non-determinism of multithreaded programs, there is no way to ensure that all experiments do the same work. You might also not get the same amount of work done. For example, if you have two threads, one of them must reach the maximum. The other could either execute no instructions, or could execute max-1 instructions. The benefit of this approach is that all threads are running fully until the simulation terminates (provided that none of the threads terminate early due to some other condition.)
  2. Terminate once all threads have reached a maximum number of instructions. This option is equivalent to max_insts_all_threads. In this mode, we make sure all threads do at least a certain amount of work, but threads that reach the maximum continue executing. This has the same benefit as the previous example, but also suffers from the problem that non-determinism will cause you to potentially not do the same amount of total work.
  3. In this unimplemented mode, all threads would run for exactly a specified number of instructions with some threads terminating early. All threads will do the same amount of work thus avoiding the problem of the previous options. The downside of this option is that the threads may not all be running for the entire simulation. For example, one thread might finish its instructions almost right away, while the other thread has quite a bit left to do. When this happens, you're only running a multiprogram workload for a fraction of the total time.
  4. Another unimplemented option could be to specify how many instructions each thread has to complete before exiting. This is not implemented, but would allow a balance to be struck between options 1 and 2 if the user experimented to figure out what a good mix was.

If you want to implement either of the unimplemented options, or if you have other ideas, please let us know!

How do I use the sampler?

The sampler from the previous version of M5 has been replaced with functionality via Python. See the Sampling documentation for details.

Debugging and Error Related

When running my program I get an error "Error: syscall <syscall name here> unimplemented."
How do I access reference counted pointers in GDB?
I get an error "undefined reference to `void foo()'" when the compiler is doing the final linking.
When I'm running in SE mode I get warnings about unimplemented or ignored system calls or trapping modes.

Miscellaneous

Where are the classes for each ISA instruction? Where are the execute() methods for the StaticInst class?
Is fast-forwarding supported in SMT mode?
I've created a new file, how do I get SCons to compile it.
I've got a new SimObject compiled but I can't use it.
How do I use a normal variable in a statistic formula?
What are all these *_impl.hh files?
What if SCons complains that it can't find a file I just deleted?
Which config files are used for syscall emulation? Full system mode?

configs/example/se.py is a sample configuration file for syscall emulation. Similarly, configs/example/fs.py is a sample configuration for full system simulations. Both these files include files in the configs/common/ directory.

Where does the stack and program arguments get setup for a process in Syscall Emulation mode?

A good point of reference for this is the "argsInit" function in the src/sim/process.cc file. For Syscall Emulation, each process is given a "LiveProcess" object and that function initializes the arguments to that process and also sets up the initial stack for that process. You'll also notice that the architecture specific Process objects (e.g. AlphaLinuxLiveProcess found in arch/alpha/linux/process.hh) derive from the LiveProcess object too.

What should I do when I get a loader error in a HelloDeviceParams function?

When creating a new HelloDevice class extending SimObject class (following the example in the ASPLOS tutorial slide 106-115), one might encounter loader errors like the following:

build/X86_SE/params/params_wrap.do: 
In function `_wrap_DeviceParams_create':
m5/build/X86_SE/params/params_wrap.cc:19999:
undefined reference to `DeviceParams::create()'
collect2: ld returned 1 exit status
scons: *** [build/X86_SE/m5.debug] Error 1
scons: building terminated because of errors.

This error is caused by NOT defining a HelloDeviceParams::create() function in the device.cc. One should add the following in the device.cc

HelloDevice * HelloDeviceParams::create()
{
    return new HelloDevice(this);
}
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox