1. XDC(Express DSP Component)是TI提供的一个命令行工具,它可以生成并使用实时软件组件包,它包括一系列工具,这些工具可以允许你将你的C语言代码组织成类似于java的包管理方式,具有面向对象的特性,因为它还有一个名字,叫做eXpanDed C.

2. 以上两图说明了XDC的工作方式:通过相关文件设定操作指令,读入源码、库文件以及已经存在的组件包最终生成可执行文件.

3. Package------XDC工作的基本单元.包括有:源码、库文件以及元数据;元数据这包含有该包的版本信息和依赖信息,以及模块(Module)信息.

4. XDC使用方法:

5. XDC需要的文件:config.bld  package.bld  package.xdc

Package.xdc -------------描述该包的名称,版本信息,依赖文件,模块信息等

Config.bld --------------描述XDC要使用的编译工具的相关信息,如不同CPU所使用的编译工具目录,每种编译工具的编译选项,连接选项等基本信息;

Package.bld -------------------描述对于该包需要生成的平台,profile(debug,release).通过Javascript脚本添加源码到生成执行文件的信息中.
Package.mak-------------------由XDC生成的文件,用于最终编译可执行文件.
6. XDC工作流程:

7. 使用XDC所需的文件:源码、package.bld、package.xdc、config.bld.同时需要通过shell脚本将DVEVM的安装位置导出为环境变量.
各代码如下:

Config.bld样本代码:

 + expand sourceview plaincopy to clipboardprint?
var MVArm9 = xdc.useModule("gnu.targets.MVArm9");
MVArm9.rootDir = "/opt/DVS357/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le";
MVArm9.lnkOpts.suffix = "-lpthread " + MVArm9.lnkOpts.suffix;
var Linux86=xdc.useModule("gnu.targets.Linux86");
Linux86.rootDir = "/usr";
Linux86.lnkOpts.suffix = "-lpthread " + Linux86.lnkOpts.suffix;
Build.targets = [ Linux86,MVArm9,];
var MVArm9 = xdc.useModule("gnu.targets.MVArm9");
MVArm9.rootDir = "/opt/DVS357/mv_pro_4.0/montavista/pro/devkit/arm/v5t_le";
MVArm9.lnkOpts.suffix = "-lpthread " + MVArm9.lnkOpts.suffix;
var Linux86=xdc.useModule("gnu.targets.Linux86");
Linux86.rootDir = "/usr";
Linux86.lnkOpts.suffix = "-lpthread " + Linux86.lnkOpts.suffix;
Build.targets = [ Linux86,MVArm9,];

Runxdc.sh样本代码:

 view plaincopy to clipboardprint?
#! /bin/sh
# import install paths # putting the first period before the shell invokation keeps the changes # to environment variables set here. Otherwise, changes to environment # are only within the context of the executed script ./setpaths.sh
# Define search paths for included packages
export XDCPATH="$CE_INSTALL_DIR/packages"
# Define options for execution
export XDCBUILDCFG=$(pwd)"/config.bld # Execute xdc command to make all packages /opt/DVS357/dvevm_1_20/xdc_2_94/xdc $@ -P *
#! /bin/sh
# import install paths # putting the first period before the shell invokation keeps the changes # to environment variables set here. Otherwise, changes to environment # are only within the context of the executed script ./setpaths.sh
# Define search paths for included packages
export XDCPATH="$CE_INSTALL_DIR/packages"
# Define options for execution
export XDCBUILDCFG=$(pwd)"/config.bld # Execute xdc command to make all packages /opt/DVS357/dvevm_1_20/xdc_2_94/xdc $@ -P *

Setpaths.sh样本代码:

 #!/bin/sh   

 export DVEVM_INSTALL_DIR="/opt/DVS357/dvevm_1_20/"
