blob: 2e09029db21b8010f89a0fa636e464f813013a5e [file] [log] [blame]
/*
* ======== package/cfg/prog_x64P.cfg ========
* This generated configuration script runs the user's configuration script
* the context of a specific target and platform in order to generate
* all the files necessary to create an executable; e.g., linker command
* files, static C/C++ data structures, etc.
*/
/*
* ======== _runescape ========
* Recursive unescape to decode serialized strings
*/
function _runescape(obj) {
for (var i in obj) {
if (obj[i] != null) {
if (typeof obj[i] == 'string') {
obj[i] = unescape(obj[i]);
}
else if (typeof obj[i] == 'object') {
_runescape(obj[i]);
}
}
}
}
/*
* ======== _getPlatCfg ========
*/
function _getPlatCfg() {
var tmp = {};
_runescape(tmp);
return (tmp);
}
/*
* ======== _cfginit ========
*/
function _cfginit() {
xdc.loadPackage('xdc.services.intern.cmd');
var prog = xdc.om['xdc.cfg.Program'];
/* initialize prog attrs from build model */
var build = {
releases: {
0: {
name: "hello_pkg",
attrs: {
prefix: "",
label: "default"
},
otherFiles: {}
}
},
target: {
$name:"ti.targets.C64P",
name: "C64P",
suffix: "64P",
compatibleSuffixes: {
$name:"ti.targets.C64P/compatibleSuffixes",
0: "64",
1: "62"
},
isa: "64P",
model: {
$name:"ti.targets.C64P/model",
endian: "little"
},
rts: "ti.targets.rts6000",
base: {
$name:"ti.targets.C62",
name: "C62",
suffix: "62",
compatibleSuffixes: {
$name:"ti.targets.C62/compatibleSuffixes",
},
isa: "62",
model: {
$name:"ti.targets.C62/model",
endian: "little"
},
rts: "ti.targets.rts6000",
platform: "ti.platforms.sim6xxx%3ATMS320C6211",
platforms: {
$name:"ti.targets.C62/platforms",
},
binaryParser: "ti.targets.omf.cof.Coff",
debugGen: {
$name:"ti.targets.C62/debugGen",
execTemplate: "ti/targets/ccs_exec.xdt",
execPattern: "%24%28cfgDir%29%24%28cfgName%29.pjt",
packageTemplate: "ti/targets/ccs_package.xdt",
packagePattern: "package/%24%28pkgName%29.pjt"
},
extensions: {
$name:"ti.targets.C62/extensions",
".s62": {
$name:"ti.targets.C62/extensions/'.s62'",
suf: ".s62",
typ: "asm"
},
".asm": {
$name:"ti.targets.C62/extensions/'.asm'",
suf: ".asm",
typ: "asm"
},
".c": {
$name:"ti.targets.C62/extensions/'.c'",
suf: ".c",
typ: "c"
},
".cpp": {
$name:"ti.targets.C62/extensions/'.cpp'",
suf: ".cpp",
typ: "cpp"
},
".cxx": {
$name:"ti.targets.C62/extensions/'.cxx'",
suf: ".cxx",
typ: "cpp"
},
".C": {
$name:"ti.targets.C62/extensions/'.C'",
suf: ".C",
typ: "cpp"
},
".cc": {
$name:"ti.targets.C62/extensions/'.cc'",
suf: ".cc",
typ: "cpp"
}
},
versionMap: {
$name:"ti.targets.C62/versionMap",
"TMS320C6x_4.32": "1%2C0%2C4.32%2C0",
"TMS320C55x_2.56": "1%2C0%2C2.56%2C0",
"TMS320C54x_3.83": "1%2C0%2C3.83%2C0",
"TMS320C2000_3.07": "1%2C0%2C3.07%2C0"
},
alignDirectiveSupported: true,
profiles: {
$name:"ti.targets.C62/profiles",
debug: {
$name:"ti.targets.C62/profiles/'debug'",
compileOpts: {
$name:"ti.targets.C62/profiles/'debug'/compileOpts",
copts: "-g",
defs: "-D_DEBUG_%3D1"
},
filters: {
$name:"ti.targets.C62/profiles/'debug'/filters",
}
},
release: {
$name:"ti.targets.C62/profiles/'release'",
compileOpts: {
$name:"ti.targets.C62/profiles/'release'/compileOpts",
copts: "-O2"
},
filters: {
$name:"ti.targets.C62/profiles/'release'/filters",
}
},
profile: {
$name:"ti.targets.C62/profiles/'profile'",
compileOpts: {
$name:"ti.targets.C62/profiles/'profile'/compileOpts",
copts: "-gp"
},
filters: {
$name:"ti.targets.C62/profiles/'profile'/filters",
}
},
coverage: {
$name:"ti.targets.C62/profiles/'coverage'",
compileOpts: {
$name:"ti.targets.C62/profiles/'coverage'/compileOpts",
copts: "-gp"
},
filters: {
$name:"ti.targets.C62/profiles/'coverage'/filters",
}
},
whole_program: {
$name:"ti.targets.C62/profiles/'whole_program'",
compileOpts: {
$name:"ti.targets.C62/profiles/'whole_program'/compileOpts",
copts: "-oe%20-O2%20-mo"
},
filters: {
$name:"ti.targets.C62/profiles/'whole_program'/filters",
}
},
whole_program_debug: {
$name:"ti.targets.C62/profiles/'whole_program_debug'",
compileOpts: {
$name:"ti.targets.C62/profiles/'whole_program_debug'/compileOpts",
copts: "-oe%20--symdebug%3Adwarf%20-mo"
},
filters: {
$name:"ti.targets.C62/profiles/'whole_program_debug'/filters",
}
}
},
sectMap: {
$name:"ti.targets.C62/sectMap",
".text": "code",
".stack": "stack",
".bss": "data",
".cinit": "data",
".pinit": "data",
".const": "data",
".data": "data",
".switch": "data",
".sysmem": "data",
".far": "data",
".args": "data",
".cio": "data"
},
stdInclude: "ti/targets/std.h",
stdTypes: {
$name:"ti.targets.C62/stdTypes",
t_IArg: {
$name:"ti.targets.C62/stdTypes/t_IArg",
size: 4,
align: 4
},
t_Char: {
$name:"ti.targets.C62/stdTypes/t_Char",
size: 1,
align: 1
},
t_Double: {
$name:"ti.targets.C62/stdTypes/t_Double",
size: 8,
align: 8
},
t_Float: {
$name:"ti.targets.C62/stdTypes/t_Float",
size: 4,
align: 4
},
t_Fxn: {
$name:"ti.targets.C62/stdTypes/t_Fxn",
size: 4,
align: 4
},
t_Int: {
$name:"ti.targets.C62/stdTypes/t_Int",
size: 4,
align: 4
},
t_Int8: {
$name:"ti.targets.C62/stdTypes/t_Int8",
size: 1,
align: 1
},
t_Int16: {
$name:"ti.targets.C62/stdTypes/t_Int16",
size: 2,
align: 2
},
t_Int32: {
$name:"ti.targets.C62/stdTypes/t_Int32",
size: 4,
align: 4
},
t_Int40: {
$name:"ti.targets.C62/stdTypes/t_Int40",
size: 8,
align: 8
},
t_Int64: {
$name:"ti.targets.C62/stdTypes/t_Int64",
size: 8,
align: 8
},
t_Long: {
$name:"ti.targets.C62/stdTypes/t_Long",
size: 8,
align: 8
},
t_LDouble: {
$name:"ti.targets.C62/stdTypes/t_LDouble",
size: 8,
align: 8
},
t_LLong: {
$name:"ti.targets.C62/stdTypes/t_LLong",
size: 8,
align: 8
},
t_Ptr: {
$name:"ti.targets.C62/stdTypes/t_Ptr",
size: 4,
align: 4
},
t_Short: {
$name:"ti.targets.C62/stdTypes/t_Short",
size: 2,
align: 2
}
},
bitsPerChar: 8
},
platform: "ti.platforms.sim64Pxx",
platforms: {
$name:"ti.targets.C64P/platforms",
0: "ti.platforms.sim64Pxx"
},
binaryParser: "ti.targets.omf.cof.Coff",
version: "ti.targets.C64P%7B1%2C0%2C6.1%2C5",
debugGen: {
$name:"ti.targets.C64P/debugGen",
execTemplate: "ti/targets/ccs_exec.xdt",
execPattern: "%24%28cfgDir%29%24%28cfgName%29.pjt",
packageTemplate: "ti/targets/ccs_package.xdt",
packagePattern: "package/%24%28pkgName%29.pjt"
},
extensions: {
$name:"ti.targets.C64P/extensions",
".s64P": {
$name:"ti.targets.C64P/extensions/'.s64P'",
suf: ".s64P",
typ: "asm"
},
".s64": {
$name:"ti.targets.C64P/extensions/'.s64'",
suf: ".s64",
typ: "asm"
},
".s62": {
$name:"ti.targets.C64P/extensions/'.s62'",
suf: ".s62",
typ: "asm"
},
".asm": {
$name:"ti.targets.C64P/extensions/'.asm'",
suf: ".asm",
typ: "asm"
},
".c": {
$name:"ti.targets.C64P/extensions/'.c'",
suf: ".c",
typ: "c"
},
".cpp": {
$name:"ti.targets.C64P/extensions/'.cpp'",
suf: ".cpp",
typ: "cpp"
},
".cxx": {
$name:"ti.targets.C64P/extensions/'.cxx'",
suf: ".cxx",
typ: "cpp"
},
".C": {
$name:"ti.targets.C64P/extensions/'.C'",
suf: ".C",
typ: "cpp"
},
".cc": {
$name:"ti.targets.C64P/extensions/'.cc'",
suf: ".cc",
typ: "cpp"
}
},
versionMap: {
$name:"ti.targets.C64P/versionMap",
"TMS320C6x_4.32": "1%2C0%2C4.32%2C0",
"TMS320C55x_2.56": "1%2C0%2C2.56%2C0",
"TMS320C54x_3.83": "1%2C0%2C3.83%2C0",
"TMS320C2000_3.07": "1%2C0%2C3.07%2C0"
},
alignDirectiveSupported: true,
rootDir: "d%3A/ti/c6000/alc",
profiles: {
$name:"ti.targets.C64P/profiles",
debug: {
$name:"ti.targets.C64P/profiles/'debug'",
compileOpts: {
$name:"ti.targets.C64P/profiles/'debug'/compileOpts",
copts: "-g",
defs: "-D_DEBUG_%3D1"
},
filters: {
$name:"ti.targets.C64P/profiles/'debug'/filters",
}
},
release: {
$name:"ti.targets.C64P/profiles/'release'",
compileOpts: {
$name:"ti.targets.C64P/profiles/'release'/compileOpts",
copts: "-O2"
},
filters: {
$name:"ti.targets.C64P/profiles/'release'/filters",
}
},
profile: {
$name:"ti.targets.C64P/profiles/'profile'",
compileOpts: {
$name:"ti.targets.C64P/profiles/'profile'/compileOpts",
copts: "-gp"
},
filters: {
$name:"ti.targets.C64P/profiles/'profile'/filters",
}
},
coverage: {
$name:"ti.targets.C64P/profiles/'coverage'",
compileOpts: {
$name:"ti.targets.C64P/profiles/'coverage'/compileOpts",
copts: "-gp"
},
filters: {
$name:"ti.targets.C64P/profiles/'coverage'/filters",
}
},
whole_program: {
$name:"ti.targets.C64P/profiles/'whole_program'",
compileOpts: {
$name:"ti.targets.C64P/profiles/'whole_program'/compileOpts",
copts: "-oe%20-O2%20-mo"
},
filters: {
$name:"ti.targets.C64P/profiles/'whole_program'/filters",
}
},
whole_program_debug: {
$name:"ti.targets.C64P/profiles/'whole_program_debug'",
compileOpts: {
$name:"ti.targets.C64P/profiles/'whole_program_debug'/compileOpts",
copts: "-oe%20--symdebug%3Adwarf%20-mo"
},
filters: {
$name:"ti.targets.C64P/profiles/'whole_program_debug'/filters",
}
}
},
sectMap: {
$name:"ti.targets.C64P/sectMap",
".text": "code",
".stack": "stack",
".bss": "data",
".cinit": "data",
".pinit": "data",
".const": "data",
".data": "data",
".switch": "data",
".sysmem": "data",
".far": "data",
".args": "data",
".cio": "data"
},
stdInclude: "ti/targets/std.h",
stdTypes: {
$name:"ti.targets.C64P/stdTypes",
t_IArg: {
$name:"ti.targets.C64P/stdTypes/t_IArg",
size: 4,
align: 4
},
t_Char: {
$name:"ti.targets.C64P/stdTypes/t_Char",
size: 1,
align: 1
},
t_Double: {
$name:"ti.targets.C64P/stdTypes/t_Double",
size: 8,
align: 8
},
t_Float: {
$name:"ti.targets.C64P/stdTypes/t_Float",
size: 4,
align: 4
},
t_Fxn: {
$name:"ti.targets.C64P/stdTypes/t_Fxn",
size: 4,
align: 4
},
t_Int: {
$name:"ti.targets.C64P/stdTypes/t_Int",
size: 4,
align: 4
},
t_Int8: {
$name:"ti.targets.C64P/stdTypes/t_Int8",
size: 1,
align: 1
},
t_Int16: {
$name:"ti.targets.C64P/stdTypes/t_Int16",
size: 2,
align: 2
},
t_Int32: {
$name:"ti.targets.C64P/stdTypes/t_Int32",
size: 4,
align: 4
},
t_Int40: {
$name:"ti.targets.C64P/stdTypes/t_Int40",
size: 8,
align: 8
},
t_Int64: {
$name:"ti.targets.C64P/stdTypes/t_Int64",
size: 8,
align: 8
},
t_Long: {
$name:"ti.targets.C64P/stdTypes/t_Long",
size: 8,
align: 8
},
t_LDouble: {
$name:"ti.targets.C64P/stdTypes/t_LDouble",
size: 8,
align: 8
},
t_LLong: {
$name:"ti.targets.C64P/stdTypes/t_LLong",
size: 8,
align: 8
},
t_Ptr: {
$name:"ti.targets.C64P/stdTypes/t_Ptr",
size: 4,
align: 4
},
t_Short: {
$name:"ti.targets.C64P/stdTypes/t_Short",
size: 2,
align: 2
}
},
bitsPerChar: 8,
binDir: "%24%28rootDir%29/bin/",
pathPrefix: "",
ar: {
$name:"ti.targets.C64P/ar",
cmd: "ar6x",
opts: "rq"
},
arOpts: {
$name:"ti.targets.C64P/arOpts",
prefix: "",
suffix: ""
},
lnk: {
$name:"ti.targets.C64P/lnk",
cmd: "lnk6x",
opts: ""
},
lnkOpts: {
$name:"ti.targets.C64P/lnkOpts",
prefix: "-w%20-q%20-u%20_c_int00",
suffix: "-c%20-m%20%24%28XDCCFGDIR%29/%24@.map%20-l%20%24%28rootDir%29/lib/rts64plus.lib"
},
cc: {
$name:"ti.targets.C64P/cc",
cmd: "cl6x%20-c",
opts: "-mv64p"
},
ccOpts: {
$name:"ti.targets.C64P/ccOpts",
prefix: "-qq%20-pdsw225",
suffix: ""
},
ccConfigOpts: {
$name:"ti.targets.C64P/ccConfigOpts",
prefix: "%24%28ccOpts.prefix%29%20-mo",
suffix: "%24%28ccOpts.suffix%29"
},
asm: {
$name:"ti.targets.C64P/asm",
cmd: "cl6x%20-c",
opts: "-mv64p"
},
asmOpts: {
$name:"ti.targets.C64P/asmOpts",
prefix: "-qq",
suffix: ""
},
vers: {
$name:"ti.targets.C64P/vers",
cmd: "cl6x",
opts: "-version"
},
includeOpts: "-I%24%28rootDir%29/include"
},
test: {},
cfgScript: "prog.cfg",
profile: "release"
};
build.target.findSuffix = function findSuffix(pkg) {
if (arguments.length < 1) {
throw new Error("The function ITarget.findSuffix() requires an " + "argument");
}
var suffixMap = {};
if ("build" in pkg) {
var build = pkg.build;
if (build.libraries.length != 0) {
if (build.libDesc[0].suffix != undefined) {
for (var i = 0; i < build.libDesc.length; i++) {
suffixMap[build.libDesc[i].suffix] = "";
}
} else {
for (var i = 0; i < build.libDesc.length; i++) {
if (build.libDesc[i].target == prog.build.target.$name) {
suffixMap[prog.build.target.suffix] = "";
break;
}
}
}
}
} else {
if ("length" in pkg) {
for (var i = 0; i < pkg.length; i++) {
suffixMap[pkg[i]] = "";
}
} else {
throw new Error("An invalid argument type supplied to " + "ITarget.findSuffix()");
}
}
var compTargs = [];
for (var prop in this.compatibleSuffixes) {
compTargs[prop] = this.compatibleSuffixes[prop];
}
if (this.suffix in suffixMap) {
return (this.suffix);
}
if (compTargs.length < 1) {
return (null);
}
for (var i = 0; i < compTargs.length; i++) {
if (compTargs[i] in suffixMap) {
return (compTargs[i]);
}
}
return (null);
};
build.target.selectSuffix = function selectSuffix(list) {
var suffixMap = {};
for (var i = 0; i < list.length; i++) {
suffixMap[list[i]] = "";
}
var compTargs = [];
for (var prop in this.compatibleSuffixes) {
compTargs[prop] = this.compatibleSuffixes[prop];
}
if (this.suffix in suffixMap) {
return (this.suffix);
}
if (compTargs.length < 1) {
return (null);
}
for (var i = 0; i < compTargs.length; i++) {
if (compTargs[i] in suffixMap) {
return (compTargs[i]);
}
}
return (null);
};
build.target.asmName = function asmName(cname) {
return ("_" + cname);
};
_runescape(build);
build.cfgArgs = undefined;
prog.build = build;
prog.name = "prog.x64P";
prog.endian = prog.build.target.model.endian;
/* use the platform package's Platform module */
var Platform = xdc.useModule("ti.platforms.sim64Pxx.Platform");
var platParams = _getPlatCfg();
for (var prop in platParams) {
if (!(prop in Platform.PARAMS)) {
delete platParams[prop];
}
}
prog.platformName = "ti.platforms.sim64Pxx";
prog.platform = Platform.create("", _getPlatCfg(), platParams);
/* record the executable's package name */
prog.buildPackage = "hello.pkg";
/* record build-model information required during config generation */
prog.$$bind("$$isasm", 0);
prog.$$bind("$$isrom", 0);
prog.$$bind("$$gentab", [
]);
/* bind prog to an appropriate execution context */
prog.cpu = prog.platform.getExeContext(prog);
/* import the target's run-time support pkg */
xdc.loadPackage("ti.targets.rts6000");
}
/* function to import the cfg script's package */
function _userscript($$legacy, script) {
var home;
var spath;
/* import the executable's package */
home = xdc.loadPackage("hello.pkg");
spath = '.';
xdc.om.$$bind('$homepkg', home);
if (script != null) {
utils.evaluateScript(script);
}
else {
/* load & run program cfg script and monitor all loaded files */
_runCfg("prog.cfg", spath, "package/cfg/prog_x64P",
false,
false,
_getPlatCfg());
}
/*
* ======== _runCfg ========
* Run a user supplied configuration script and prevent user's script from
* overwriting the global variable prog.
*/
function _runCfg(cfgScript, path, programName, legacyTcf, legacyCfg,
platParams)
{
if (legacyTcf) {
/* save current global variables */
var $save = {prog: utils.global.prog, Program: Program};
/* initialize global variables for legacy config scripts */
environment["config.programName"] = programName;
environment["config.platform"] = Program.platformName;
utils.seedPath = environment["config.importPath"];
utils.loadPlatform.params = platParams;
Program = $$legacy.Program; /* defined in cfg.tci */
/* run legacy config script with prog == to RTSC Program; this
* allows legacy script to read build atributes from RTSC model
* before re-creating the prog object
*/
utils.loadCapsule(cfgScript, false, path);
/* restore global variables; now prog == TCOM prog because
* utils.loadPlatform() creates the TCOM prog object.
*/
$$legacy.prog = utils.global.prog; /* in case XDC wants it */
utils.global.prog = $save.prog;
Program = $save.Program;
/* run XDC configuration script, if it exists */
if (legacyCfg) {
utils.importFile(cfgScript.replace(/\.tcf/, ".cfg"), path);
}
}
else {
utils.loadCapsule(cfgScript, false, path);
}
}
}
function _postinit() {
var cout = null;
var prog = xdc.om['xdc.cfg.Program'];
/* get the exec command for this executable */
if (prog.execCmd == null) {
prog.execCmd = prog.platform.getExecCmd(prog,
xdc.om["ti.platforms.sim64Pxx"].packageBase);
}
var cout = "define EXEC." + prog.name + '\n\n';
cout += prog.execCmd;
cout += "\nendef\n\n";
utils.genDep("package/cfg/prog_x64P", "hello.pkg", utils.loadedFiles, cout, null);
}