|
Hi XhouZiao, See responses below… Best regards, Vincent From: Hi all, I have serveral questions about memory map setting
on davinci platfrom. (1). i want to locate the stacks of DSP algorithms
running on DAVINCI DSP to a specific memory segment. How should i do? as you know, I use the DVSDK examples software shipped with
DVEVM6446 board as my development template. I found that in
$(EXAMPLE_ROOTDIR)/servers/video_copy/video_copy.cfg file, there is some
stack-related configurations: Server.threadAttrs.stackSize = 2048; Server.algs = [ In my opinion, stackMemId should be the
memory segmenet ID for each DSP algorithm. But how could i know which ID is
correspondin to my target memory segment? For example,
i have 3 memory segments in my *.tcf file: var mem_ext = [ space:
"code/data" ... } i want to map stack of a DSP algorithm to
L1DSRAM, then, which segment id does L1SDRAM correspond to? [vw] Try this: Open the .cdb file located under
the \package\cfg subdirectory of your server directory. Double click on System->MEM.
This should list all the segments in order. Note that not all segments have a
heap (only L1DSRAM, DDR and DDRALGHEAP have one), and stackMemId corresponds to
heap id. The first segment in the list that has a heap defined will have heap
id 0, the 2nd segment in the list with a heap defined will have heap
id 1, etc. If you haven’t changed the examples, I believe the heap in L1DSRAM
is segment 2. You can also verify the segment id at
run-time in CCS by opening the Kernel Object View and checking under the MEM
category. The id of each segment is specified in the Mem Segment column. (2). another question, besides the setting in the above file,
there are some stack-related
configuration in $(EXAMPLE_ROOTDIR)/servers/video_copy/video_copy.tcf file as
well: /*
=========================================================================== /*
=========================================================================== I want to know the difference between the stack
in *.tcf file and the stack in *.cfg file. Does they point to the same stack? maybe, i need more detail information about all possible
stack types in DSP/BIOS. as far, i know there are 4 types of stacks in
DSP/BIOS: system stack ( ==
global stack???); task stacks(each task have its indepedent
stack); SWI stack; HWI stack; but i am not very clear about the system stack. Anyone can
give me a more detailed explanation? [vw] There are really 2 types of stack: system
stack and task stacks. SWI and HWI both use the system stack (also IDL threads
if TSKs are not enabled). See table 4.1.3 in the DSP/BIOS users guide (spru423f.pdf)
which summarizes this. The stack sizes/ids in the *.cfg file correspond to TSK
stacks. As you probably know, each algorithm instance in CE is run in a
separate task, each with its own stack. There is also an RMS task which again
has its own stack. The system stack size can be set in the .tcf
file via the MEM.STACKSIZE property as you have shown above. The TSK.STACKSEG
property sets the default stack segment for dynamic task creation. (3) in $(EXAMPLE_ROOTDIR)/servers/video_copy/video_copy.tcf
file,
bios.setMemDataNoHeapSections (prog, bios.DDR); what is the MemDataNoHeapSections??? what is the
MemDataHeapSections?? what is the difference between
of MemDataHeapSections and ".sysmem" section? and does the
"prog.module("MEM").MALLOCSEG = bios.DDR" setting
mean that, if i use malloc() ( not MEM_alloc() ) function to allocate memory,
DSP/BIOS will map the ".sysmem" section
to "bios.DDR" segment, i.e., DSP/BIOS will get memory
from the heap located in "bios.DDR" segment? [vw] The helper functions are defined in \bios_5_30\packages\ti\bios\bios.tci.
In brief, setMemDataNoHeapSections sets all data sections to a particular
segment (i.e. bios.DDR), if the data section does not require a segment in
which a heap is defined. setMemDataHeapSections sets all data sections
requiring a heap to a particular segment in which a heap is defined. TSK.STACKSEG
would be an example of a section requiring a segment with heap. And yes, "prog.module("MEM").MALLOCSEG
= bios.DDR" means malloc() will allocate memory from the heap in bios.DDR. Any opinion is appreriated! BR, ZhouXiao
|
_______________________________________________ Davinci-linux-open-source mailing list [email protected] http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source
