This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS320C6678: qeustion on parameters 'align' of 'Memory _Alloc' function

Part Number: TMS320C6678


Hi TI,

I have regarded myself that I am fully understand memory allocation function well.

but I realize today I haven't.

Ptr Memory_alloc(IHeap_Handle heapSizeT sizeSizeT alignError_Block *eb);

I can not understand clearly what the parameter above 'align' is for with this description below

"alignment (in MADUs) of the block of memory"

if I allocate the memory whose size is 4 bytes and the value of the parameter 'align' is 4,

are total 16 bytes allocated in alignment?

Regards,

ysshim

  • Dear Customer,

    You might already know this...

    From the user point of view, Whatever the size of the memory you allocate, you should at-least ( i.e., minimum ) get those size of memory allotted.

    If the size is not aligned, it will align and then allocate. Alignment is for the easy and faster accessing purpose.

    ---

    Which version of IPC you use now?? Most likely you might of hit this below bug in IPC!!

    Please note, in IPC version, IPC-3.50.4.08, there is a bug in the heap memory allocation, particularly in the alignment ( i.e., "power of 2" ).

    I recommend you to use the IPC-3.50.4.07.  Go to project properties-->general-->products (next-to-project) and select the IPC version IPC-3.50.4.07.

    ----

    • MADU. Minimum Addressable Data Unit. Also called MAU. The minimum sized data that can be accessed by a particular CPU. Different architectures have different size MADUs. For the C6000 architecture, the MADU for both code and data is an 8-bit byte.

    In general, if you are looking for explanation on memory alignment, visit https://en.wikipedia.org/wiki/Data_structure_alignment

    ---

    Please reply me after experimenting with IPC version 3.50.4.07.  

    With IPC version 3.50.4.07. The heap memory allocation is as expected by you?

    Regards

    Shankari G

  • Dear Shankari G

    Thank you so much for your tips. 

    I have used IPC version of 3.50.4.08.  the only option that I can choose is s.50.4.08. 

    I don't have 3.50.4.07 in my PC.

    where can I download the version?

    Regards,

    ysshim

  • Ysshim-San

    Here you go... Download links: 

     
    Please, not to choose the "A" version of .07
    Regards
    Shankari G
  • Thanks Shankari G

    I have checked  version 3.50.4.07 at the 2nd download link but it seems to be for Linux.

    My CCS doesn't recognize it when I extract the '3.50.4.07' into Ti folder that my TI software packages reside in. 

    Thank you so much for your help.

    you are the best !

    Regards,

    ysshim

  • Hi,

    It is a GIT repository. That's it

    Step 1: Download this ipcdev-3.50.04.07.zip  from the link I have provided.

    Step 2: Install in c:\ti - folder

    Step 3: In CCS, go to window option--> preferences --> code compoer --> RTSC--> products on the right--> products discovery path -- > add .07 IPC

    Step 4 : close.

    ----> Now Go to project properties-->general-->products (next-to-project) and select the IPC version IPC-3.50.4.07.

    Regards

    Shankari G

  • Dear Shangkari G

    Thanks you so much!

    erasing version 3.50.4.08 must be done first before following the procedure you have taught me. right?

    Regards,

    ysshim

  • yes, better to erase.

  • Dear Shankari G

    I have followed the procedure you taught me however it is sorry to say that It doesn't work.

    I also tried it after erasing 3.50.4.08. and it doesn't too.

    comparing two version, I have noticed there isn't eclipse folder in 3.50.4.07

    Is that why the installation gets failed?

    does 'Step 2: Install in c:\ti - folder' mean extracting the zip file into 'c:\ti'?

    Regards,

    ysshim

  • Hi,

    >>does 'Step 2: Install in c:\ti - folder' mean extracting the zip file into 'c:\ti'?

    Yes.

    ---

    Step3: 

    --

    Step 4: 

    -Shankari G

  • Dear G,

    I did the same thing again but It didn't work. I am afraid of bothering you.

    the product discovery path is same as the image you have posted except for 'A'

    but there isn't IPC version 3.50.4.07 on the installed product window.

    I am using CCS ver10.02. I don't think it is a matter.

    Regards,

    ysshim

  • Hi

    Step3: 

    In the product discovery path use "add option" and locate the path, where you installed,  IPC version 3.50.4.07 .

    -Shankari G

  • yoonseok shim,

    I have not heard from you. Assuming it is resolved.

  • Dear Shankari G

    sorry for letting you know so late.

    I tried the solution you provided for few times however I am afraid to say it didn't work.

    so what I did was to just download older version of PDK that contains IPC version 3.50.4.07 and install it.

    I hope that it would be helpful if you receive similar question from someone else. 

    Regards,

    ysshim

  • ysshim,

    I understand the way you included the " IPC version 3.50.4.07" in your project.

    Now, with the " IPC version 3.50.4.07", the memory allocation gives the expected result? 

    The original issue of "align of memory alloc" is solved? have you checked in your programs through debugging? 

    Regards

    Shankari G

  • Dear Shankari G

    can you give me more detail about the original issue?

    I have been being so busy so I couldn't check the issue.

    now I am using "IPC version 3.50.4.07"

    I have faced the couple of unexpected matters but I am not sure it is related to the original issue.

    I am not familiar with IPC modules yet

    Regards,

    ysshim

  • ysshim,

    I mean, your original question , you posted above, about the memory allocation....

    if I allocate the memory whose size is 4 bytes and the value of the parameter 'align' is 4,

    are total 16 bytes allocated in alignment?"

    Ptr Memory_alloc(IHeap_Handle heapSizeT sizeSizeT alignError_Block *eb);

    ----> Are you able to get the expected memory allotted using memory_alloc?

    Regards

    Shankari G

  • Dear Shankari G

    yeah I have not faced a matter about memory allocation issue.

    it seems that memories are allotted in a designated region as intended so far.

    but I am facing different matter.  

    I can figure out values are loaded as intended by local core into shared memory region when I check it through a memory

    browsers of a local core but at the same time, a memory browser of a remote core shows the values are not uploaded into the designated

    address of the shared memory region.

    in this case, the designated memories are colored in blue in the memory browser of the remote core.

    so I am guessing the memories are occupied by L1D cache so the color of the memories is turned into blue. furthermore

    the values are not loaded into the shared memory of a remote core.

    the case aforementioned happens when a remote core tries fetching data from the shared memory region.

    I know It is hard to give me right answer on why cause it only with the info above. 

    can I get any explanation about a cache for shared memory?

    and do you experience any similar issue?

    and I don't understand the explanation below that I have read from 'TI IPC user guide'.

    'The linked list must be on a worst case cache line boundary for all the processors sharing the list.'

    what is the 'worst cache line boundary'? and how can I configure it?

    Regards

    ysshim

  • ysshim,

    If memory_alloc is successful with "IPC version, 3.50.4.07", Let us close this thread.

    Additionally, please remember the list of enhancement/bug fix happened between the IPC version 3.50.4.07 and  3.50.4.08 

    Switch to 08 version now and check whether those errors vanish or not... ( your newly reported problems)

    Regards

    Shankari G