• Join
  • Sign In with my.TI Login
Texas Instruments
  • Products
  • Applications
  • Tools & Software
  • Support & Community
  • Sample & Buy
  • About TI
Sample & Purchase Cart Sample & Purchase Cart
  • Search
  • Advanced
TI E2E™ Community
  • Support Forums
  • Blogs
  • Groups
  • Videos
  • 简体中文
  • More ...
TI Home » TI E2E Community » Support Forums » Embedded Software » BIOS » BIOS forum » Some questions of the cache optimization
Share
BIOS
  • Forum
  • Announcements
Options
  • Subscribe via RSS

Forums

Some questions of the cache optimization

This question is answered
Miao ZHANG
Posted by Miao ZHANG
on Apr 14 2012 21:40 PM
Prodigy95 points

My device is DM6446, os is win7 32bit, ccs3.3, and my work is transport X264 encoding to c64x+ DSP.

Now I face some questions about  using cache to optimize my project.

1.  why I cannot put code of a function on L1DSRAM, even when I set the space of L1DSRAM as code/data in dsp/bios ( by using code_section() )

2.   when the input data is on L1DSRAM, is there benefit to put the relevant function on L2SRAM ?

for example, in the function

static inline void x264_macroblock_cache_ref( x264_t *h, int x, int y, int width, int height, int i_list, int ref )
{
   
    int dy, dx;
    for( dy = 0; dy < height; dy++ )
    {
        for( dx = 0; dx < width; dx++ )
        {
            h->mb.cache.ref[i_list][X264_SCAN8_0+x+dx+8*(y+dy)] = ref;
        }
    }
   
}

mb.cache.ref[] is on the L1DSRAM, but when I put the code of this function on L2SRAM instead of the DDR SDRAM, I cannot see any improvement but a worse speed.

why? Should I simultaneity put mb.cache.ref[] on L2SRAM ?

3. Is better to use data_section() than use MEM_alloc()  to put the data on the specified memory section?

PS:All the functions mentioned above are used correctly

thanks

dm6446 cache
Report Abuse
  • Reply
You have posted to a forum that requires a moderator to approve posts before they are publicly available.
All Replies
  • Steven Connell
    Posted by Steven Connell
    on Apr 16 2012 21:22 PM
    Mastermind20540 points

    Hi Miao ZHANG,

    Which version of BIOS are you using?

    How are you configuring the cache?  Are you setting the MAR bits properly?

    Miao ZHANG
    1.  why I cannot put code of a function on L1DSRAM, even when I set the space of L1DSRAM as code/data in dsp/bios ( by using code_section() )

    Can you please provide some code snippet of this configuration?

    Miao ZHANG
    3. Is better to use data_section() than use MEM_alloc()  to put the data on the specified memory section?

    are you referring to the #pragma DATA_SECTION() ? This #pragma is used to place the global data object in the given section instead of the default section .bss.  MEM_alloc() is used to dynamically allocate memory off of the heap at run time.

    Can you please attach your *.tcf file to this post, as well as your application's *.map file? It will help with understanding your problem and how to solve it.

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Miao ZHANG
    Posted by Miao ZHANG
    on Apr 18 2012 04:15 AM
    Prodigy95 points

    First of all, I would like to thank you for your help

    Steven Connell

    Which version of BIOS are you using?

    How are you configuring the cache?  Are you setting the MAR bits properly?

    the version of BIOS is 5.33.06, and CCS is 3.3.81.6

    And I think I set the MAR bits properly with help of C64x+ Cache.pdf,like 

    Steven Connell
    Can you please provide some code snippet of this configuration?

    for examply, I set a section in L1DSRAM in .cmd file: 

    SECTIONS
    {
    .code:     {} > L1DSRAM
    }
    then I put the a function in this section:
    #pragma CODE_SECTION ( function1, ".code");
    function1(){
    ...}
    and when the projet runs, italways hangs in function1, and I believe the problem should be using #pragma CODE_SECTION ( function1, ".code") to put code in L1DSRAM.
    
    

    And I also want to know have you any idea about my question 2 ?
    
    

    here are the .tcf, .cmd (dm6446cfg.cmd is auto-generated by DSP/BIOS and mylink.cmd is added by myself ) and the .map files8204.tcf_cmd_map.rar
    
    

    Thanks again

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • Steven Connell
    Posted by Steven Connell
    on Apr 20 2012 17:32 PM
    Mastermind20540 points

    Hi Miao ZHANG,

    Miao ZHANG:
    1.  why I cannot put code of a function on L1DSRAM, even when I set the space of L1DSRAM as code/data in dsp/bios ( by using code_section() )

    I think you may be trying to place code into L1DSRAM when it is configured as a data cache.  L1D cache is only for caching data.

    Steve

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
  • judahvang
    Posted by judahvang
    on Apr 20 2012 17:42 PM
    Verified Answer
    Verified by David Friedland
    Genius16715 points

    Miao,

    L1 is faster than L2 and L2 is faster than SDRAM.

    There is only 32KB of memory in L1 that can be RAM/CACHE.  Since you specified 32KB for Cache, there is no RAM left there that you can place data.
    You best bet is to put stuff into the L2 memory.

    Judah

    If my reply answers your question please mark the thread as answered

    Report Abuse
    • Reply
    You have posted to a forum that requires a moderator to approve posts before they are publicly available.
TI E2E™ Community
  • Support Forums
  • Blogs
  • Videos
  • Groups
  • Site Support & Feedback
  • Settings
TI E2E™ Community Groups
  • TI University Program
  • Make the Switch
  • Microcontroller Projects
  • Motor Drive & Control
Other Communities
  • Deyisupport
  • Designsomething.org
  • beagleboard.org
  • TI on Element 14
  • TI on TechXchangeSM
Other Technical & Support Resources
  • WEBENCH® Design Center
  • Product Information Centers
  • Technical Documents
  • TI Design Network
  • TI Technical Articles
  • TI Training

All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with respect to these materials. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms of Use of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms of Use of this site. TI, its suppliers and providers of content reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Follow Us Texas Instruments on Facebook Texas Instruments on Twitter Texas Instruments on LinkedIn Texas Instruments on Google+
TI Worldwide | Contact Us | my.TI Login | Site Map | Corporate Citizenship | mobile m.ti.com (Mobile Version)

TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs and
embedded processors, along with software, tools and the industry’s largest sales/support staff.

© Copyright 1995-2013 Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy Policy | Terms of Use