Difference between revisions of "Frequently Asked Questions"
From gem5
Line 19: | Line 19: | ||
# I've created a new file, how do I get SCons to compile it. | # I've created a new file, how do I get SCons to compile it. | ||
#* Add the file to the SConscript in the current directory or if it doesn't exist the SConscript in closest parent directory. | #* Add the file to the SConscript in the current directory or if it doesn't exist the SConscript in closest parent directory. | ||
− | # | + | # I've created a new SimObject but it doesn't seem to be recognized when I run M5. |
+ | #* You'll need to put the python object file in src/python/m5/objects/, and edit __init.py__ to include your object. | ||
+ | # How do I get my Alpha executable to work in syscall emulation mode? | ||
+ | #* M5 does not support dynamically linking libraries in syscall emulation mode. You must recompile the executable and have it statically linked. See the gcc man page for more information on statically linking your binary. | ||
+ | # What does this error mean <code>warn: setsysinfo: ignoring ieee_set_fp_control() arg 0x11ff96f98</code>? | ||
+ | #* That and similar errors are warning you that the system call that sets IEEE FP control register is being ignored. This register primarily enables/disables different kinds of FP traps (underflow, overflow, inexact, etc.). Since M5 doesn't implement those traps anyway there's no point in implementing the syscall. It's pretty unlikely your application relies on them, so as long as everything else seems to work you can ignore the warning. | ||
+ | # When running my program I get an error "Error: syscall <syscall name here> unimplemented." | ||
+ | #* That means that one of the libraries that you are linking with uses a syscall that is not emulated. You can do a <code>man</code> on the syscall name to see what the syscall is supposed to do and then try to implement at least whatever functionality your application needs. Or you can try the quick & dirty approach, which is to change the function pointer for syscall in arch/<arch>/<os>/<os>.cc from unimplementedFunc to ignoreFunc, which will make it print a warning and keep going rather than terminate with an error. No guarantees that your program won't crash because of this though. | ||
+ | # How do I use a normal variable in a statistic formula? | ||
+ | #* This is not supported. Just create a Scalar<> statistic that does the same thing as your normal variable and use that in the formula instead. | ||
+ | # How do I run multiprogram workloads on M5? |
Revision as of 17:50, 12 June 2006
- How can I see the packets on the ethernet link?
- By creating a Etherdump object, setting it's file parameter, and setting the dump parameter on the EtherLink to it. This is most easily accomplished by setting the enivornment variable
-EDUMPFILE=<file>
. The resulting file will be named<file>
and be in a standard pcap format.
- By creating a Etherdump object, setting it's file parameter, and setting the dump parameter on the EtherLink to it. This is most easily accomplished by setting the enivornment variable
- How do I create a disk image?
- You can use the
mkblankimage.sh
script that is provided in our distribution of linux-dist to create a blank image of arbitrary size.
- You can use the
- How do I add files to a disk image?
- Using either sudo or the root account run
/bin/mount -o loop,offset=32256 /z/foo.img /mount/point
. You can then copy the desired files to the image. Remember to unmount it before running the simulator with/bin/umount /mount/point
or you may get unexpected results.
- Using either sudo or the root account run
- How do I access reference counted pointers in GDB?
- Objects such as DynInsts are reference counted, making it slightly harder to obtain the data inside. In gdb you must access them through the pointer that is stored in the ref counted pointer, which is called data. Thus given a ref counted pointer
ptr
, in gdb you would say(gdb) ptr->data
to get the pointer to the actual object.
- Objects such as DynInsts are reference counted, making it slightly harder to obtain the data inside. In gdb you must access them through the pointer that is stored in the ref counted pointer, which is called data. Thus given a ref counted pointer
- How do I build a cross compiler?
- Download cross-tool here. It is a script to simplify the creation of cross-compilers.
- How many CPUs can M5 run?
- There is no strict limit however the Alpha platform we support (Tsunami) only has support for 4 processors. We made some additions to the platform both in the simulator and in Linux to support up to 64 processors. However simulating 64 processors will be quite slow, and the Linux scheduler doesn't seem particularly good at scheduling large amounts of processors.
- Where are the classes for each ISA instruction? Where are the execute() methods for the StaticInst class?
- Both the classes and the execute() methods are generated through Python upon building any version of M5. For example, After building ALPHA_SE, they will be located in the build/ALPHA_SE/arch/alpha/ folder. The key files are decoder.hh, decoder.cc (which describe the ISA instructions), and *_exec.cc (which describe the execute() methods). The definitions for both exist in the .isa files found in src/arch/*/isa/, which are processed by src/arch/isa_parser.py to generate the previously mentioned .hh/.cc files.
- Which config files are used for syscall emulation? Full system mode?
- How do I use the sampler?
- Is fast-forwarding supported in SMT mode?
- It is not currently supported. The SimpleCPU doesn't support SMT, so it doesn't support fast-forwarding in SMT mode. However it should be feasible given some hacking on the SimpleCPU or the Sampler.
- I've created a new file, how do I get SCons to compile it.
- Add the file to the SConscript in the current directory or if it doesn't exist the SConscript in closest parent directory.
- I've created a new SimObject but it doesn't seem to be recognized when I run M5.
- You'll need to put the python object file in src/python/m5/objects/, and edit __init.py__ to include your object.
- How do I get my Alpha executable to work in syscall emulation mode?
- M5 does not support dynamically linking libraries in syscall emulation mode. You must recompile the executable and have it statically linked. See the gcc man page for more information on statically linking your binary.
- What does this error mean
warn: setsysinfo: ignoring ieee_set_fp_control() arg 0x11ff96f98
?- That and similar errors are warning you that the system call that sets IEEE FP control register is being ignored. This register primarily enables/disables different kinds of FP traps (underflow, overflow, inexact, etc.). Since M5 doesn't implement those traps anyway there's no point in implementing the syscall. It's pretty unlikely your application relies on them, so as long as everything else seems to work you can ignore the warning.
- When running my program I get an error "Error: syscall <syscall name here> unimplemented."
- That means that one of the libraries that you are linking with uses a syscall that is not emulated. You can do a
man
on the syscall name to see what the syscall is supposed to do and then try to implement at least whatever functionality your application needs. Or you can try the quick & dirty approach, which is to change the function pointer for syscall in arch/<arch>/<os>/<os>.cc from unimplementedFunc to ignoreFunc, which will make it print a warning and keep going rather than terminate with an error. No guarantees that your program won't crash because of this though.
- That means that one of the libraries that you are linking with uses a syscall that is not emulated. You can do a
- How do I use a normal variable in a statistic formula?
- This is not supported. Just create a Scalar<> statistic that does the same thing as your normal variable and use that in the formula instead.
- How do I run multiprogram workloads on M5?