Tour of the tree
These are the files and directories at the top of the tree:
AUTHORS LICENSE README RELEASE_NOTES SConstruct build_opts configs ext src system tests util
AUTHORS, LICENSE, README are files with general information about the simulator. AUTHORS is a list of people who have historically contributed to M5. LICENSE has the license terms that applies to M5 as a whole, unless overridden by a more specific license. README has some very basic information introducing M5 and explaining how to get started.
SConstruct file is part of the build system, as is the build_opts directory. build_opts holds files that define default settings for build different build configurations. These include X86_FS and MIPS_SE, for instance.
configs directory is for simulation configuration scripts which are written in python. These are described in more detail later. The files in this directory help make writing configurations easier by providing some basic prepackaged functionality, and include a few examples which can be used directly or as a starting point for your own scripts.
ext directory is for things M5 depends on but which aren’t actually part of M5. Specifically these are for dependencies that are harder to find, not likely to be available, or where a particular version is needed.
src directory is where most of M5 is located. This is where all of the C++ and python source that contributes to the M5 binary is kept, excluding components in the ext directory.
system directory is for the source for low level software like firmware or bootloaders for use in simulated systems. Currently this includes Alpha’s PAL and console code, and a simple bootloader for ARM.
tests directory stores files related to M5’s regression tests. These include the scripts that build up the configurations used in the tests and reference outputs. Simple hello world binaries are also stored here, but other binaries need to be downloaded separately.
Finally, in the
util directory are utility scripts, programs and useful files which are not part of the M5 binary but are generally useful when working on M5.
All of the code in gem5 is expected to follow a set rules described in our style guide. These rules make the code more consistent which make it easier to read, maintain, and extend the code. Specific coding style has been defined for things such as Indentation and Line Breaks , Spacing, Naming of Variables & Classes, and M5 Status Messages. There are also Documentation Guidelines which you should follow which allow documentation to be generated automatically using the Doxygen system.