3.1.1.1. TI ARM CGT

The tool is located in tools/waf-tools.

3.1.1.1.1. Tool Documentation

Implements a waf tool to use TI ARM CGT (https://www.ti.com/tool/ARM-CGT).

filters which output files are not meant to be linked

class f_ti_arm_cgt.asm(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

class to run the TI ARM CGT compiler in compiler mode to create object files from assembler sources.

digraph ASM_TO_OBJECT {
    compound=true;
    rankdir=LR;
    nd_armcl [label="armcl", style=filled, fillcolor=green];
    nd_asm  [label="*.asm", style=filled];
    nd_obj  [label="*.obj", style=filled];
    subgraph cluster_cmd {
        label = "Command Line";
        rank=same;
        nd_cflags           [label="CFLAGS"];
        nd_cc_compile_only  [label="CC_COMPILE_ONLY"];
        nd_incpaths         [label="INCPATHS"];
        nd_defines          [label="DEFINES"];
    }
    nd_armcl    -> nd_cflags    [lhead=cluster_cmd];
    nd_asm      -> nd_cflags    [lhead=cluster_cmd];
    nd_cflags   -> nd_obj       [ltail=cluster_cmd];
}

Fig. 3.5 Input-output relation for assembler source files

ext_in = ['.h']

extensions that trigger a re-build

Type

list of str

keyword()

displayed keyword when assembler source files are compiled

run_str = '${CC} ${CFLAGS} ${CC_COMPILE_ONLY} ${ASM_DIRECTORY}${TGT[0].parent.bldpath()} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${SRC} ${CC_TGT_F}${TGT[0].relpath()}'

string to be interpolated to create the command line to compile assembler files. See Fig. 3.5 for a simplified representation

Type

str

scan

function to be used as scanner method

Type

fun

vars = ['CCDEPS']

values that effect the signature calculation

Type

list of str

class f_ti_arm_cgt.bingen(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

Task create bin file from elf files

after = ['link_task']

tasks after that hexgen task can be run

Type

list of str

color = 'CYAN'

color in which the command line is displayed in the terminal

Type

str

keyword()

displayed keyword when generating the bin file

run_str = '${TIOBJ2BIN} ${SRC[0].abspath()} ${TGT[0].abspath()} ${ARMOFD} ${ARMHEX} ${MKHEX4BIN}'

string to be interpolated to create the command line to create a bin file from an elf file.

Type

str

class f_ti_arm_cgt.c(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

This class implements the TI ARM CGT compiler in compiler mode to create object files from c sources. Additionally an aux file (user information file), a crl files (cross-reference listing file) and a rl file (output preprocessor listing) are generated.

digraph C_TO_OBJECT {
    compound=true;
    rankdir=LR;
    nd_armcl [label="armcl", style=filled, fillcolor=green];
    nd_c    [label="*.c", style=filled];
    nd_obj  [label="*.obj", style=filled];
    nd_aux  [label="*.aux", style=filled];
    nd_crl  [label="*.crl", style=filled];
    nd_rl   [label="*.rl", style=filled];
    subgraph cluster_cmd {
        label = "Command Line";
        rank=same;
        nd_cflags               [label="CFLAGS"];
        nd_cflags_compile_only  [label="CFLAGS_COMPILE_ONLY"];
        nd_cc_compile_only      [label="CC_COMPILE_ONLY"];
        nd_incpaths             [label="INCPATHS"];
        nd_defines              [label="DEFINES"];
    }
    nd_armcl    ->  nd_cflags   [lhead=cluster_cmd];
    nd_c        ->  nd_cflags   [lhead=cluster_cmd];
    nd_cflags   ->  nd_obj      [ltail=cluster_cmd];
    nd_cflags   ->  nd_aux      [ltail=cluster_cmd];
    nd_cflags   ->  nd_crl      [ltail=cluster_cmd];
    nd_cflags   ->  nd_rl       [ltail=cluster_cmd];
}

Fig. 3.6 Input-output relation for assembler source files

ext_in = ['.h']

extensions that trigger a re-build

Type

list of str

keyword()

displayed keyword when source files are compiled

run_str = '${CC} ${CFLAGS} ${CMD_FILES_ST:CMD_FILES} ${CFLAGS_COMPILE_ONLY} ${CC_COMPILE_ONLY} ${OBJ_DIRECTORY}${TGT[0].parent.bldpath()} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${SRC[0].abspath()} ${CC_TGT_F}${TGT[0].abspath()}'

string to be interpolated to create the command line to compile C files. See Fig. 3.6 for a simplified representation

Type

str

scan

function to be used as scanner method

Type

fun

vars = ['CCDEPS', 'CMD_FILES_HASH']

values that effect the signature calculation

Type

list of str

class f_ti_arm_cgt.c_pp(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

class to run the TI ARM CGT compiler in “preproc_only” mode, to have a pp file that includes the preprocess information

digraph C_TO_PPI {
    compound=true;
    rankdir=LR;
    nd_armcl [label="armcl", style=filled, fillcolor=green];
    nd_c    [label="*.c", style=filled];
    nd_pp   [label="*.pp", style=filled];
    subgraph cluster_cmd {
        label = "Command Line";
        rank=same;
        nd_cflags       [label="CFLAGS"];
        nd_cflags_pp    [label="PP"];
        nd_incpaths     [label="INCPATHS"];
        nd_defines      [label="DEFINES"];
    }
    nd_armcl    ->  nd_cflags   [lhead=cluster_cmd];
    nd_c        ->  nd_cflags   [lhead=cluster_cmd];
    nd_cflags   ->  nd_ppi      [ltail=cluster_cmd];
}

Fig. 3.7 Input-output relation for C source files and preprocess information

color = 'CYAN'

color in which the command line is displayed in the terminal

Type

str

ext_in = ['.h']

extensions that trigger a re-build

Type

list of str

keyword()

displayed keyword when source files are parsed for pp information

run_str = '${CC} ${CFLAGS} ${CMD_FILES_ST:CMD_FILES} ${PPO} ${CC_TGT_F}${TGT[0].abspath()} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${SRC[0].abspath()}'

string to be interpolated to create the command line to get include information from C files. See Fig. 3.7 for a simplified representation

Type

str

scan

function to be used as scanner method

Type

fun

vars = ['CCDEPS', 'CMD_FILES_HASH']

values that effect the signature calculation

Type

list of str

class f_ti_arm_cgt.c_ppd(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

class to run the TI ARM CGT compiler in “preproc_dependency” mode, to have a ppd file that includes dependency information

digraph C_TO_PPD {
    compound=true;
    rankdir=LR;
    nd_armcl [label="armcl", style=filled, fillcolor=green];
    nd_c    [label="*.c", style=filled];
    nd_ppd  [label="*.ppd", style=filled];
    subgraph cluster_cmd {
        label = "Command Line";
        rank=same;
        nd_cflags       [label="CFLAGS"];
        nd_cflags_ppd   [label="PPD"];
        nd_incpaths     [label="INCPATHS"];
        nd_defines      [label="DEFINES"];
    }
    nd_armcl    ->  nd_cflags   [lhead=cluster_cmd];
    nd_c        ->  nd_cflags   [lhead=cluster_cmd];
    nd_cflags   ->  nd_ppd      [ltail=cluster_cmd];
}

Fig. 3.8 Input-output relation for C source files and include information

color = 'CYAN'

color in which the command line is displayed in the terminal

Type

str

ext_in = ['.h']

extensions that trigger a re-build

Type

list of str

keyword()

displayed keyword when source files are parsed for ppd information

run_str = '${CC} ${CFLAGS} ${CMD_FILES_ST:CMD_FILES} ${PPD} ${CC_TGT_F}${TGT[0].abspath()} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${SRC[0].abspath()}'

string to be interpolated to create the command line to get dependency information from C files. See Fig. 3.8 for a simplified representation

Type

str

scan

function to be used as scanner method

Type

fun

vars = ['CCDEPS', 'CMD_FILES_HASH']

values that effect the signature calculation

Type

list of str

class f_ti_arm_cgt.c_ppi(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

class to run the TI ARM CGT compiler in “preproc_includes” mode, to have a ppi file that includes the include information

digraph C_TO_PPI {
    compound=true;
    rankdir=LR;
    nd_armcl [label="armcl", style=filled, fillcolor=green];
    nd_c    [label="*.c", style=filled];
    nd_ppi  [label="*.ppi", style=filled];
    subgraph cluster_cmd {
        label = "Command Line";
        rank=same;
        nd_cflags       [label="CFLAGS"];
        nd_cflags_ppi   [label="PPI"];
        nd_incpaths     [label="INCPATHS"];
        nd_defines      [label="DEFINES"];
    }
    nd_armcl    ->  nd_cflags   [lhead=cluster_cmd];
    nd_c        ->  nd_cflags   [lhead=cluster_cmd];
    nd_cflags   ->  nd_ppi      [ltail=cluster_cmd];
}

Fig. 3.9 Input-output relation for C source files and include information

color = 'CYAN'

color in which the command line is displayed in the terminal

Type

str

ext_in = ['.h']

extensions that trigger a re-build

Type

list of str

keyword()

displayed keyword when source files are parsed for ppi information

run_str = '${CC} ${CFLAGS} ${CMD_FILES_ST:CMD_FILES} ${PPI} ${CC_TGT_F}${TGT[0].abspath()} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${SRC[0].abspath()}'

string to be interpolated to create the command line to get include information from C files. See Fig. 3.9 for a simplified representation

Type

str

scan

function to be used as scanner method

Type

fun

vars = ['CCDEPS', 'CMD_FILES_HASH']

values that effect the signature calculation

Type

list of str

class f_ti_arm_cgt.c_ppm(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

class to run the TI ARM CGT compiler in “preproc_macros” mode, to have a ppm file that includes all compile time macros

digraph C_TO_PPM {
    compound=true;
    rankdir=LR;
    nd_armcl [label="armcl", style=filled, fillcolor=green];
    nd_c    [label="*.c", style=filled];
    nd_ppm  [label="*.ppm", style=filled];
    subgraph cluster_cmd {
        label = "Command Line";
        rank=same;
        nd_cflags       [label="CFLAGS"];
        nd_cflags_ppm   [label="PPM"];
        nd_incpaths     [label="INCPATHS"];
        nd_defines      [label="DEFINES"];
    }
    nd_armcl    ->  nd_cflags   [lhead=cluster_cmd];
    nd_c        ->  nd_cflags   [lhead=cluster_cmd];
    nd_cflags   ->  nd_ppm      [ltail=cluster_cmd];
}

Fig. 3.10 Input-output relation for C source files and include information

color = 'CYAN'

color in which the command line is displayed in the terminal

Type

str

ext_in = ['.h']

extensions that trigger a re-build

Type

list of str

keyword()

displayed keyword when source files are parsed for ppm information

run_str = '${CC} ${CFLAGS} ${CMD_FILES_ST:CMD_FILES} ${PPM} ${CC_TGT_F}${TGT[0].abspath()} ${CPPPATH_ST:INCPATHS} ${DEFINES_ST:DEFINES} ${SRC[0].abspath()}'

string to be interpolated to create the command line to get macro information from C files. See Fig. 3.10 for a simplified representation

Type

str

scan

function to be used as scanner method

Type

fun

vars = ['CCDEPS', 'CMD_FILES_HASH']

values that effect the signature calculation

Type

list of str

f_ti_arm_cgt.cgt_flags(conf)

sets flags and related configuration options of the compiler.

class f_ti_arm_cgt.clean_pp_file(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

Task to remove some information from the preprocessed files

color = 'PINK'

color in which the command line is displayed in the terminal

Type

str

keyword()

displayed keyword when post-processing the pre-processed files

remove_str = ('#define', '#pragma', '# pragma', '_Pragma')

strings that need to be removed from the preprocessed file

Type

tuple

replace_str = [('__attribute__\\(.*\\)', '')]

regular expressions that should be removed with a certain string

Type

list

run()

Removes empty lines and strips some intrinsics that should not be included in the postprocessed file

f_ti_arm_cgt.configure(conf)

configuration step of the TI ARM CGT compiler tool

class f_ti_arm_cgt.copy_elf(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

This class implements the copying of the elf file to another location in the build tree

after = ['link_task']

tasks after that hexgen task can be run

Type

list of str

color = 'CYAN'

color in which the command line is displayed in the terminal

Type

str

keyword()

displayed keyword when copying the elf file

run()

copy the generated elf file to build directory of the variant

weight = 3

priority of the task

Type

int

class f_ti_arm_cgt.cprogram(*args: Any, **kwargs: Any)

Bases: waflib.Tools.ccroot.link_task

class to run the TI ARM CGT compiler in linker mode to create the target

ext_out = ['.elf']

extensions that trigger a re-build

Type

list of str

keyword()

displayed keyword when black is linking the target

static parse_output(pull_config, obj_path, std)

parses the output of the linker

vars = ['LINKDEPS', 'CMD_FILES_HASH']

values that effect the signature calculation

Type

list of str

f_ti_arm_cgt.create_compiled_task_asm(self, name, node)

creates the assembler task and binds it to the f_ti_arm_cgt.asm class.

The created tasks are appended to the list of compiled_tasks.

f_ti_arm_cgt.create_compiled_task_c(self, name, node)

Creates the assembler task and binds it to the f_ti_arm_cgt.c class.

The created tasks are appended to the list of compiled_tasks.

f_ti_arm_cgt.create_compiled_task_c_pp(self, name, node)

Creates the pp task and binds it to the f_ti_arm_cgt.c_pp class.

f_ti_arm_cgt.create_compiled_task_c_ppd(self, name, node)

Creates the ppd task and binds it to the f_ti_arm_cgt.c_ppd class.

f_ti_arm_cgt.create_compiled_task_c_ppi(self, name, node)

Creates the ppi task and binds it to the f_ti_arm_cgt.c_ppi class.

f_ti_arm_cgt.create_compiled_task_c_ppm(self, name, node)

Creates the ppm task and binds it to the f_ti_arm_cgt.c_ppm class.

class f_ti_arm_cgt.create_version_source(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

creates the version information file

before = ['c']

specifies task, that this task needs to run before

Type

list of str

color = 'BLUE'

color in which the command line is displayed in the terminal

Type

str

ext_out = ['.h']

extensions that trigger a re-build

Type

list of str

get_remote()

returns the git remote

get_repo_dirty_from_git()

returns a boolean marking if the project’s working directory is dirty (which means it contains unstaged changes)

get_version_from_git()

returns a version string that is extracted directly from the underlying git repository

run()

Created the version information files

sig_explicit_deps()

Defines how to get signature of this task (and thus when to rerun it)

weight = 1

priority of the task

Type

int

class f_ti_arm_cgt.cstlib(*args: Any, **kwargs: Any)

Bases: f_ti_arm_cgt.stlink_task

c static library

f_ti_arm_cgt.find_armar(conf)

configures the archive tool

f_ti_arm_cgt.find_armcl(conf)

configures the compiler, determines the compiler version, and sets the default include paths.

class f_ti_arm_cgt.hexgen(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

Task create hex file from elf files

after = ['link_task']

tasks after that hexgen task can be run

Type

list of str

color = 'YELLOW'

color in which the command line is displayed in the terminal

Type

str

keyword()

displayed keyword when generating the hex file

run_str = '${ARMHEX} -q ${HEXGENFLAGS} --map=${TGT[1].abspath()} ${LINKER_SCRIPT_HEX} ${SRC[0].abspath()} -o ${TGT[0].abspath()}'

string to be interpolated to create the command line to create a hex file from an elf file.

Type

str

class f_ti_arm_cgt.nm(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

Task to run armnm on all input files

color = 'PINK'

color in which the command line is displayed in the terminal

Type

str

keyword()

displayed keyword when armnm is run on object files

run_str = '${ARMNM} ${NMFLAGS} --output=${TGT} ${SRC}'

string to be interpolated to create the command line to create a nm file from an *.obj, *.a or *.elf file.

Type

str

f_ti_arm_cgt.options(opt)

Configurable options of the f_ti_arm_cgt tool.

Furthermore the default formatter gets replaced by f_ti_arm_cgt.armclFormatter.

class f_ti_arm_cgt.print_swi(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

gathers all swi information in one file

keyword()

displayed keyword when this check is run

run()

combines all swi information in one file

f_ti_arm_cgt.remove_targets(task)

General helper function to remove targets

class f_ti_arm_cgt.search_swi(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

Searches for swi aliases based on a regular expression

keyword()

displayed keyword when this check is run

run()

does the search check

class f_ti_arm_cgt.size(*args: Any, **kwargs: Any)

Bases: waflib.Task.Task

Task to run size on all input files

color = 'BLUE'

color in which the command line is displayed in the terminal

Type

str

keyword()

displayed keyword when size is run on object files

run()

implements the actual behavior of size and pipes the output into a file.

Bases: waflib.Tools.ccroot.link_task

static link task

displayed keyword when linking

f_ti_arm_cgt.tiprogram(bld, *k, **kw)

wrapper for bld.program for simpler target configuration. The linker script is added as env input/output dependency for the target. Based on the target name all related targets are created:

  • binary: <target>.<format>

  • linker information: <target>.<format>.xml

  • map information: <target>.<format>.map