a4e5d2cbb9afc13d57121aa281aa18e111af359e
SCons has a system of "tools", which basically detect versions of build tools (compilers, linkers, etc) and set up an environment with the appropriate build variable substitutions for that tool to be used. For instance, there would be a "tool" for gcc, and it would detect if gcc is present on the system, and if so would set the "CC" variable to "gcc". An actually tool as defined by SCons would be a lot more sophisticated than that and set more variables, but that's the basic idea. To help modularize the gem5 SConstruct file, I moved code which would set up git commit hooks into a "tool" which helped modularize it and reduce the size of SConstruct. This isn't quite right since, while the code does detect if git was used to check out the source (if there is a .git file at the root), it doesn't really modify the environment at all. It will also be invoked every time any environment is set up, although right now that will only be the DefaultEnvironment, what's used when loose functions like Builder or Command are called with, and the "main" environment which all the others are Clone-d from. Normally, when SCons sets up a new environment, either implicitly or when Environment() is called, it sets up a bunch of built in tools which are fixed within SCons itself. If you want, you can add a "tools" argument to Environment (or to the DefaultEnvironment() function) which will replace that list of tools. That can be used to make an environment use the new "git" tool, but it isn't automatic. SCons also lets you override default tools by creating your own with the same name as the default. To make loading the git tool automatic, I added an override "default" tool which, in addition to setting some defaults which should apply to all environments, also pulled in other tools, at that time "git" and "mercurial" (RIP). Unfortunately, that meant that today, apparently particularly with SCons version 4, *any* Environment would pull in "git", and all of "git"'s dependencies, even if SCons wasn't set up enough for those to work. To break that dependency, this change stops the default tool from automatically loading the git tool, although it does continue to set other defaults which have very minimal external dependencies. When creating the "main" Environment in the SConstruct, the "git" tool is now added in explicitly. Since the list of tools replaces the original and doesn't extend it, we have to add in "default" explicitly as well. Really, the "git" tool should be converted from the tool interface into something more appropriate, like perhaps a small module under site_scons which site_init.py can import and call. When that happens, main can be declared like normal again. While making this change, I also got rid of a few nonstandard additions to the main environment that were little used and not really necessary. When reading the SConstruct, it wasn't very obvious where those extra values were coming from, and they didn't really add any value. Change-Id: I574db42fc2196bf62fc13d6754357c753ceb9117 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/38616 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Reviewed-by: Yu-hsin Wang <yuhsingw@google.com> Maintainer: Gabe Black <gabe.black@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This is the gem5 simulator. The main website can be found at http://www.gem5.org A good starting point is http://www.gem5.org/about, and for more information about building the simulator and getting started please see http://www.gem5.org/documentation and http://www.gem5.org/documentation/learning_gem5/introduction. To build gem5, you will need the following software: g++ or clang, Python (gem5 links in the Python interpreter), SCons, SWIG, zlib, m4, and lastly protobuf if you want trace capture and playback support. Please see http://www.gem5.org/documentation/general_docs/building for more details concerning the minimum versions of the aforementioned tools. Once you have all dependencies resolved, type 'scons build/<ARCH>/gem5.opt' where ARCH is one of ARM, NULL, MIPS, POWER, SPARC, or X86. This will build an optimized version of the gem5 binary (gem5.opt) for the the specified architecture. See http://www.gem5.org/documentation/general_docs/building for more details and options. The basic source release includes these subdirectories: - configs: example simulation configuration scripts - ext: less-common external packages needed to build gem5 - src: source code of the gem5 simulator - system: source for some optional system software for simulated systems - tests: regression tests - util: useful utility programs and files To run full-system simulations, you will need compiled system firmware (console and PALcode for Alpha), kernel binaries and one or more disk images. If you have questions, please send mail to gem5-users@gem5.org Enjoy using gem5 and please share your modifications and extensions.
Description