Post Go back to editing

Cache of 21569


ADI example code are all based on DMA.I want to know how to config 21569 to using cache automatically?could you please give me corresponding example?

I mean let the core automatically using I-cache,D-cache,P-cache while it is running.

Best regards,


Parents Reply Children
  • Hi Binge,

    Apologies for the delayed response.

    Yes, you can place your entire code in to L2 memory based on the memory.Please refer the simple example project attached.

    By default, functions in the 'Test.c' file mapped in the output section 'L1_data_b_prio2' with in the l1 memory section 'MEM_L1_DATA_B'. If you want to map the whole object file(Test.doj) in different memory section(L2 memory),this can be done by simply adding the following line to an appropriate section in the app.ldf(LDF file ):

    INPUT_SECTIONS( Test.doj(seg_swco) )

    Your LDF should then be roughly of the form:

        l2_sw_code SW
           FILL(0x1)                             // fill gaps in memory with NOPs
           INPUT_SECTIONS( Test.doj(seg_swco) )
        } > MY_L2_CACHED_MEM

    Any hand-edits you make within the LDF file in a Source Window should be made within the generated $VDSG sections, to preserve them if/when the LDF is automatically regenerated by the tools. Below is an example:
    /*$VDSG<insert-......>                            */
    /* Text inserted between these $VDSG comments will be preserved */

    If you are encountering problems modifying the LDF to control the placement of your code, it is recommended that you make use of the "#pragma section" and "#pragma default_section" qualifiers. For example, if you are trying to place the code from 'Test_pragma.doj' into MY_L2_CACHED_MEM, you could use the default_section pragma in the global scope of the source to control the placement of data:

    ===file Test_pragma.c===
    #pragma default_section(CODE, "seg_l2_swco") /*the rest of your code*/ ====EOF====

    This pragma remains in force for a section category until its next use with that particular category, or the end of the file.

    Please refer in CCES help for more information:
    CrossCore(r) Embedded Studio 2.10.0 > SHARC(r) Development Tools Documentation > C/C++ Compiler Manual for SHARC(r) Processors > Compiler > C/C++ Compiler Language Extensions > Pragmas > Linking Control Pragmas > #pragma section/#pragma default_section

    Anand Selvaraj.