summaryrefslogtreecommitdiff
path: root/SConstruct
AgeCommit message (Collapse)Author
2013-10-02kvm: Only include KVM support for supported kernelsAndreas Hansson
This patch adds a check to ensure that the KVM API provided by the running kernel is what we are expecting.
2013-10-01scons, kvm: Check for the presence of POSIX timersAndreas Sandberg
The kvm-based CPU module requires support for POSIX timers. This changeset adds a check for POSIX timers and ensures that gem5 is linked with librt if necessary. KVM support is disabled if POSIX timers are not supported by the host. This fixes a compilation issue for some glibc versions where clock_nanosleep and timer_create are in different libraries.
2013-09-30ext: Include libfputilsAndreas Sandberg
This changeset includes libfputils from revision bbf0d61d75. This library can be used to convert to and from 80-bit floats and query the type of an 80-bit float, which is needed to support the x87 FPU.
2013-09-25kvm: Initial x86 supportAndreas Sandberg
This changeset adds support for KVM on x86. Full support is split across a number of commits since some features are relatively complex. This changeset includes support for: * Integer state synchronization (including segment regs) * CPUID (gem5's CPUID values are inserted into KVM) * x86 legacy IO (remapped and handled by gem5's memory system) * Memory mapped IO * PCI * MSRs * State dumping Most of the functionality is fairly straight forward. There are some quirks to support PCI enumerations since this is done in the TLB(!) in the simulated CPUs. We currently replicate some of that code. Unlike the ARM implementation, the x86 implementation of the virtual CPU does not use the cycles hardware counter. KVM on x86 simulates the time stamp counter (TSC) in the kernel. If we just measure host cycles using perfevent, we might end up measuring a slightly different number of cycles. If we don't get the cycle accounting right, we might end up rewinding the TSC, with all kinds of chaos as a result. An additional feature of the KVM CPU on x86 is extended state dumping. This enables Python scripts controlling the simulator to request dumping of a subset of the processor state. The following methods are currenlty supported: * dumpFpuRegs * dumpIntRegs * dumpSpecRegs * dumpDebugRegs * dumpXCRs * dumpXSave * dumpVCpuEvents * dumpMSRs Known limitations: * M5 ops are currently not supported. * FPU synchronization is not supported (only affects CPU switching). Both of the limitations will be addressed in separate commits.
2013-09-18swig: Warn on use of incompatible swig/gcc combinationsAndreas Hansson
This patch removes the fixed swig warning concerning 2.0.9/2.0.10 and adds a warning message for incompatible combinations of swig and gcc.
2013-09-04scons: Enable build on OSXAndreas Hansson
This patch changes the SConscript to build gem5 with libc++ on OSX as the conventional libstdc++ does not have the C++11 constructs that the current code base makes use of (e.g. std::forward). Since this was the last use of the transitional TR1, the unordered map and set header can now be simplified as well.
2013-07-18scons: Use python-config instead of distutilsAndreas Hansson
This patch changes how we determine the Python-related compiler and linker flags. The previous approach used the internal LINKFORSHARED which is not intended as part of the external API (http://bugs.python.org/issue3588) and causes failures on recent OSX installations. Instead of using distutils we now rely on python-config and scons ParseConfig. For backwards compatibility we also parse out the includes and libs although this could safely be dropped. The drawback of this patch is that Python 2.5 is now required, but hopefully that is an acceptable compromise as any system with gcc 4.4 most likely will have Python >= 2.5.
2013-06-04scons: ammend swig warning error to version 2.0.10 as wellAli Saidi
2013-04-22kvm: Add basic support for ARMAndreas Sandberg
Architecture specific limitations: * LPAE is currently not supported by gem5. We therefore panic if LPAE is enabled when returning to gem5. * The co-processor based interface to the architected timer is unsupported. We can't support this due to limitations in the KVM API on ARM. * M5 ops are currently not supported. This requires either a kernel hack or a memory mapped device that handles the guest<->m5 interface.
2013-04-22kvm: Basic support for hardware virtualized CPUsAndreas Sandberg
This changeset introduces the architecture independent parts required to support KVM-accelerated CPUs. It introduces two new simulation objects: KvmVM -- The KVM VM is a component shared between all CPUs in a shared memory domain. It is typically instantiated as a child of the system object in the simulation hierarchy. It provides access to KVM VM specific interfaces. BaseKvmCPU -- Abstract base class for all KVM-based CPUs. Architecture dependent CPU implementations inherit from this class and implement the following methods: * updateKvmState() -- Update the architecture-dependent KVM state from the gem5 thread context associated with the CPU. * updateThreadContext() -- Update the thread context from the architecture-dependent KVM state. * dump() -- Dump the KVM state using (optional). In order to deliver interrupts to the guest, CPU implementations typically override the tick() method and check for, and deliver, interrupts prior to entering KVM. Hardware-virutalized CPU currently have the following limitations: * SE mode is not supported. * PC events are not supported. * Timing statistics are currently very limited. The current approach simply scales the host cycles with a user-configurable factor. * The simulated system must not contain any caches. * Since cycle counts are approximate, there is no way to request an exact number of cycles (or instructions) to be executed by the CPU. * Hardware virtualized CPUs and gem5 CPUs must not execute at the same time in the same simulator instance. * Only single-CPU systems can be simulated. * Remote GDB connections to the guest system are not supported. Additionally, m5ops requires an architecture specific interface and might not be supported.
2013-03-18scons: Try to use 'tcmalloc' before 'tcmalloc_minimal'Andreas Sandberg
tcmalloc_minimal doesn't support the heap checker on Debian, while tcmalloc does. Instead of always linking with tcmalloc_minimal, if it exists, we first check for tcmalloc and then use tcmalloc_minimal as a fallback.
2013-03-18scons: Avoid malloc/free compiler optimization when using tcmallocAndreas Sandberg
According to the tcmalloc readme, the recommended way of compiling applications that make use of tcmalloc is to disable compiler optimizations that make assumptions about malloc and friends. This changeset adds the necessary compiler flags for both gcc and clang. From the tcmalloc readme: "NOTE: When compiling with programs with gcc, that you plan to link with libtcmalloc, it's safest to pass in the flags -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free when compiling."
2013-03-18scons: Don't explicitly add tcmalloc_minimal to LIBSAndreas Sandberg
SCons automatically adds a library to LIBS if conf.CheckLib succeeds, so there is no need to explicitly add the library.
2013-03-18scons: Include flags required to link statically with PythonAndreas Sandberg
Python requires the flags in LINKFORSHARED to be added the linker flags when linking with a statically with Python. Failing to do so can lead to errors from the Python's dynamic module loader at start up. --HG-- extra : rebase_source : e7a8daf72f4ede7ee5a4a5398a0b12e978a919b9
2013-03-14scons: Check for known buggy version of SWIG (2.0.9)Andreas Sandberg
SWIG version 2.0.9 uses fully qualified module names despite of the importing module being in the same package as the imported module. This has the unfortunate consequence of causing the following error when importing m5.internal.event: Traceback (most recent call last): File "<string>", line 1, in <module> File "src/python/importer.py", line 75, in load_module exec code in mod.__dict__ File "src/python/m5/__init__.py", line 35, in <module> import internal File "src/python/importer.py", line 75, in load_module exec code in mod.__dict__ File "src/python/m5/internal/__init__.py", line 32, in <module> import event File "src/python/importer.py", line 75, in load_module exec code in mod.__dict__ File "build/X86/python/swig/event.py", line 107, in <module> class Event(m5.internal.serialize.Serializable): AttributeError: 'module' object has no attribute 'internal' When 'event' is loaded, it triggers 'serialize' to be loaded. However, it seems like the dictionary of 'm5' isn't updated until after __init__.py terminates, which means that 'event' never sees the 'internal' attribute on 'm5'. Older versions of SWIG didn't include the fully qualified module name if the modules were in the same package.
2013-02-19scons: Unify the flags shared by gcc and clangAndreas Hansson
This patch restructures and unifies the flags used by gcc and clang as they are largely the same. The common parts are now dealt with in a shared block of code, and the few bits and pieces that are specifically affecting either gcc or clang are done separately.
2013-02-19scons: Add warning for overloaded virtual functionsAndreas Hansson
A derived function with a different signature than a base class function will result in the base class function of the same name being hidden. The parameter list and return type for the member function in the derived class must match those of the member function in the base class, otherwise the function in the derived class will hide the function in the base class and no polymorphic behaviour will occur. This patch addresses these warnings by ensuring a unique function name to avoid (unintentionally) hiding any functions.
2013-02-19scons: Add warning for missing field initializersAndreas Hansson
This patch adds a warning for missing field initializers for both gcc and clang, and addresses the warnings that were generated.
2013-02-15ext lib: add libfdt to enable flattened device tree supportAnthony Gutierrez
this patch adds libfdt, a library necessary for supporting flattened device tree support in current and future versions of the linux/android kernel for ARM.
2013-01-21scons: Disable protobuf if pkg-config and CheckLib failsAndreas Hansson
This patch changes the use of pkg-config such that protobuf is still evaluated with CheckLib even if it fails. This is to allow setups where libprotobuf is available, but not configured through protobuf. Moreover, if CheckLib fails to use libprotobuf then all the tracing is disabled, but scons is allowed to continue with a warning.
2013-01-07scons: Enforce gcc >= 4.4 or clang >= 2.9 and c++0x supportAndreas Hansson
This patch checks that the compiler in use is either gcc >= 4.4 or clang >= 2.9. and enables building with --std=c++0x in all cases. As a consequence, we can tidy up the hashmap and always have static_assert available. If anyone wants to use alternative compilers, icc for example supports c++0x to a similar level and could be added if needed. This patch opens up for a more elaborate use of c++0x features that are present in gcc 4.4 and clang 2.9, e.g. auto typed variables, variadic templates, rvalues and move semantics, and strongly typed enums. There will be no going back on this one...
2013-01-07scons: Remove stale compiler optionsAndreas Hansson
This patch simply prunes the SUNCC and ICC compiler options as they are both sufficiently stale that they would have to be re-written from scratch anyhow. The patch serves to clean things up before shifting to a build environment that enforces basic c++11 compliance as done in the following patch.
2013-01-07scons: Whitelist useful environment variablesAndreas Sandberg
Scons normally removes all environment variables that aren't whitelisted from the build environment. This messes up things like ccache, distcc, and the clang static analyzer. This changeset adds the DISTCC_, CCACHE_, and CCC_ prefixes to the environment variable whitelist.
2013-01-07scons: Add support for google protobuf buildingAndreas Hansson
This patch enables the use of protobuf input files in the build process, thus allowing .proto files to be added to input. Each .proto file is compiled using the protoc tool and the newly created C++ source is added to the list of sources. The first location where the protobufs will be used is in the capturing and replay of memory traces, involving the communication monitor and the trace-generator state of the traffic generator. This will follow in the next patch. This patch does add a dependency on the availability of the BSD licensed protobuf library (and headers), and the protobuf compiler, protoc. These dependencies are checked in the SConstruct, similar to e.g. swig. The user can override the use of protoc from the PATH by specifying the PROTOC environment variable. Although the dependency on libprotobuf and protoc might seem like a big step, they add significant value to the project going forward. Execution traces and other types of traces could easily be added and parsers for C++ and Python are automatically generated. We could also envision using protobufs for the checkpoints, description of the traffic-generator behaviour etc. The sky is the limit. We could also use the GzipOutputStream from the protobuf library instead of the current GPL gzstream. Currently, only the C++ source and header is generated. Going forward we might want to add the Python output to support simple command-line tools for displaying and editing the traces.
2012-09-25base: Check for static_assert support and provide fallbackAndreas Sandberg
C++11 has support for static_asserts to provide compile-time assertion checking. This is very useful when testing, for example, structure sizes to make sure that the compiler got the right alignment or vector sizes.
2012-09-21Scons: Verbose messages when dependencies are not installedAndreas Hansson
This patch adds a few more checks to ensure that a compiler is present on the system, along with swig. It references the relevant packages on Ubuntu/RedHat, and also adds a similar line for the Python headers.
2012-09-14gcc: Enable Link-Time Optimization for gcc >= 4.6Andreas Hansson
This patch adds Link-Time Optimization when building the fast target using gcc >= 4.6, and adds a scons flag to disable it (-no-lto). No check is performed to guarantee that the linker supports LTO and use of the linker plugin, so the user has to ensure that binutils GNU ld >= 2.21 or the gold linker is available. Typically, if gcc >= 4.6 is available, the latter should not be a problem. Currently the LTO option is only useful for gcc >= 4.6, due to the limited support on clang and earlier versions of gcc. The intention is to also add support for clang once the LTO integration matures. The same number of jobs is used for the parallel phase of LTO as the jobs specified on the scons command line, using the -flto=n flag that was introduced with gcc 4.6. The gold linker also supports concurrent and incremental linking, but this is not used at this point. The compilation and linking time is increased by almost 50% on average, although ARM seems to be particularly demanding with an increase of almost 100%. Also beware when using this as gcc uses a tremendous amount of memory and temp space in the process. You have been warned. After some careful consideration, and plenty discussions, the flag is only added to the fast target, and the warning that was issued in an earlier version of this patch is now removed. Similarly, the flag used to enable LTO, now the default is to use it, and the flag has been modified to disable LTO. The rationale behind this decision is that opt is used for development, whereas fast is only used for long runs, e.g. regressions or more elaborate experiments where the additional compile and link time is amortized by a much larger run time. When it comes to the return on investment, the regression seems to be roughly 15% faster with LTO. For a bit more detail, I ran twolf on ARM.fast, with three repeated runs, and they all finish within 42 minutes (+- 25 seconds) without LTO and 31 minutes (+- 25 seconds) with LTO, i.e. LTO gives an impressive >25% speed-up for this case. Without LTO (ARM.fast twolf) real 42m37.632s user 42m34.448s sys 0m0.390s real 41m51.793s user 41m50.384s sys 0m0.131s real 41m45.491s user 41m39.791s sys 0m0.139s With LTO (ARM.fast twolf) real 30m33.588s user 30m5.701s sys 0m0.141s real 31m27.791s user 31m24.674s sys 0m0.111s real 31m25.500s user 31m16.731s sys 0m0.106s
2012-09-14scons: Use c++0x with gcc >= 4.4 instead of 4.6Andreas Hansson
This patch shifts the version of gcc for which we enable c++0x from 4.6 to 4.4 The more long term plan is to see what the c++0x features can bring and what level of support would be enabled simply by bumping the required version of gcc from 4.3 to 4.4. A few minor things had to be fixed in the code base, most notably the choice of a hashmap implementation. In the Ruby Sequencer there were also a few minor issues that gcc 4.4 was not too happy about.
2012-09-12Ruby: Modify Scons so that we can put .sm files in extrasJason Power
Also allows for header files which are required in slicc generated code to be in a directory other than src/mem/ruby/slicc_interface.
2012-07-12scons: Add LIBRARY_PATH from the user environment to SconsAndreas Hansson
This patch adds the LIBRARY_PATH from the users OS environment to Scons build environment. This path is used when linking to search for libraries, and this patch enables tcmalloc to be used during the build even if it is not placed in the default search paths.
2012-06-20swig: Use SWIG from environment when determining versionAndreas Hansson
This patch fixes a minor issue in the SConstruct where a hardcoded swig is used instead of the environment SWIG when determining the version.
2012-06-18Build: Point to the appropriate tcmalloc packageAndreas Hansson
This patch updates the message printed if the user does not have tcmalloc available. It turns out that the correct package (which creates all required symlinks etc) is libgoogle-perftools-dev. This has been verified on Ubuntu 12.04.
2012-06-11scons: Make compiler version error more verbose and easier to debug.Ali Saidi
2012-06-05sim: Add support for tcmalloc if it's installed and available.Ali Saidi
This package is available in Ubuntu, Debian, and Redhat as google-perftools. With multiple tests on a single machine I've seen a little over 10% performance gain with tcmalloc.
2012-06-05sim: Remove FastAllocAli Saidi
While FastAlloc provides a small performance increase (~1.5%) over regular malloc it isn't thread safe. After removing FastAlloc and using tcmalloc I've seen a performance increase of 12% over libc malloc when running twolf for ARM.
2012-05-08scons: allow override of SWIG binary on command lineSteve Reinhardt
2012-04-23scons: update minimum SWIG version to 1.3.34Steve Reinhardt
We should try to keep this synced with the wiki (which I also just updated, but which was previously inconsistent).
2012-04-14Regression: Add ANSI colours to highlight test statusAndreas Hansson
This patch adds a very basic pretty-printing of the test status (passed or failed) to highlight failing tests even more: green for passed, and red for failed. The printing only uses ANSI it the target output is a tty and supports ANSI colours. Hence, any regression scripts that are outputting to files or sending e-mails etc should still be fine.
2012-04-14clang/gcc: Fix compilation issues with clang 3.0 and gcc 4.6Andreas Hansson
This patch addresses a number of minor issues that cause problems when compiling with clang >= 3.0 and gcc >= 4.6. Most importantly, it avoids using the deprecated ext/hash_map and instead uses unordered_map (and similarly so for the hash_set). To make use of the new STL containers, g++ and clang has to be invoked with "-std=c++0x", and this is now added for all gcc versions >= 4.6, and for clang >= 3.0. For gcc >= 4.3 and <= 4.5 and clang <= 3.0 we use the tr1 unordered_map to avoid the deprecation warning. The addition of c++0x in turn causes a few problems, as the compiler is more stringent and adds a number of new warnings. Below, the most important issues are enumerated: 1) the use of namespaces is more strict, e.g. for isnan, and all headers opening the entire namespace std are now fixed. 2) another other issue caused by the more stringent compiler is the narrowing of the embedded python, which used to be a char array, and is now unsigned char since there were values larger than 128. 3) a particularly odd issue that arose with the new c++0x behaviour is found in range.hh, where the operator< causes gcc to complain about the template type parsing (the "<" is interpreted as the beginning of a template argument), and the problem seems to be related to the begin/end members introduced for the range-type iteration, which is a new feature in c++11. As a minor update, this patch also fixes the build flags for the clang debug target that used to be shared with gcc and incorrectly use "-ggdb".
2012-03-16build: remove implicit-cache setting of scons from recent build faster patchMarc Orr
2012-03-09CheckerCPU: Make CheckerCPU runtime selectable instead of compile selectableGeoffrey Blake
Enables the CheckerCPU to be selected at runtime with the --checker option from the configs/example/fs.py and configs/example/se.py configuration files. Also merges with the SE/FS changes.
2012-03-06build scripts: Made minor modifications to reduce build overhead time.Marc Orr
1. --implicit-cache behavior is default. 2. makeEnv in src/SConscript is conditionally called. 3. decider set to MD5-timestamp 4. NO_HTML build option changed to SLICC_HTML (defaults to False)
2012-03-02SConstruct: rename and document AddM5OptionSteve Reinhardt
Got rid of gratuitous M5 reference in the function name. In the process, wondered why we have this function at all and spent time trying to get rid of it and eventually firgured out why it's needed. Put the answer in a comment so we don't have to wonder again.
2012-03-02SConstruct: update comments & doc stringsSteve Reinhardt
Lots of references to 'M5' still, and some to SE/FS
2012-01-31Merge with head, hopefully the last time for this batch.Gabe Black
2012-01-31clang: Enable compiling gem5 using clang 2.9 and 3.0Koan-Sin Tan
This patch adds the necessary flags to the SConstruct and SConscript files for compiling using clang 2.9 and later (on Ubuntu et al and OSX XCode 4.2), and also cleans up a bunch of compiler warnings found by clang. Most of the warnings are related to hidden virtual functions, comparisons with unsigneds >= 0, and if-statements with empty bodies. A number of mismatches between struct and class are also fixed. clang 2.8 is not working as it has problems with class names that occur in multiple namespaces (e.g. Statistics in kernel_stats.hh). clang has a bug (http://llvm.org/bugs/show_bug.cgi?id=7247) which causes confusion between the container std::set and the function Packet::set, and this is currently addressed by not including the entire namespace std, but rather selecting e.g. "using std::vector" in the appropriate places.
2012-01-28SE/FS: Get rid of the FULL_SYSTEM config option.Gabe Black
2012-01-09MAC: Make gem5 compile and run on MacOSX 10.7.2Andreas Hansson
Adaptations to make gem5 compile and run on OSX 10.7.2, with a stock gcc 4.2.1 and the remaining dependencies from macports, i.e. python 2.7,.2 swig 2.0.4, mercurial 2.0. The changes include an adaptation of the SConstruct to handle non-library linker flags, and Darwin-specific code to find the memory usage of gem5. A number of Ruby files relied on ambigious uint (without the 32 suffix) which caused compilation errors.
2011-11-09GCC: Guard some gcc flags so they're used when available and needed.Gabe Black
2011-08-08BuildEnv: Eliminate RUBY as build environment variableNilay Vaish
This patch replaces RUBY with PROTOCOL in all the SConscript files as the environment variable that decides whether or not certain components of the simulator are compiled.