Modular IDE: Source Code & Build Overview


Code Overview

Directories used by old-style and Modular IDE

stand/arcs/ide:
top IDE directory
stand/arcs/ide/IPXX
Cpu specific IDE test code
stand/arcs/ide/common
Generates libidecmn.a. Contains the basic code needed for IDE initialization, executing IDE tests, and script parsing. This code is built into Core IDE.
stand/arcs/ide/fforward
stand/arcs/ide/godzilla
Directories that contain the actual test code for various architectures. This code resides in the modules.

New Directories for Modular IDE

stand/arcs/ide/elf
Code that generates libideelf.a. This library contains the code that enables core to load dynamic modules and do symbol resolution. This code is built into Core IDE.
stand/arcs/ide/module
Common code that is used by all modules. Basically just module bring up code.
stand/arcs/ide/IPXX/modules
Where one can build all of the modules for a CPU board. This directory contains a directory for each module xxx. Each module directory contains the module's script in a text file called module_xxx_script (this file generates module_xxx_script_code.c via the module_startup.awk script), and a list of diagcmds for module xxx in the file xxx_diagcmds (this file generates module_xxx.c via the builtins.awk script).

Target directory overview

stand/arcs/ide/${PRODUCT}core.O/
All core objects and the core binary core.ide itself are placed in this directory. This is done by using the LIBTYPE=core directive in the makefiles. All objects in this directory are -non_shared (i.e. NOT PIC code).
stand/arcs/ide/${PRODUCT}modules.O/
The common (eg common to all modules) module objects are built in this directory. This is done by using the LIBTYPE=modules directive in the makefiles. These are just the objects from stand/arcs/ide/module/. All objects in this directory are -shared (i.e. PIC code).
stand/arcs/ide/${PRODUCT}module_cpu.O/
All object needed to build the module_cpu IDE module are placed in this directory and linked together to build modular_ide. This is done by using the LIBTYPE=module_cpu directive in the makefiles. All objects in this directory are -shared (i.e. PIC code).

stand/arcs/ide/Makefile

From the stand/arcs/ide/Makefile one can build the binaries needed for Modular IDE (i.e. core.ide and all of the modules module_*). Here are some useful rules:

  1. make modular: Builds core and all of the modules (like doing make core ; make modules).
  2. make core: Only builds the core. Depends on:
    1. libidecmn.a which is built in stand/arcs/ide/common
    2. libideelf.a which is built in stand/arcs/ide/elf
    3. libidecore.a which is built from some files in stand/arcs/ide/{fforward,godzilla}and some files in stand/arcs/ide/IPXX via make core and make _core in those subdirectories.
    4. libsk.a which is built in stand/arcs/lib/libsk
    5. libsc.a which is built in stand/arcs/lib/libsc
  3. make modules: Only builds the modules. Depends on:
    1. module.o and module_asm.o from stand/arcs/ide/module (i.e. make module)
    2. stand/arcs/ide/${PRODUCT}module_XX.O/*.o from stand/arcs/ide/{fforward,godzilla} via make module and make _module in those subdirectories (i.e. cd {fforward.godzilla} ; make module) - this is were most of the actual test code resides. Remember that modules must have their objects compiled as -shared while the old shell and field IDE's compile everything -non_shared.
    3. module_XX.o and module_XX_script_code.o from stand/arcs/ide/IPXX/modules/module_XX
  4. make elf: builds the stand/arcs/ide/elf directory
  5. make module: builds the stand/arcs/ide/module directory

Build Overview

Core

Core IDE is built -non_shared with specified load addresses for data (-D) and text (-T). To pick up all libsk and libsc library functions, core.ide is linked with -all (note this makes a larger than necessary binary, since the modules only use a subset of libsk and libsc). WARNING: Currently linking core.ide with -all does not work because there are some missing symbols in libsk and libsc. The workaround is to link core.ide with the -U option (ignore undefined symbols). This is dangerous since run-time errors may result. So if you change core.ide, first compile with -U to make sure that no important symbols are missing !

Modules

A module is built -shared with specified load addresses for data (-D) and text (-T). Note that when linking with -shared, unresolved symbols do NOT cause an error since shared objects usually rely on rld to resolve symbols at run time. A module is built with -no_unresolved only to print a warning for each undefined symbol. These symbols will be later resolved by Core IDE. Note that its usually good to check this list since an undefined symbol which should have been in the module, will NOT show up as an error at this stage - if a module failed to define one of its own symbols, Core IDE will fail at load-time with an unresolved symbol error.


stojanof@engr.sgi.com