Shop OBEX P1 Docs P2 Docs Learn Events
problem when using propeller-load with xmmc or xmm-single (propgcc default branch) - Page 4 — Parallax Forums

problem when using propeller-load with xmmc or xmm-single (propgcc default branch)

124»

Comments

  • trancefreaktrancefreak Posts: 186
    edited 2014-03-05 00:42
    Hi David,

    I have a question with regards to reducing cache size.
    The standard config looks as follows:
    # cache geometry - 128 * 64 = 8192 byte cache
    index-width: 7      # 2^7 = 128 cache lines
    offset-width: 6     # 2^6 = 64 byte cache lines
    cache-geometry: ({index-width} << 8) | {offset-width}
    

    I want to reduce it to 4 k in the first step. Is it better to first reduce the offset-width or the index-width? To get 4k I can write:
    index-width: 7
    offset-width: 5

    or
    index-width: 6
    offset-width: 6

    Both result in a cache size of 4k.
    Which is the preferred way to reduce the cache size or doesn't it matter which value is reduced?


    Christian
  • David BetzDavid Betz Posts: 14,516
    edited 2014-03-08 14:14
    Hi David,

    I have a question with regards to reducing cache size.
    The standard config looks as follows:
    # cache geometry - 128 * 64 = 8192 byte cache
    index-width: 7      # 2^7 = 128 cache lines
    offset-width: 6     # 2^6 = 64 byte cache lines
    cache-geometry: ({index-width} << 8) | {offset-width}
    

    I want to reduce it to 4 k in the first step. Is it better to first reduce the offset-width or the index-width? To get 4k I can write:
    index-width: 7
    offset-width: 5

    or
    index-width: 6
    offset-width: 6

    Both result in a cache size of 4k.
    Which is the preferred way to reduce the cache size or doesn't it matter which value is reduced?


    Christian
    I would think that more cache lines would probably be better than bigger cache lines so the 5/7 setting might work better. However, it is very dependent on your code. Try both and see which works best. Sorry for being evasive but it really does depend on the application.
  • trancefreaktrancefreak Posts: 186
    edited 2014-03-09 01:44
    David Betz wrote: »
    I would think that more cache lines would probably be better than bigger cache lines so the 5/7 setting might work better. However, it is very dependent on your code. Try both and see which works best. Sorry for being evasive but it really does depend on the application.
    Hi David,

    I'm using the 7/5 setting. This is much faster than 5 (# cache lines) / 7 (# bytes cache lines) or 6/6 at least for my program ;-).

    Christian
  • David BetzDavid Betz Posts: 14,516
    edited 2014-03-09 06:14
    Hi David,

    I'm using the 7/5 setting. This is much faster than 5 (# cache lines) / 7 (# bytes cache lines) or 6/6 at least for my program ;-).

    Christian
    I meant 7 bits for cache index and 5 bits for cache offset. Thanks for correcting me. I should have said 7/5 rather than 5/7.
Sign In or Register to comment.