一DSPBIOS的组件.ppt
《一DSPBIOS的组件.ppt》由会员分享,可在线阅读,更多相关《一DSPBIOS的组件.ppt(63页珍藏版)》请在三一文库上搜索。
1、一、DSP/BIOS的组件 1、DPS/BIOS实时库和API 运用DSP/BIOS的一个基本概念是我们 的运行程序是一个多线程的情况,我们 通过API(运用程序接口)函数来管理这 些线程。 我们可以把DSP/BIOS API分为许多模 块,不同的线程属于不同的模块。这些 模块包括:TMS320C54x DSP/BIOS Users Guide Page 15 DPS/BIOS实时库和API API管理进程的具体方法是通过API函数, 这些函数功能非常多,如:建立和删除 对象,变换线程优先级等; 函数的详细说明: TMS320C54x DSP/BIOS Application Programm
2、ing Interface (API) Reference Guide Page 13 2、DSP/BIOS配置工具 DSP/BIOS配置工具 API函数不是直接对线程进行管理,而是 通过对不同模块中建立的对象管理来实 现对线程的管理,这些对象相当于线程 的文件头或函数名。 不同模块中对象的建立有两种方法,一 是通过在源文件中使用API函数调用,可 以动态产生,动态删除;一是通过 DSP/BIOS配置工具产生,是静态产生, 不可删除。 DSP/BIOS配置工具 DSP/BIOS配置工具产生对象的优点: 他是图形化的编辑工具,使用更加方便 ; 他可以对对象进行各种参数设置; 他可以建立各种对象,
3、而API函数只能建 立部分对象。 DSP/BIOS配置工具 DSP/BIOS配置工具产生对象的缺点: 一旦建立,不论程序中是否使用,都有 占有一定资源; 一旦建立,在程序运行中,不可以删除 。 3、DSP/BIOS插件 完成对运行程序的实时分析,时刻监视 CPU的负荷,各个线程的执行情况,各段 代码的花费时间等等; DSP通过JTAG口返回到PC数据,这些数 据反映我们需要的情况。这些数据的产 生是在CPU的空闲状态时产生的,所以, 不会对DSP本身的运行产生影响。 DSP/BIOS插件 Program tracing: Displaying events written to target
4、logs, reflecting dynamic control flow during program execution。 Performance monitoring: Tracking summary statistics that reflect use of target resources, such as processor load and timing File streaming: Binding target-resident I/O objects to host files。 4、各部分关系 TMS320C54x DSP/BIOS Users Guide Page
5、14 二、DSP/BIOS的特点 1、DSP/BIOS的目的 DSP/BIOS and its plug-ins for Code Composer Studio are designed to minimize memory and CPU requirements on the target. 2、实现方法 All DSP/BIOS objects can be created in the Configuration Tool and bound into an executable program image. This reduces code size and optimizes
6、internal data structures. Instrumentation data (such as logs and traces) is formatted on the host. 实现方法 The API is modularized so that only the parts of the API that are used by the program need to be bound into the executable program. The library is optimized to require the smallest possible number
7、 of instruction cycles, with a significant portion imple-mented in assembly language. 实现方法 Communication between the target and the DSP/BIOS plug-ins is performed within the background idle loop. This ensures that the DSP/BIOS plug-ins do not interfere with the programs tasks. If the target CPU is t
8、oo busy to perform background tasks, the DSP/BIOS plug- ins stop receiving infor-mation from the target until the CPU is available. 3、API特点 A program can dynamically create and delete objects that are used in special situations. The same program can use both objects created dynamically and objects c
9、reated with the Configuration Tool. Low-level system primitives are provided to make it easier to handle errors, create common data structures, and manage memory usage. API特点 The threading model provides thread types for a variety of situations. Hard -ware interrupts, software interrupts, tasks, idl
10、e functions, and periodic functions are all supported. You can control the priorities and blocking characteristics of threads through your choice of thread types. API特点 Structures to support communication and synchronization between threads are provided. These include semaphores, mailboxes, and reso
11、urce locks. Two I/O models are supported for maximum flexibility and power. Pipes are used for target/host communication and to support simple cases in which one thread writes to the pipe and another reads from the pipe.Streams are used for more complex I/O and to support device drivers. 三、程序生成 1、DS
12、P/BIOS开发流程 1) Write a framework for your program. You can use C or assembly code. 2) Use the Configuration Tool to create objects for your program to use. 3) Save the configuration file, which generates files to be included when you compile and link your program. DSP/BIOS开发流程 4) Compile and link the
13、 program using a makefile or a Code Composer project. 5) Test program behavior using a simulator or initial hardware and the DSP/BIOS plug-ins. You can monitor logs and traces, statistics objects,timing, software interrupts, and more. DSP/BIOS开发流程 6) Repeat steps 2-5 until the program runs correctly
14、. You can add functionality and make changes to the basic program structure. 7) When production hardware is ready, modify the configuration file to support the production board and test your program on the board. 2、配置工具使用 Creating a New Configuration Setting Global Properties for a Module Creating a
15、n Object Using the Config- uration Tool Files Generated by the Configuration Tool: program.cdb programcfg.h54 programcfg.s54 programcfg.cmd 3、编译和链接 手工添加文件program.cdb (the configuration file)和programcfg.cmd (the linker command file); programcfg.s54自动添加; 库文件rst.lib不需要; C源文件中要加上各种API头文件; 其他源文件同一般的CCS使用
16、一样; 四、线程的基本概念 1、什么是线程 实时的DSP应用,往往需要把许多看 似不相干的功能同时实现。不同的功能 通过不同的指令流实现,而我们把这些 指令流叫线程。 同一个处理器实现多线程的方法是给 线程加上优先级。优先级高的线程首先 执行。 2、线程的种类 Hardware interrupts (HWI): includes CLK functions Software interrupts (SWI): includes PRD functions Tasks (TSK) Background thread (IDL) 硬件中断 Triggered in response to ext
17、ernal asynchronous events that occur in the DSP environment. An HWI function (also called an interrupt service routine or ISR) is executed after a hardware interrupt is triggered in order to perform a critical task that is subject to a hard deadline. 硬件中断 HWI functions are the threads with the highe
18、st priority in a DSP/BIOS application. HWIs should be used for application tasks that may need to run at frequencies approaching 200 kHz, and that need to be completed within deadlines of 2 to 100 microseconds. 软件中断 Software interrupts are triggered by calling SWI functions from the program. Softwar
19、e interrupts provide additional priority levels between hardware interrupts and the background thread. SWIs handle tasks subject to time constraints that preclude them from being run from the idle loop, but whose deadlines are not as severe as those of hardware ISRs. 软件中断 Like HWIs, SWIs threads alw
20、ays run to completion. Software interrupts should be used to schedule events with deadlines of 100 microseconds or more. SWIs allow HWIs to defer less critical processing to a lower-priority thread, minimizing the time the CPU spends inside an ISR, where other HWIs may be disabled. TASK Tasks have h
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- DSPBIOS 组件
链接地址:https://www.31doc.com/p-3240491.html