ISA-Specific Compilation

From gem5

Jump to: navigation, search

We need three things:

  1. the ability to say "include isa_traits.hh" or "include endian.hh" in some syntax and get the right file
  2. the ability to call an ISA-specific function and get the right implementation, e.g. htog(foo) or decode(inst)
  3. the ability to say "if (ISA == Alpha)" in some syntax to insert isa-specific code in mostly non-isa-specific files (obviously we want to minimize this, but it will be difficult to avoid completely)

Here's my proposed solution:

#define ALPHA_ISA 21064
#define SPARC_ISA 42
#if THE_ISA == ALPHA_ISA
#include "arch/alpha/isa_traits.hh"
#define TheISA AlphaISA
#elif THE_ISA == SPARC_ISA
#include "arch/sparc/isa_traits.hh"
#define TheISA SparcISA
#else
#error "THE_ISA not set"
#endif

Note: we should add "-Wundef" to our standard command line to avoid disasters.


Selectively compiling operating system files

Currently, when compiling m5, all operating system files are compiled in. In some cases this doesn't make sense, like compiling Tru64 support code for SPARC. This is also causing some compilation errors. We seem to need a way to specify which operating systems we want to compile similarly to how we can specify what processor models to use. --Gblack 16:55, 20 March 2006 (EST)

Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox