Presentation is loading. Please wait.

Presentation is loading. Please wait.

Static Systems (GCONF, TCONF)

Similar presentations


Presentation on theme: "Static Systems (GCONF, TCONF)"— Presentation transcript:

1 Static Systems (GCONF, TCONF)
TI BIOS Static Systems (GCONF, TCONF) 9 November 2018 Dr. Veton Këpuska

2 Introduction In this chapter the details of setting up a static DSP system will be considered. 9 November 2018 Dr. Veton Këpuska

3 Objectives List the advantages and limitations of static systems. 1 Demonstrate how to define target memory in CCS. 2 Demonstrate how to route software components into desired hardware memory. 3 Describe the files created in a CCS project build. 4 Observe the results of a built project. 5 Describe how to optimally tune a static system. 6 Describe the startup sequence of a BIOS based system 7 9 November 2018 Dr. Veton Këpuska 2

4 1 2 3 4 5 6 7 Static System Modules Concepts Hardware Segments
Software Selections 3 Files Created 4 Observe Results 5 Startup Sequence 6 Lab 7 9 November 2018 Dr. Veton Këpuska 3

5 Digital Systems: Hardware Organization and Design
11/9/2018 Static System Modules Concepts 1 Hardware Segments 2 Software Selections 3 Files Created 4 Observe Results 5 Startup Sequence 6 Lab 7 9 November 2018 Dr. Veton Këpuska 3 Architecture of a Respresentative 32 Bit Processor

6 Static System Concepts
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 9 November 2018 Dr. Veton Këpuska

7 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 9 November 2018 Dr. Veton Këpuska

8 Static System Concepts
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 9 November 2018 Dr. Veton Këpuska

9 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 Prog Data EPROM SRAM 9 November 2018 Dr. Veton Këpuska

10 Static System Configuration Management
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? 9 November 2018 Dr. Veton Këpuska

11 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 9 November 2018 Dr. Veton Këpuska

12 GCONF & TCONF Which One to Use?
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 9 November 2018 Dr. Veton Këpuska

13 Digital Systems: Hardware Organization and Design
11/9/2018 Static System Modules Concepts 1 Hardware Segments 2 Software Selections 3 Files Created 4 Observe Results 5 Startup Sequence 6 Lab 7 9 November 2018 Dr. Veton Këpuska 3 Architecture of a Respresentative 32 Bit Processor

14 Defining Memory Segments
Identify all hardware segments to CCS Each discontinuity requires a new segment A continuous block may be defined as separate sub-blocks if desired 9 November 2018 Dr. Veton Këpuska

15 Defining Memory Segments
right click on MEM mgr select “insert MEM” type MEM name right click on new MEM select “properties” 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 9 November 2018 Dr. Veton Këpuska

16 TCONF Memory Segment Setup
/* load platform */ utils.loadPlatform(“ti.platforms.dsk5510”); var myMem = MEM.create(“IRAM"); myMem.comment = “internal RAM"; myMem.base = 0x ; myMem.len = 0x ; 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 */ 9 November 2018 Dr. Veton Këpuska

17 TCONF Memory Segment Setup
Typical Memory Segments Name Memory 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 9 November 2018 Dr. Veton Këpuska

18 Digital Systems: Hardware Organization and Design
11/9/2018 Static System Modules Concepts 1 Hardware Segments 2 Software Selections 3 Files Created 4 Observe Results 5 Startup Sequence 6 Lab 7 9 November 2018 Dr. Veton Këpuska 3 Architecture of a Respresentative 32 Bit Processor

19 Digital Systems: Hardware Organization and Design
11/9/2018 Software Sections DSP System Stack i C Sections ii BIOS Sections iii User Sections iv 9 November 2018 Dr. Veton Këpuska 3 Architecture of a Respresentative 32 Bit Processor

20 Digital Systems: Hardware Organization and Design
11/9/2018 Software Sections DSP System Stack i C Sections ii BIOS Sections iii User Sections iv 9 November 2018 Dr. Veton Këpuska 3 Architecture of a Respresentative 32 Bit Processor

21 DSP System Stack Stack is used for
Local variables in HWI 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: MEME.STACKSEG or MEM->Properties->BIOS Data->Stack Size 9 November 2018 Dr. Veton Këpuska

22 DSP System Stack 0xBEBE 0xBEBE Create a large stack
SWI 2 0xBEBE HWI 1 HWI 3 SWI 4 0xBEBE Create a large stack Fill with a known (non-zero) value Run system to exercise all likely usage 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 9 November 2018 Dr. Veton Këpuska

23 Managing Stack Size via GCONF, TCONF
Digital Systems: Hardware Organization and Design 11/9/2018 Managing Stack Size via GCONF, TCONF Main(argv,argc) 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; 9 November 2018 Dr. Veton Këpuska Architecture of a Respresentative 32 Bit Processor

24 Digital Systems: Hardware Organization and Design
11/9/2018 Software Sections DSP System Stack i C Sections ii BIOS Sections iii User Sections iv 9 November 2018 Dr. Veton Këpuska 3 Architecture of a Respresentative 32 Bit Processor

25 C Program Sections .cinit .bss, .far .stack .text .sysmem
Dynamic Variables Global Variables Code Local Variables Initial values short m = 10; short b ; short x[10]; main() { short x = 0; scanf(x); y = malloc(short); *y = m * x; *y = *y + b; } .sysmem .bss, .far .cinit .stack .text 9 November 2018 Dr. Veton Këpuska

26 Uninitialized sections
.bss Global and static variables .far .stack Stack (local variables) .sysmem malloc memory draw (heap) .cio Buffers for stdio functions .text code .switch Switch tables for case statements .const Global and static string literals .cinit Initial values for global/static vars .pinit C++ table of constructors (startup) 9 November 2018 Dr. Veton Këpuska

27 Routing C Sections via GCONF
C components are routed to desired destinations via Memory Section Manager | Properties | Compiler Sections 9 November 2018 Dr. Veton Këpuska

28 Routing C Sections via=TCONF
Digital Systems: Hardware Organization and Design 11/9/2018 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"); 9 November 2018 Dr. Veton Këpuska Architecture of a Respresentative 32 Bit Processor

29 Digital Systems: Hardware Organization and Design
11/9/2018 Software Sections DSP System Stack i C Sections ii BIOS Sections iii User Sections iv 9 November 2018 Dr. Veton Këpuska 3 Architecture of a Respresentative 32 Bit Processor

30 BIOS Sections BIOS Objects BIOS Functions Hardware 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 EPROM BIOS Objects DSP Prog Data BIOS Functions SRAM 9 November 2018 Dr. Veton Këpuska

31 BIOS Sections Buffers .logname$buf ... Objects .log .sts ... BIOS Init
RAM resident sections Initialized sections Buffers .logname$buf ... Objects .log .sts ... BIOS Init .sysinit BIOS Code .bios 9 November 2018 Dr. Veton Këpuska

32 Routing BIOS Sections via GCONF
BIOS components are routed to desired destinations via Memory Section Manager | Properties | BIOS Data + BIOS Code 9 November 2018 Dr. Veton Këpuska

33 Routing BIOS Sections via TCONF
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"); 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"); 9 November 2018 Dr. Veton Këpuska

