Presentation is loading. Please wait.

Presentation is loading. Please wait.

DSP/BIOS System Integration Workshop Copyright © 2004 Texas Instruments. All rights reserved. T TO Technical Training Organization 1.Introduction 2.Real-Time.

Similar presentations


Presentation on theme: "DSP/BIOS System Integration Workshop Copyright © 2004 Texas Instruments. All rights reserved. T TO Technical Training Organization 1.Introduction 2.Real-Time."— Presentation transcript:

1 DSP/BIOS System Integration Workshop Copyright © 2004 Texas Instruments. All rights reserved. T TO Technical Training Organization 1.Introduction 2.Real-Time System Design Considerations 3.Hardware Interrupts (HWI) 4.Software Interrupts (SWI) 5.Task Authoring (TSK) 6.Data Streaming (SIO) 7.Multi-Threading (CLK, PRD) 8.BIOS Instrumentation (LOG, STS, SYS, TRC) 9.Static Systems (GCONF, TCONF) 10.Cache (BCACHE) 11.Dynamic Systems (MEM, BUF) 12.Flash Programming (HexAIS, Flashburn) 13.Inter-Thread Communication (MSGQ,...) 14.DSP Algorithm Standard (XDAIS) 15.Input Output Mini-Drivers (IOM) 16.Direct Memory Access (DMA) 17.Review 1

2 Objectives  List the advantages and limitations of static systems  Demonstrate how to define target memory in CCS  Demonstrate how to route software components into desired hardware memory  Describe the files created in a CCS project build  Observe the results of a built project  Describe the startup sequence of a BIOS based system T TO Technical Training Organization 2

3 Static System Considerations short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM T TO Technical Training Organization  Concepts  Hardware Segments  Software Sections  Files Created  Observe Results  Startup Sequence  Lab 3

4 Static System Concepts  Benefits of static systems:  Reduced code size – create functions are replaced by BIOS declarations, there is no delete function, no inclusion of malloc/free functions or heap management  Reduced MIPs consumption for environment creation – no time spent in create/delete, malloc()/free(), etc  Deterministic performance – malloc() is non-deterministic  Optimal when most resources are required concurrently  Limitations of static systems:  Fixed allocation of memory usage  Unable to create new components or modify existing ones at runtime  Bottom Line:  Some systems are best served with a static configuration, others may benefit from a dynamic solution  DSP/BIOS fully supports both methodologies, even allowing easy migration between the two  What is a static system?  One in which all components remain in place during the life of the system  No components are created or deleted  There is no ‘heap’ or use of the C malloc() or free() functions  The converse is a ‘dynamic’ system, which is the opposite of all the above T TO Technical Training Organization 4

5 Static System Configuration Management  Segments – memory blocks present in the target hardware  Properties: base address, length, usage (code/data)  How are these defined in CCS? short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM  Sections – software component blocks, including:  System sections – eg: stack  C sections – eg: code,  BIOS sections – eg: code, objects,...  User-defined sections - ex. #pragma CODE_SECTION  How are these routed to the desired memory segment? T TO Technical Training Organization 5

6 GCONF & TCONF – Which One to Use?  GCONF (pre BIOS 5.x) – Graphical Configuration Tool +TI’s historical system setup method – created a.CDB file +Easy to use visual system design / wizard-like interface ­Projects don’t directly transfer to new board, ISA, BIOS rev  TCONF (BIOS 5.0 – 5.1) – Text-based Configuration +Java Script language; Write in any desired text editor +Produces smaller, more concise output +Output is printable – better documenting +Designed for easy transport to new board, ISA, BIOS revs +Runs under Linux, Solaris, Windows  User’s guide: SPRU007  GCONF (BIOS 5.2 +) – Graphical to Text Config Tool +Set up a system as per GCONF +See TCONF components generated as you go +Outputs a TCONF resultant  CDB2TCF – CDB to TCF conversion utility or CDBCMP +Converts existing GCONF.CDB files to TCONF.TCF format  Provided in BIOS 5.0 and greater T TO Technical Training Organization 6

