Dsk6713_ddk.tci
上传用户:dahaojd
上传日期:2008-01-29
资源大小:14357k
文件大小:5k
- /*
- * ======== Dsk6713_ddk.tci ========
- * This script simply sets up the board-specific parameters that are needed
- * for the assorted DDK examples.
- */
- /*
- * Create an empty object and call it with the getProgObjs method to
- * create global variables for every Module and Instance object.
- * For example, instead of
- * prog.module("LOG").instance("LOG_system").buflen = <some value>;
- * we can simply say
- * tibios.LOG_system.buflen = <value>;
- */
- tibios = {};
- utils.getProgObjs(prog, tibios);
- /*
- * enable assorted BIOS features
- */
- bios.enableMemoryHeaps(prog)
- bios.enableRealTimeAnalysis(prog);
- bios.enableRtdx(prog);
- bios.enableTskManager(prog);
- /*
- * initialize LOG objects for user trace and system log
- */
- var trace = tibios.LOG.create("trace");
- trace.bufLen = 1024;
- trace.logType = "circular";
- tibios.LOG_system.bufLen = 1024;
- tibios.LOG_system.logType = "circular";
- /*
- * Memory segments, their sizes, heaps, and heap sizes
- * (SDRAM is external program memory, IRAM is internal memory)
- * We split the 64K of internal RAM as 16K for code/data and 48K for cache.
- * In internal and external data memory, we create heaps with names
- * INTERNALHEAP and EXTERNALHEAP, respectively, and platform-independent
- * portions of the application refer to these heaps by their names
- * rather than the names of memory segments they are created in
- * (as not all platforms have IRAM, SDRAM segments).
- */
- /* Enable heap creation */
- bios.enableMemoryHeaps(prog);
- tibios.GBL.C621XCONFIGUREL2 = true; /* Enable L2 configuration */
- tibios.GBL.C621XCCFGL2MODE = "3-way cache";
- /* define comments of the data memory segments (Temporary fix for SDSsq28652) */
- tibios.IRAM.comment ="This object defines space for the DSP's on-chip memory";
- tibios.SDRAM.comment ="This object defines space for the DSP's off-chip memory";
- /* shorten the length of the IRAM section to allow 3-way cache */
- tibios.IRAM.base = 0x00000;
- tibios.IRAM.len = 0x04000; /* 16K */
- tibios.IRAM.space = "code/data";
- /* allocate heap named "EXTERNALHEAP" of size 0x02000 in internal memory */
- tibios.IRAM.createHeap = true;
- tibios.IRAM.heapSize = 0x01800; /* 8K */
- tibios.IRAM.enableHeapLabel = true;
- tibios.IRAM.heapLabel = prog.extern( "INTERNALHEAP" );
- /* allocate heap named "EXTERNALHEAP" of size 0x08000 in external memory */
- tibios.SDRAM.createHeap = true;
- tibios.SDRAM.heapSize = 0x08000; /* 32K */
- tibios.SDRAM.enableHeapLabel = true;
- tibios.SDRAM.heapLabel = prog.extern( "EXTERNALHEAP" );
- /*
- * Set the size of the application stack. Must be large
- * enough to accomodate worst-case of nested priorities, if any.
- */
- tibios.MEM.STACKSIZE = 0x0400;
- /*
- * Set the default segment for the stack allocated by TSK_create().
- */
- tibios.TSK.STACKSEG = tibios.SDRAM;
- /*
- * Overriding default section placement
- * assign listed sections to specified memory segments
- */
- /* General */
- tibios.MEM.BIOSOBJSEG = tibios.SDRAM; /* Segment for DSP/BIOS Objects */
- tibios.MEM.MALLOCSEG = tibios.SDRAM; /* Segment for malloc()/free() */
- /* BIOS data */
- tibios.MEM.ARGSSEG = tibios.SDRAM; /* Argument Buffer Section (.args) */
- tibios.MEM.STACKSEG = tibios.IRAM; /* Stack Section (.stack) */
- tibios.MEM.GBLINITSEG = tibios.SDRAM; /* DSP/BIOS Init Tables (.gblinit) */
- tibios.MEM.TRCDATASEG = tibios.SDRAM; /* TRC Initial Value (.trcdata) */
- tibios.MEM.SYSDATASEG = tibios.SDRAM; /* DSP/BIOS Kernel State (.sysdata) */
- tibios.MEM.OBJSEG = tibios.SDRAM; /* DSP/BIOS Conf Sections (.*obj) */
- /* BIOS code */
- tibios.MEM.BIOSSEG = tibios.SDRAM; /* BIOS Code Section (.bios) */
- tibios.MEM.SYSINITSEG = tibios.SDRAM; /* Startup Code Section (.sysinit) */
- tibios.MEM.HWISEG = tibios.SDRAM; /* Function stub memory (.hwi) */
- tibios.MEM.HWIVECSEG = tibios.SDRAM; /* Interrupt Service Table */
- /* Memory (.hwi_vec) */
- tibios.MEM.RTDXTEXTSEG = tibios.SDRAM; /* RTDX Text Segment (.rtdx_text) */
- /* Place RTDX in internal memory */
- /* Compiler Sections */
- tibios.MEM.TEXTSEG = tibios.SDRAM; /* Text Section (.text) */
- tibios.MEM.SWITCHSEG = tibios.SDRAM; /* Switch Jump Tables (.switch) */
- tibios.MEM.CINITSEG = tibios.SDRAM; /* Data Initialization */
- /* Section (.cinit) */
- tibios.MEM.PINITSEG = tibios.SDRAM; /* C Function Initialization */
- /* (.pinit) */
- tibios.MEM.CONSTSEG = tibios.SDRAM; /* Constant Section (.const) */
- tibios.MEM.DATASEG = tibios.SDRAM; /* Data section (.data) */
- tibios.MEM.CIOSEG = tibios.SDRAM; /* Data section (.cio) */
- /*
- * .bss and .far segments should be in internal memory to avoid cache
- * consistency problems with EDMA-ed data (it is by default,
- * so this is more of a reminder)
- */
- tibios.MEM.BSSSEG = tibios.IRAM; /* C variables section (.bss) */
- tibios.MEM.FARSEG = tibios.IRAM; /* C Variables Section (.far) */
- /*
- * Move Object memory segments to external memory
- * to minimize internal memory usage
- */
- var objectModules = prog.modules();
- for (i = 0; i < objectModules.length; i++) {
- if (objectModules[i].OBJMEMSEG == tibios.IRAM) {
- objectModules[i].OBJMEMSEG = tibios.SDRAM;
- }
- }
- /*
- * Move SYS Trace Buffer to external memory
- * to minimize internal memory usage
- */
- tibios.SYS.TRACESEG = tibios.SDRAM;