34 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 9 November 2018 Dr. Veton Këpuska Note: new seed files do not use separate VECS segment; .hwi_vec is first to link in IRAM

35 Digital Systems: Hardware Organization and Design
11/9/2018 Software Sections DSP System Stack i C Sections ii BIOS Sections iii User Sections iv 9 November 2018 Dr. Veton Këpuska 3 Architecture of a Respresentative 32 Bit Processor

36 Defined in the Config Tool
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 9 November 2018 Dr. Veton Këpuska

37 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 9 November 2018 Dr. Veton Këpuska

38 1 2 3 4 5 6 7 Static System Modules Concepts Hardware Segments
Software Selections 3 Files Created 4 Observe Results 5 Startup Sequence 6 Lab 7 9 November 2018 Dr. Veton Këpuska 3

39 Files Generated by the Config Tool
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 9 November 2018 Dr. Veton Këpuska

40 File Extensions audio.out Linker Compiler/ Assembler audio.map
audio.h audio.c audio.asm audio.tcf (audio.cdb) audio.cmd (optional) Audiocfg_c.c audiocfg.s## audiocfg.h## audiocfg.cmd audiocfg.obj Linker audio.out mod.h Compiler/ Assembler audio.obj audio.map *.lib 9 November 2018 Dr. Veton Këpuska

41 1 2 3 4 5 6 7 Static System Modules Concepts Hardware Segments
Software Selections 3 Files Created 4 Observe Results 5 Startup Sequence 6 Lab 7 9 November 2018 Dr. Veton Këpuska 3

42 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 9 November 2018 Dr. Veton Këpuska

43 1 2 3 4 5 6 7 Static System Modules Concepts Hardware Segments
Software Selections 3 Files Created 4 Observe Results 5 Startup Sequence 6 Lab 7 9 November 2018 Dr. Veton Këpuska 3

44 Startup Sequence Reset -> vector –> Boot Loader (option)
system code user code Boot Loader (option) interrupt enable bits OFF “other” initialization c_int00() main() User Init function called interrupt flag bits OFF vector table pointer initialized BIOS_init() do hardware initialization enable individual interrupts return HWI_startup() enables HWI start DSP/BIOS scheduler BIOS_start() IER C6000 interrupt enables interrupt flags global int enable IFR GIE IMR INTM C5000 9 November 2018 Dr. Veton Këpuska

45 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 9 November 2018 Dr. Veton Këpuska

46 1 2 3 4 5 6 7 Static System Modules Concepts Hardware Segments
Software Selections 3 Files Created 4 Observe Results 5 Startup Sequence 6 Lab 7 9 November 2018 Dr. Veton Këpuska 3

47 Lab 9: Static System Goals:
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 9 November 2018 Dr. Veton Këpuska

48 Static System 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 9 November 2018 Dr. Veton Këpuska

49 BIOS Instrumentation: Static Systems
END 9 November 2018 Dr. Veton Këpuska


Download ppt "Static Systems (GCONF, TCONF)"

Similar presentations


Ads by Google