7 Static System Considerations short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM T TO Technical Training Organization  Concepts  Hardware Segments  Software Sections  Files Created  Observe Results  Startup Sequence  Lab 7

8 Defining Memory Segments 1. right click on MEM mgr 2. select “insert MEM” 3. type MEM name 4. right click on new MEM 5. select “properties” 6. indicate desired Base Address Length Space (Code, Data, both) Heap: usage described later – leave this box unchecked in static systems Note: Suppression of heap support is via: MEM manager | Properties | General | No Dynamic Memory Heaps  Identify all hardware segments to CCS  Each discontinuity requires a new segment  A continuous block may be defined as separate sub-blocks if desired T TO Technical Training Organization 8

9 TCONF Memory Segment Setup var myMem = MEM.create(“IRAM"); myMem.comment = “internal RAM"; myMem.base = 0x00000000; myMem.len = 0x00100000; myMem.space = “both"; myMem.createHeap = “false"; /* myMem.heapSize = 0x08000; */ /* myMem.enableHeapLabel = "false"; */ /* myMem.heapLabel = prog.extern("seg_name", "asm"); */ MEM.NOMEMORYHEAPS = “true"; /* disable heap support */ /* load platform */ utils.loadPlatform(“ti.platforms.dsk5510”); NameMemory Segment Type IPRAM Internal program memory IDRAM Internal data memory SBSRAM External SBSRAM on CE0 SDRAM0 External SDRAM on CE2 SDRAM1 External SDRAM on CE3 Typical Memory Segments T TO Technical Training Organization 9

10 Static System Considerations T TO Technical Training Organization  Concepts  Hardware Segments  Software Sections  Files Created  Observe Results  Startup Sequence  Lab short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM  System Stack  C Sections  BIOS Sections  User Sections 10

11 DSP System Stack T TO Technical Training Organization  Stack is used for  Local variables in HWIs and SWIs (not TSKs)  Calling arguments for functions, Context save  Configuration tool sets stack size and location at link time  Size: MEM.STACKSIZE or MEM -> Properties -> General -> Stack Size  Location: MEM.STACKSEG or MEM -> Properties -> BIOS Data -> Stack Section 0xBEBE  Create a large stack  Fill with a known (non-zero) value  Halt system, look for key value  No key values found? Increase stack size  Lots of key values left? Decrease stack size  Alternate method  Use HWI monitor option on highest HWI(s)  Monitor SP  Look at max value(s) of SP  Run system to exercise all likely usage SWI 2 0xBEBE HWI 1 HWI 3 SWI 4 11

12 Managing Stack Size via GCONF, TCONF  Minimum estimated stack size is shown at top of GCONF display.  Stack size is set via: Memory Section Manager | Properties | General MEM.STACKSIZE = 0x0400; MEM.ARGSSIZE = 0x0004; Main(argv,argc) T TO Technical Training Organization 12

13 Static System Considerations short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM  System Stack  C Sections  BIOS Sections  User Sections T TO Technical Training Organization  Concepts  Hardware Segments  Software Sections  Files Created  Observe Results  Startup Sequence  Lab 13

14 C Program Sections short m = 10; short b ; short x[10]; main() { short x = 0; scanf(x); y = malloc(short); *y = m * x; *y = *y + b; }.textcode.switchSwitch tables for case statements.constGlobal and static string literals.cinitInitial values for global/static vars.pinitC++ table of constructors (startup).bssGlobal and static variables.farGlobal and static variables.stackStack (local variables).sysmemmalloc memory draw (heap).cioBuffers for stdio functions Initialized sectionsUninitialized sections Dynamic Variables Global Variables Code Local Variables Initial values.sysmem.bss,.far.cinit.stack.text T TO Technical Training Organization 14

15 Routing C Sections via GCONF C components are routed to desired destinations via Memory Section Manager | Properties | Compiler Sections T TO Technical Training Organization 15

16 T TO Technical Training Organization Routing C Sections via = TCONF MEM.TEXTSEG = prog.get("IRAM"); MEM.SWITCHSEG= prog.get("IRAM"); MEM.BSSSEG = prog.get("IRAM"); MEM.FARSEG = prog.get("IRAM"); MEM.CINITSEG = prog.get("IRAM"); MEM.PINITSEG = prog.get("IRAM"); MEM.CONSTSEG = prog.get("IRAM"); MEM.DATASEG = prog.get("IRAM"); MEM.CIOSEG = prog.get("IRAM"); MEM.MALLOCSEG = prog.get("IRAM"); 16

17 Static System Considerations short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM  System Stack  C Sections  BIOS Sections  User Sections T TO Technical Training Organization  Concepts  Hardware Segments  Software Sections  Files Created  Observe Results  Startup Sequence  Lab 17

18 BIOS Sections short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } BIOS Init.sysinit BIOS Code.bios Buffers.logname$buf... Objects.log.sts... Initialized sectionsRAM resident sections BIOS Objects BIOS Functions Hardware DSP ProgData EPROM SRAM T TO Technical Training Organization 18

