《研讨会 如何创建一个静态系统.pptx》由会员分享,可在线阅读,更多相关《研讨会 如何创建一个静态系统.pptx(36页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、会计学1研讨会研讨会 如何创建一个静态系统如何创建一个静态系统ObjectivesList the advantages and limitations of static systemsDemonstrate how to define target memory in CCSDemonstrate how to route software components into desired hardware memoryDescribe the files created in a CCS project buildObserve the results of a built project
2、Describe the startup sequence of a BIOS based systemT TOTechnical Training Organization2第1页/共36页Static System Considerationsshort 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;HardwareDSPProgDataEPROMSRAMT TOTechnical Training O
3、rganizationConceptsHardware SegmentsSoftware SectionsFiles CreatedObserve ResultsStartup SequenceLab3第2页/共36页Static System ConceptsBenefits 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
4、 managementReduced MIPs consumption for environment creation no time spent in create/delete,malloc()/free(),etcDeterministic performance malloc()is non-deterministicOptimal when most resources are required concurrentlyLimitations of static systems:Fixed allocation of memory usageUnable to create new
5、 components or modify existing ones at runtimeBottom Line:Some systems are best served with a static configuration,others may benefit from a dynamic solutionDSP/BIOS fully supports both methodologies,even allowing easy migration between the twoWhat is a static system?One in which all components rema
6、in in place during the life of the systemNo components are created or deletedThere is no heap or use of the C malloc()or free()functionsThe converse is a dynamic system,which is the opposite of all the aboveT TOTechnical Training Organization4第3页/共36页Static System Configuration ManagementSegments me
7、mory blocks present in the target hardwareProperties: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;HardwareDSPProg DataEPROMSRAMSections software component b
8、locks,including:System sections eg:stackC sections eg:code,BIOS sections eg:code,objects,.User-defined sections-ex.#pragma CODE_SECTIONHow are these routed to the desired memory segment?T TOTechnical Training Organization5第4页/共36页GCONF&TCONF Which One to Use?GCONF(pre BIOS 5.x)Graphical Configuratio
9、n Tool+TIs historical system setup method created a.CDB file+Easy to use visual system design/wizard-like interfaceProjects dont directly transfer to new board,ISA,BIOS revTCONF(BIOS 5.0 5.1)Text-based Configuration+Java Script language;Write in any desired text editor+Produces smaller,more concise
10、output+Output is printable better documenting+Designed for easy transport to new board,ISA,BIOS revs+Runs under Linux,Solaris,Windows Users guide:SPRU007GCONF(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 resultantCDB2T
11、CF CDB to TCF conversion utility or CDBCMP+Converts existing GCONF.CDB files to TCONF.TCF formatProvided in BIOS 5.0 and greaterT TOTechnical Training Organization6第5页/共36页Static System Considerationsshort m=10;short b=2;short*y;extern LOG_obj trace;main()short x=0;scanf(x);LOG_printf(&trace.y=mallo
12、c(short);*y=m*x;*y=*y+b;HardwareDSPProgDataEPROMSRAMT TOTechnical Training OrganizationConceptsHardware SegmentsSoftware SectionsFiles CreatedObserve ResultsStartup SequenceLab7第6页/共36页Defining Memory Segments1.right click on MEM mgr2.select“insert MEM”3.type MEM name4.right click on new MEM5.select
13、“properties”6.indicate desired Base AddressLengthSpace(Code,Data,both)Heap:usage described later leave this box unchecked in static systemsNote:Suppression of heap support is via:MEM manager|Properties|General|No Dynamic Memory HeapsIdentify all hardware segments to CCSEach discontinuity requires a
14、new segmentA continuous block may be defined as separate sub-blocks if desiredT TOTechnical Training Organization8第7页/共36页TCONF Memory Segment Setupvar myMem=MEM.create(“IRAM);myMment=“internal RAM;myMem.base=0 x00000000;myMem.len=0 x00100000;myMem.space=“both;myMem.createHeap=“false;/*myMem.heapSiz
15、e=0 x08000;*/*myMem.enableHeapLabel=false;*/*myMem.heapLabel=prog.extern(seg_name,asm);*/MEM.NOMEMORYHEAPS=“true;/*disable heap support*/*load platform*/utils.loadPlatform(“ti.platforms.dsk5510”);Name Memory Segment TypeIPRAM Internal program memoryIDRAM Internal data memorySBSRAM External SBSRAM on
16、 CE0SDRAM0 External SDRAM on CE2SDRAM1 External SDRAM on CE3Typical Memory SegmentsT TOTechnical Training Organization9第8页/共36页Static System ConsiderationsT TOTechnical Training OrganizationConceptsHardware SegmentsSoftware SectionsFiles CreatedObserve ResultsStartup SequenceLabshort m=10;short b=2;
17、short*y;extern LOG_obj trace;main()short x=0;scanf(x);LOG_printf(&trace.y=malloc(short);*y=m*x;*y=*y+b;HardwareDSPProgDataEPROMSRAMSystem StackC SectionsBIOS SectionsUser Sections10第9页/共36页DSP System StackT TOTechnical Training OrganizationStack is used forLocal variables in HWIs and SWIs(not TSKs)C
18、alling arguments for functions,Context saveConfiguration tool sets stack size and location at link timeSize:MEM.STACKSIZE or MEM -Properties-General-Stack SizeLocation:MEM.STACKSEG or MEM-Properties-BIOS Data-Stack Section0 xBEBE0 xBEBE0 xBEBE0 xBEBE0 xBEBE0 xBEBE0 xBEBE0 xBEBE0 xBEBE0 xBEBE0 xBEBE0
19、 xBEBECreate a large stackFill with a known(non-zero)valueHalt system,look for key valueNo key values found?Increase stack sizeLots of key values left?Decrease stack sizeAlternate methodUse HWI monitor option on highest HWI(s)Monitor SPLook at max value(s)of SPRun system to exercise all likely usage
20、SWI 20 xBEBE0 xBEBE0 xBEBEHWI 1HWI 3SWI 411第10页/共36页Managing Stack Size via GCONF,TCONFMinimum estimated stack size is shown at top of GCONF display.Stack size is set via:Memory Section Manager|Properties|GeneralMEM.STACKSIZE=0 x0400;MEM.ARGSSIZE =0 x0004;Main(argv,argc)T TOTechnical Training Organi
21、zation12第11页/共36页Static System Considerationsshort 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;HardwareDSPProgDataEPROMSRAMSystem StackC SectionsBIOS SectionsUser SectionsT TOTechnical Training OrganizationConceptsHardware Seg
22、mentsSoftware SectionsFiles CreatedObserve ResultsStartup SequenceLab13第12页/共36页C Program Sectionsshort m=10;short b;short x10;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 glob
23、al/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 functionsInitialized sectionsUninitialized sectionsDynamic VariablesGlobal VariablesCodeLocal VariablesIn
24、itial values.sysmem.bss,.far.cinit.stack.textT TOTechnical Training Organization14第13页/共36页Routing C Sections via GCONFC components are routed to desireddestinations via Memory Section Manager|Properties|Compiler SectionsT TOTechnical Training Organization15第14页/共36页T TOTechnical Training Organizati
25、onRouting C Sections via=TCONFMEM.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(IR
26、AM);16第15页/共36页Static System Considerationsshort 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;HardwareDSPProgDataEPROMSRAMSystem StackC SectionsBIOS SectionsUser SectionsT TOTechnical Training OrganizationConceptsHardware Segme
27、ntsSoftware SectionsFiles CreatedObserve ResultsStartup SequenceLab17第16页/共36页BIOS Sectionsshort 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.sysinitBIOS Code.biosBuffers.logname$buf .Objects.log .sts .Initialized sec
28、tionsRAM resident sectionsBIOSObjectsBIOS FunctionsHardwareDSPProgDataEPROMSRAMT TOTechnical Training Organization18第17页/共36页Routing BIOS Sections via GCONFBIOS components are routed to desireddestinations via Memory Section Manager|Properties|BIOS Data+BIOS CodeT TOTechnical Training Organization19
29、第18页/共36页Routing BIOS Sections via=TCONFMEM.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);M
30、EM.SYSDATASEG=prog.get(IRAM);MEM.OBJSEG=prog.get(IRAM);T TOTechnical Training Organization20第19页/共36页Vector Setup via GCONFHardware Interrupt Vectors are routed via Memory Section Manager|Properties|BIOS Code|.hwi_vec to a segment defining the Vector rangeT TOTechnical Training OrganizationNote:new
31、seed files do not use separate VECS segment;.hwi_vec is first to link in IRAM21第20页/共36页Static System Considerationsshort 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;HardwareDSPProgDataEPROMSRAMSystem StackC SectionsBIOS Secti
32、onsUser SectionsT TOTechnical Training OrganizationConceptsHardware SegmentsSoftware SectionsFiles CreatedObserve ResultsStartup SequenceLab22第21页/共36页User Defined Sectionsn nUse the memory segments created by the Configuration ToolUse the memory segments created by the Configuration Tooln nRequire
33、a separate linker command fileRequire a separate linker command file to place sections to place sectionsn nPlace user defined sections using the SECTIONS directivePlace user defined sections using the SECTIONS directiven nUse CCS “Link Order”capability to link the Config.Tool generated file Use CCS
34、“Link Order”capability to link the Config.Tool generated file then the user linker command filethen the user linker command filen nPut the user defined linker command file in the project(along with the Put the user defined linker command file in the project(along with the BIOS command file)BIOS comm
35、and file)#pragma DATA_SECTION(x,“mysect”);Int x1024;user.cSECTIONSmysect:IRAMuser.cmdDefined in the Config ToolT TOTechnical Training Organization23第22页/共36页Link OrderLink Order is the fourth tab under Build OptonsThe.cmd files are read in the order listedaudiocfg.cmd is the Config.Tools.cmd fileMEM
36、 segments are declared hereuser.cmd must be added to the projectT TOTechnical Training Organization24第23页/共36页Static System Considerationsshort 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;HardwareDSPProgDataEPROMSRAMT TOTechni
37、cal Training OrganizationConceptsHardware SegmentsSoftware SectionsFiles CreatedObserve ResultsStartup SequenceLab25第24页/共36页Files Generated by the Config ToolT TOTechnical Training OrganizationmyWork.tcfTextual configuration script filemyWorkcfg.cmdLinker command filemyWorkcfg_c.cC file to s/u BIOS
38、 objs,etcmyWorkcfg.s#ASM init file for series#DSPmyWorkcfg.h#Header file for abovemyWork.cdbI/F to GCONF displaymyWorkcfg.hheader file for config inclusions26第25页/共36页File Extensionsaudio.cCompiler/Assembleraudiocfg.h#audiocfg.s#audiocfg.cmdaudio.haudio.cmd(optional)audiocfg.objmod.hLinkeraudio.asma
39、udio.objaudio.tcf(audio.cdb)*.libaudio.outT TOTechnical Training OrganizationAudiocfg_c.caudio.map27第26页/共36页Static System Considerationsshort 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;HardwareDSPProgDataEPROMSRAMT TOTechnic
40、al Training OrganizationConceptsHardware SegmentsSoftware SectionsFiles CreatedObserve ResultsStartup SequenceLab28第27页/共36页Post-Build Memory Usage Examinationsectti.exe filename.outDisplays length and starting address of program sections in hex of COFFfilename.mapReport generated by linker and spec
41、ified in the build optionsofd6x.exeObject File Display(version for each ISA)Provides a more detailed XML report than map fileProject|Build Options|General tab:Final Build Steps box:sectti Lab.outT TOTechnical Training Organization29第28页/共36页Static System Considerationsshort m=10;short b=2;short*y;ex
42、tern LOG_obj trace;main()short x=0;scanf(x);LOG_printf(&trace.y=malloc(short);*y=m*x;*y=*y+b;HardwareDSPProgDataEPROMSRAMT TOTechnical Training OrganizationConceptsHardware SegmentsSoftware SectionsFiles CreatedObserve ResultsStartup SequenceLab30第29页/共36页Startup Sequenceinterrupt enable bits OFF“ot
43、her”initializationc_int00()User Init function calledinterrupt flag bits OFFvector table pointer initializedBIOS_init()do hardware initializationenable individual interruptsreturnmain()HWI_startup()enables HWIstart DSP/BIOS schedulerBIOS_start()IERC6000interrupt enablesinterrupt flagsglobal int enabl
44、eIFRGIEIMRIFRINTMC5000system codeuser codeReset-vector BootLoader(option)T TOTechnical Training Organization31第30页/共36页Startup Sequencen nInitialize the DSP and the hardwareInitialize the DSP and the hardwaren nThe software stack pointer,memory wait states,memory configuration The software stack poi
45、nter,memory wait states,memory configuration registersregistersn nThis is part of the boot.c file that is part of the DSP/BIOS libraryThis is part of the boot.c file that is part of the DSP/BIOS libraryn nBIOS_init()is called automaticallyBIOS_init()is called automaticallyn nInitializes DSP/BIOS mod
46、ulesInitializes DSP/BIOS modulesn nmain()main()n nSystem initialization that needs to be performedSystem initialization that needs to be performedn nEnable selected interrupts before interrupts are enabled globallyEnable selected interrupts before interrupts are enabled globallyn nMust return to com
47、plete the program initialization!Must return to complete the program initialization!n nBIOS_start()is called automaticallyBIOS_start()is called automaticallyn nStart DSP/BIOSStart DSP/BIOSn nEnables interrupts globallyEnables interrupts globallyn nDrops into the DSP/BIOS“background loop”Drops into t
48、he DSP/BIOS“background loop”n nInitializes communication with the host for real-time analysisInitializes communication with the host for real-time analysisT TOTechnical Training Organization32第31页/共36页Static System Considerationsshort m=10;short b=2;short*y;extern LOG_obj trace;main()short x=0;scanf
49、(x);LOG_printf(&trace.y=malloc(short);*y=m*x;*y=*y+b;HardwareDSPProgDataEPROMSRAMT TOTechnical Training OrganizationConceptsHardware SegmentsSoftware SectionsFiles CreatedObserve ResultsStartup SequenceLab33第32页/共36页Lab 9:Static SystemT TOTechnical Training OrganizationThe goals of this lab are to:O
50、pen 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 projectRedirect the output buffers to external DDR2(via pragma and user linker command file)and observe their new locations in the map file,and