export BIOS_INSTALL_DIR=$DVEVM_INSTALL_DIR/bios_5_31_01
export CG_INSTALL_DIR=$DVEVM_INSTALL_DIR/cg6x_6_0_14
export CMEM_INSTALL_DIR=$DVEVM_INSTALL_DIR/cmem_1_02
export CE_INSTALL_DIR=$DVEVM_INSTALL_DIR/codec_engine_1_10_01
export CS_INSTALL_DIR=$DVEVM_INSTALL_DIR/codec_servers_1_23
export DSPLINK_INSTALL_DIR=$DVEVM_INSTALL_DIR/dsplink_1_30_08_02
export FMWK_INSTALL_DIR=$DVEVM_INSTALL_DIR/framework_components_1_10_04
export XDAIS_INSTALL_DIR=$DVEVM_INSTALL_DIR/xdais_5_10
export XDC_INSTALL_DIR=$DVEVM_INSTALL_DIR/xdc_2_94 export PATH=$XDC_INSTALL_DIR:$PATH
#!/bin/sh export DVEVM_INSTALL_DIR="/opt/DVS357/dvevm_1_20/"
export BIOS_INSTALL_DIR=$DVEVM_INSTALL_DIR/bios_5_31_01
export CG_INSTALL_DIR=$DVEVM_INSTALL_DIR/cg6x_6_0_14
export CMEM_INSTALL_DIR=$DVEVM_INSTALL_DIR/cmem_1_02
export CE_INSTALL_DIR=$DVEVM_INSTALL_DIR/codec_engine_1_10_01
export CS_INSTALL_DIR=$DVEVM_INSTALL_DIR/codec_servers_1_23
export DSPLINK_INSTALL_DIR=$DVEVM_INSTALL_DIR/dsplink_1_30_08_02
export FMWK_INSTALL_DIR=$DVEVM_INSTALL_DIR/framework_components_1_10_04
export XDAIS_INSTALL_DIR=$DVEVM_INSTALL_DIR/xdais_5_10
export XDC_INSTALL_DIR=$DVEVM_INSTALL_DIR/xdc_2_94 export PATH=$XDC_INSTALL_DIR:$PATH

package.bld样本代码:

 + expand sourceview plaincopy to clipboardprint?
var targs = [MVArm9, Linux86];
var profiles = ["debug", "release"];
// Define the base name for the executable(s) built
var basename = "app";
// The following code uses the java.io.File.list() method to generate an array
// of all files in the current directory ('.') and then sorts out .c files
var sources = java.io.File('.').list();
var csources = [];
for (var i = 0; i < sources.length; i++){
if(String(sources[i]).match(/.*\.c$/))
csources.push(sources[i]);
} // The build phase cycles through the arrays of build targets and profiles
// and adds an executable for each combination for (var i = 0; i < targs.length; i++) {
for(var j = 0; j < profiles.length; j++){
Pkg.addExecutable( basename + "_" + profiles[j], targs[i],
targs[i].platform, {
cfgScript: null,
profile: profiles[j],
}
).addObjects( csources );
}
}
var targs = [MVArm9, Linux86];
var profiles = ["debug", "release"];
// Define the base name for the executable(s) built
var basename = "app";
// The following code uses the java.io.File.list() method to generate an array
// of all files in the current directory ('.') and then sorts out .c files
var sources = java.io.File('.').list();
var csources = [];
for (var i = 0; i < sources.length; i++){
if(String(sources[i]).match(/.*\.c$/))
csources.push(sources[i]);
} // The build phase cycles through the arrays of build targets and profiles
// and adds an executable for each combination for (var i = 0; i < targs.length; i++) {
for(var j = 0; j < profiles.length; j++){
Pkg.addExecutable( basename + "_" + profiles[j], targs[i],
targs[i].platform, {
cfgScript: null,
profile: profiles[j],
}
).addObjects( csources );
}
}

本文转自:http://csharp.usr.cc/forum.php?mod=viewthread&tid=52028&page=1

