Title: Message
 
Hi,  I have asked one question about memory map previously and got an answer from vwan.
vwan, Thank you for your reply. i learn a lot from you.
 
Now, i have another question about memory map.
 as you know, for XDAIS standard compatibility, we must map all types of memory block provided to algorithm to a appropriate memory segment, just as the configuration in $(EXAMPLE_ROOT_DIR)/servers/videnc_copy/videnc_copy.cfg:

DSKT2.DARAM0     = "DDR";   /* correspondin to IALG_DARAM0 */
DSKT2.DARAM1     = "DDR";   /* correspondin to IALG_DARAM1 */
DSKT2.DARAM2     = "DDR";   /* correspondin to IALG_DARAM2 */
DSKT2.SARAM0     = "DDR";   /* correspondin to IALG_SARAM0 and IALG_SDRAM */
DSKT2.SARAM1     = "DDR";   /* correspondin to IALG_SARAM1 */
DSKT2.SARAM2     = "DDR";   /* correspondin to IALG_SARAM2 */
DSKT2.ESDATA     = "DDR";   /* correspondin to IALG_ESDATA */
DSKT2.IPROG      = "DDR";   /* correspondin to IALG_IPROG  */
DSKT2.EPROG      = "DDR";   /* correspondin to IALG_EPROG  */
DSKT2.DSKT2_HEAP = "DDR";   /* used for DSKT2 itself */ 
 
While, it seems reasonable. but comparing to the all possilbe types of memory block supported by XDAIS standard ( mentioned as below structure defination), i found that for IALG_EXTERNAL, there is no any defination of its memory map.  should it be a bug?  which acutal physical memory does this type of memory block locate in?
I am so looking forward to your response!
 
typedef enum IALG_MemSpace
{
    IALG_EPROG =            /* external program memory */
        IALG_MPROG | IALG_MXTRN,
   
    IALG_IPROG =            /* internal program memory */
        IALG_MPROG,
   
    IALG_ESDATA =           /* off-chip data memory (accessed sequentially) */
        IALG_MXTRN + 0,
   
    IALG_EXTERNAL =         /* off-chip data memory (accessed randomly) */
        IALG_MXTRN + 1,
   
    IALG_DARAM0 = 0,        /* dual access on-chip data memory */
    IALG_DARAM1 = 1,        /* block 1, if independant blocks required */
   
    IALG_SARAM  = 2,        /* single access on-chip data memory */
    IALG_SARAM0 = 2,        /* block 0, equivalent to IALG_SARAM */
    IALG_SARAM1 = 3,        /* block 1, if independant blocks required */
   
    IALG_DARAM2 = 4,        /* block 2, if a 3rd independent block required */
    IALG_SARAM2 = 5         /* block 2, if a 3rd independent block required */
   
} IALG_MemSpace;
-----Original Message-----
From: Wan, Vincent [mailto:[EMAIL PROTECTED]
Sent: Tuesday, November 07, 2006 8:30 AM
To: X. Zhou
Cc: [email protected]
Subject: RE: about memory map setting on davinci platfrom

Hi XhouZiao,

 

See responses below…

 

Best regards,

Vincent

 


From: davinci-linux[EMAIL PROTECTED] [mailto:davinci-linux[EMAIL PROTECTED] On Behalf Of X. Zhou
Sent: Monday, November 06, 2006 5:23 AM
To: davinci-linux[EMAIL PROTECTED]
Subject: about memory map setting on davinci platfrom

 

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.threadAttrs.priority = Server.MINPRI;

Server.algs =

[
    {name: "viddec_copy", mod: VIDDEC_COPY, threadAttrs: {
        stackSize: 4096, stackMemId: 0, priority: Server.MINPRI + 1}
    },
    {name: "videnc_copy", mod: VIDENC_COPY, threadAttrs: {
        stackSize: 4096, stackMemId: 0, priority: Server.MINPRI + 1}
    },
];

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 = [
{
    comment:    "L1DSRAM: L1 SRAM for dynamic algmem allocation and task stack",
    name:       "L1DSRAM",
    base:       0x11F04000,  
    len:        0x10000,      // 64k
    space:      "data"
},
{
    comment:    "IRAM: L2 SRAM for dynamic algmem allocation",
    name:       "IRAM",
    base:       0x11800000,  
    len:        0x8000,       // 32k
    space:      "data"
},
{
    comment:    "DDR: off-chip memory for application code and data",
    name:       "DDR",
    base:       0x8F000000,   // 240MB
    len:        0xE00000,     // 14 MB 

    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:

 

/*  ===========================================================================
 *  MEM : startup and SWI stack size
 *  ===========================================================================
 */
prog.module("MEM").STACKSIZE = 0x1000;

/*  ===========================================================================
 *  TSK : Global
 *  ===========================================================================
 */
prog.module("TSK").STACKSEG = bios.DDR;

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);
            bios.setMemDataHeapSections (prog, bios.DDRALGHEAP_CACHEABLE);
            prog.module("MEM").MALLOCSEG  = 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

This message (including any attachments) is for the named addressee(s)'s use only. It may contain
sensitive, confidential, private proprietary or legally privileged information intended for a
specific individual and purpose, and is protected by law. If you are not the intended recipient,
please immediately delete it and all copies of it from your system, destroy any hard copies of it
and notify the sender. Any use, disclosure, copying, or distribution of this message and/or any
attachments is strictly prohibited.


This message (including any attachments) is for the named addressee(s)'s use only. It may contain
sensitive, confidential, private proprietary or legally privileged information intended for a
specific individual and purpose, and is protected by law. If you are not the intended recipient,
please immediately delete it and all copies of it from your system, destroy any hard copies of it
and notify the sender. Any use, disclosure, copying, or distribution of this message and/or any
attachments is strictly prohibited.


_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to