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.

AWR1642BOOST-ODS: Questions about DATA_SECTION and DATA_ALIGN

Part Number: AWR1642BOOST-ODS
Other Parts Discussed in Thread: AWR1642

Hi,

I want to know the start address of L1,L2,L3.

I noticed that gMmwL1 has something to do with these two instructions, DATA_SECTION and DATA_ALIGN. I can see the explaination of these two in 7.9.5 and 7.9.7 of  TMS320C6000 Optimizing Compiler. But I am still confused. Below are my questions.

1.DATA_SECTION :I know that it is used to allocate space for the gMmwL1 in a section named '.l1data'.But I can't find any info about this section. And I still don't know how to get the start address of L1heap.

2.DATA_ALIGN :I have noticed the alignment several times(also in MMW_ALLOC_BUF). What on earth does the alignment mean in this situation?

Please help me,

Thank you!

  • Hi,

    Alignment is a standard concept. It means that the data will start at an address a multiple of the given alignment value.

    To know about the base addresses of our device, the best source will be the technical reference manual for the device.

    However, you can also see this in a more code centric way. In the source of the labs, linker command files (.cmd files) provide the linker information about were to place objects.

    For example, in dss_mmw_linker.cmd:

    .l1data : type=NOINIT, load=L1DSRAM

    And in c674x_linker.cmd,

    #define L1D_CACHE_SIZE (16*1024)
    
    #if (L1D_CACHE_SIZE < 0x8000)
        L1DSRAM:        o = 0x00F00000, l = (0x00008000 - L1D_CACHE_SIZE)
    #endif

    So, the first snippet identifies where l1data will be placed (in L1DSRAM). The second one defines the origin and length of L1DSRAM.

    Further, if you want to see where individual objects have been placed in the build process, you can read through the .map files generated.

    Regards,

    Aayush

  • Thank you, Mahajan. You've been a great help!

    I have found the start address of L1,L2,L3 in technical reference manual of awr1642. Your answer inspired me to think more deeply.

    I guess .l1data can tell the orign and length of L1DSARM, and DATA_SECTION delivers its orign to gMmwL1, while the length is figured out in dss_data_path.c (MMW_L1_HEAP_SIZE). Am I right?

    The code 

    uint32_t heapL1start = (uint32_t) &gMmwL1[0];
    is used to fetch the start address of L1DSARM to heapL1start, can I just use 
    uint32_t heapL1start = 0xF00000U;
    ?

    Please excuse my ignorance, how can CCS or the C compiler use the dss_mmw_linker.cmd files, or what's the implement details of DATA_SECTION? What does the "link" mean in this situation?

  • Hi,

    No worries, happy to help here!

    I guess .l1data can tell the orign and length of L1DSARM, and DATA_SECTION delivers its orign to gMmwL1, while the length is figured out in dss_data_path.c (MMW_L1_HEAP_SIZE). Am I right?

    I don't think this is exactly right. Essentially, from the linker command files, the linker knows to place gMmwL1 somewhere in .l1data, and to place .l1data somewhere in L1DSRAM. It is not guaranteed that gMmwL1 will be at the start of .l1data, and it is not guaranteed that .l1data will be at the start of L1DSRAM. Depending on how you use it in the overall code, it might very well be the case, but it is not guaranteed with the DATA_SECTION pragma in itself.

    If you want to put something at an exact location, you can use the #LOCATION pragma (see this), but this isn't needed in most cases.

    There is a lot of good TI documentation about linkers and linker command files scattered across multiple user's guides, app notes, etc. This is a great place to start: Linker command file primer.

    If there is something that isn't clear, please feel free to post to this thread.

    Regards,

    Aayush

  • Thank you, Aayush! Your answer help me realize the error of my understanding.

    I take it for granted that the heapL1Start must be the beginning of the L1DSRAM. It comes to my mind that when I use a memory I need to use it from the beginning.

    Depending on how you use it in the overall code, it might very well be the case, but it is not guaranteed with the DATA_SECTION pragma in itself.

    I still have some problems of understanding this.I guess the location of .l1data in L1DSRAM has been predefined. If I want to use the L1D memory for saving new variables and need the start address of where to put a series of variables, all I can do is to obey the settings. Is there a way to modify .l1data? By the way, .l1data is just a predefined area, am I right? 

    Besides, Why is .l1data necessary?Just as you said, I can put all my variables in an exact location.

    Moreover, I get the address of the variable adcDataIn, whose start address is heapL1Start. heapL1Start is exactly the start address of L1DSRAM.

    But it is not the same in L2. The start address of fftOut1D is heapL2Start.(The start address of L2SRAM_UMAP0 is 0x00800000)

    How can customers modify or design where to start to put their variables in the memory?

    Wish you a nice day,

    LIU