TI XDC工具入门简介的更多相关文章

  1. 掌握 Ajax,第 1 部分: Ajax 入门简介

    转:http://www.ibm.com/developerworks/cn/xml/wa-ajaxintro1.html 掌握 Ajax,第 1 部分: Ajax 入门简介 理解 Ajax 及其工作 ...

  2. (转)Web Service入门简介(一个简单的WebService示例)

    Web Service入门简介 一.Web Service简介 1.1.Web Service基本概念 Web Service也叫XML Web Service WebService是一种可以接收从I ...

  3. ASP.NET Core学习之一 入门简介

    一.入门简介 在学习之前,要先了解ASP.NET Core是什么?为什么?很多人学习新技术功利心很重,恨不得立马就学会了. 其实,那样做很不好,马马虎虎,联系过程中又花费非常多的时间去解决所遇到的“问 ...

  4. Web Service入门简介(一个简单的WebService示例)

    Web Service入门简介 一.Web Service简介 1.1.Web Service基本概念 Web Service也叫XML Web Service WebService是一种可以接收从I ...

  5. Android精通教程-第一节Android入门简介

    前言 大家好,给大家带来Android精通教程-第一节Android入门简介的概述,希望你们喜欢 每日一句 If life were predictable it would cease to be ...

  6. Markdown入门简介

    参考 http://sspai.com/25137 作者: Te_Lee 文章来源: 少数派 Markdown入门简介(使用工具Haroopad) 一.使用的工具----haroopad(http:/ ...

  7. Orange的数据挖掘工具入门使用

    Orange的数据挖掘工具入门使用 声明: 1)本报告由博客园bitpeach撰写,版权所有,免费转载,请注明出处,并请勿作商业用途. 2)若本文档内有侵权文字或图片等内容,请联系作者bitpeach ...

  8. Django笔记 —— 入门简介

    最近在学习Django,打算玩玩网页后台方面的东西,因为一直很好奇但却没怎么接触过.Django对我来说是一个全新的内容,思路想来也是全新的,或许并不能写得很明白,所以大家就凑合着看吧- 本篇笔记(其 ...

  9. 1 Processing入门简介

    1 Processing入门简介 1.1 Before you start Processing是一个为开发面向图形的应用(visually oriented application)而生的简单易用的 ...

随机推荐

  1. http状态码status

    status——http状态码 1xx 消息 2xx 成功 3xx 重定向 ▪ 301 Moved Permanently 永久重定向——下回不会再找他了 ▪ 302 Move temporarily ...

  2. vue-router教程二(要素篇之新手入门)

    注意,我们将在指南中使用es 2015代码样本.此外,所有示例都将使用VUE的完整版本来使在线模板编译成为可能.请参阅这里的更多细节. 用vue路由器创建单页应用程序是非常简单的.使用vue.js,我 ...

  3. php系统函数-----数组函数

  4. Debian初识(选择最佳镜像发布站点加入source.list文件)

    选择最佳镜像发布站点加入source.list文件:netselect,netselect-apt “该将哪个Debian镜像发布站点加入source.list文件?”.有很多方法来选择镜像发布站点, ...

  5. BZOJ3261:最大异或和

    浅谈\(Trie\):https://www.cnblogs.com/AKMer/p/10444829.html 题目传送门:https://lydsy.com/JudgeOnline/problem ...

  6. Spark Streaming性能调优

    数据接收并行度调优(一) 通过网络接收数据时(比如Kafka.Flume),会将数据反序列化,并存储在Spark的内存中.如果数据接收称为系统的瓶颈,那么可以考虑并行化数据接收.每一个输入DStrea ...

  7. RK3288 通过指令查看当前显示内容(framebuffer)

    $ adb shell root@xxx:/ # cd /dev/graphics cd /dev/graphics root@xxx:/dev/graphics # ls ls fb0 fb1 fb ...

  8. centos7下安装Anaconda3

    下载anaconda3: wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/Anaconda3-4.2.0-Linux-x86_64 ...

  9. IDEA開發 java web 初步

    作爲一個小白,我也不知道爲啥同學們喜歡用IDEA開發,而不選擇eclipse,但是在項目學習中eclipse卻真的多次出現問題,無奈之下,本人也安裝了一個IDEA作爲學習使用.參考了博客開始使用這個工 ...

  10. Java-Runoob-高级教程:Java Applet 基础

    ylbtech-Java-Runoob-高级教程:Java Applet 基础 1.返回顶部 1. Java Applet 基础 Applet 是一种 Java 程序.它一般运行在支持 Java 的 ...