19 Routing BIOS Sections via GCONF BIOS components are routed to desired destinations via Memory Section Manager | Properties | BIOS Data + BIOS Code T TO Technical Training Organization 19

20 Routing BIOS Sections via = TCONF MEM.BIOSSEG = prog.get("IRAM"); MEM.SYSINITSEG = prog.get("IRAM"); MEM.HWISEG = prog.get("IRAM"); MEM.HWIVECSEG = prog.get(“VECS"); MEM.RTDXTEXTSEG= prog.get("IRAM"); MEM.ARGSSEG = prog.get("IRAM"); MEM.STACKSEG = prog.get("IRAM"); MEM.GBLINITSEG = prog.get("IRAM"); MEM.TRCDATASEG = prog.get("IRAM"); MEM.SYSDATASEG = prog.get("IRAM"); MEM.OBJSEG = prog.get("IRAM"); T TO Technical Training Organization 20

21 Vector Setup via GCONF Hardware Interrupt Vectors are routed via Memory Section Manager | Properties | BIOS Code |.hwi_vec to a segment defining the Vector range T TO Technical Training Organization Note: new seed files do not use separate VECS segment;.hwi_vec is first to link in IRAM 21

22 Static System Considerations short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM  System Stack  C Sections  BIOS Sections  User Sections T TO Technical Training Organization  Concepts  Hardware Segments  Software Sections  Files Created  Observe Results  Startup Sequence  Lab 22

23 User Defined Sections  Use the memory segments created by the Configuration Tool  Require a separate linker command file to place sections  Place user defined sections using the SECTIONS directive  Use CCS “Link Order” capability to link the Config. Tool generated file then the user linker command file  Put the user defined linker command file in the project (along with the BIOS command file) #pragma DATA_SECTION(x, “mysect”); Int x[1024]; user.c SECTIONS { mysect :> IRAM } user.cmd Defined in the Config Tool T TO Technical Training Organization 23

24 Link Order  Link Order is the fourth tab under Build Optons  The.cmd files are read in the order listed  audiocfg.cmd is the Config. Tool’s.cmd file  MEM segments are declared here  user.cmd must be added to the project T TO Technical Training Organization 24

25 Static System Considerations short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM T TO Technical Training Organization  Concepts  Hardware Segments  Software Sections  Files Created  Observe Results  Startup Sequence  Lab 25

26 Files Generated by the Config Tool T TO Technical Training Organization  myWork.tcf Textual configuration script file  myWorkcfg.cmd Linker command file  myWorkcfg_c.c C file to s/u BIOS obj’s, etc  myWorkcfg.s## ASM init file for series ## DSP  myWorkcfg.h## Header file for above  myWork.cdb I/F to GCONF display  myWorkcfg.h header file for config inclusions  myWork.tcf Textual configuration script file  myWorkcfg.cmd Linker command file  myWorkcfg_c.c C file to s/u BIOS obj’s, etc  myWorkcfg.s## ASM init file for series ## DSP  myWorkcfg.h## Header file for above  myWork.cdb I/F to GCONF display  myWorkcfg.h header file for config inclusions 26

27 File Extensions audio.c Compiler/ Assembler audiocfg.h##audiocfg.s##audiocfg.cmd audio.h audio.cmd (optional) audiocfg.obj mod.h Linker audio.asm audio.obj audio.tcf (audio.cdb) *.lib audio.out T TO Technical Training Organization Audiocfg_c.c audio.map 27

28 Static System Considerations short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM T TO Technical Training Organization  Concepts  Hardware Segments  Software Sections  Files Created  Observe Results  Startup Sequence  Lab 28

29 Post-Build Memory Usage Examination  sectti.exe filename.out  Displays length and starting address of program sections in hex of COFF  filename.map  Report generated by linker and specified in the build options  ofd6x.exe  Object File Display (version for each ISA)  Provides a more detailed XML report than map file Project | Build Options | General tab: Final Build Steps box: sectti Lab.out T TO Technical Training Organization 29

30 Static System Considerations short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM T TO Technical Training Organization  Concepts  Hardware Segments  Software Sections  Files Created  Observe Results  Startup Sequence  Lab 30

31 Startup Sequence interrupt enable bits OFF “other” initialization c_int00() User Init function called interrupt flag bits OFF vector table pointer initialized BIOS_init() do hardware initialization enable individual interrupts return main() HWI_startup() enables HWI start DSP/BIOS scheduler BIOS_start() IER C6000 interrupt enables interrupt flags global int enable IFR GIE IMR IFR INTM C5000 system codeuser code Reset -> vector –> Boot Loader (option) T TO Technical Training Organization 31

32 Startup Sequence  Initialize the DSP and the hardware  The software stack pointer, memory wait states, memory configuration registers  This is part of the boot.c file that is part of the DSP/BIOS library  BIOS_init( ) is called automatically  Initializes DSP/BIOS modules  main()  System initialization that needs to be performed  Enable selected interrupts before interrupts are enabled globally  Must return to complete the program initialization!!!!  BIOS_start( ) is called automatically  Start DSP/BIOS  Enables interrupts globally  Drops into the DSP/BIOS “background loop”  Initializes communication with the host for real-time analysis T TO Technical Training Organization 32

33 Static System Considerations short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM T TO Technical Training Organization  Concepts  Hardware Segments  Software Sections  Files Created  Observe Results  Startup Sequence  Lab 33

34 Lab 9: Static System T TO Technical Training Organization The goals of this lab are to:  Open the map file genereated by building the project and determine where the stream buffers were placed originally – and note how much IRAM was consumed in the project  Redirect the output buffers to external DDR2 (via pragma and user linker command file) and observe their new locations in the map file, and the amount of IRAM consumed this time  Run the code to see if performance is maintained when using this lower speed memory  Repeat the above experiment on the input buffers. This time, if exposure to the text based interface to the TCF file is desired, make the changes via the text edit option for the file  Again, run the code to determine if performance is sustained  Load a given solution found in C:\BIOS\Sols\09d to observe the performance a cache compliant solution will offer when off-chip resources are involved 34

35 ti Technical Training Organization T TO Technical Training Organization 35

36 Static System Considerations  MainNormal short m = 10; short b = 2; short *y; extern LOG_obj trace; main() { short x = 0; scanf(x); LOG_printf(&trace... y = malloc(short); *y = m * x; *y = *y + b; } Hardware DSP ProgData EPROM SRAM T TO Technical Training Organization  MainHighlight 36


Download ppt "DSP/BIOS System Integration Workshop Copyright © 2004 Texas Instruments. All rights reserved. T TO Technical Training Organization 1.Introduction 2.Real-Time."

Similar presentations


Ads by Google