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.

Enabling cache on C6670

Other Parts Discussed in Thread: SYSBIOS

Hi,

I would like enable caching for access to DDR. There is some information on the wiki which says that the MAR bits need to be set on C64x+

http://processors.wiki.ti.com/index.php/Enabling_64x%2B_Cache

When I try to set the MAR bit in my .cfg file like this

var Cache = xdc.useModule('ti.sysbios.family.c66.Cache');
Cache.MAR_128_159 = 0xFFFFFFFF;

the compiler complains that MAR_128_159 is not recognised, which is fair as I don't know what exactly to set.

Do I need to set the MAR bits. And if yes, how do I do it?

cheers

Chiang

  • You state you are using c64+ but used the c66 family Cache module.

     

    Try

    var Cache = xdc.useModule('ti.sysbios.family.c64p.Cache');

  • Hi I am using C6670, not C64+. The wiki was about configuring for C64+, but I would like to know how to enable caching for C6670.

  • Then instead of addressing specific MAR register bits, you can just do:

    Cache.setMarMeta(0x80000000, 0x20000000, Cache.PC | Cache.PCX | Cache.PFX | Cache.WTE );

    Where the first argument is the base address of your DDR section, the 2nd argument is the length of that section, and the 3rd arguments is a bit combination: PC is caching, PCX is external caching (not sure what that means myself), PFX is prefetching, and WTE is write-through-enabled.  This is all documented in the BIOS documentation included in the docs folder (cdoc then 'index.html').

    By default, I think PC and PFX are already set, so caching is already enabled.

  • Thanks Tim for the pointers. I'm still working my way through all the documentations that comes with the packages as well as those available on the TI site.

    All four arguments you mentioned are set in my case (most probably by default). I wonder if there's a way to check whether caching is enabled in CCS5 more easily. I seem to remember reading documentations that mentions XGCONF which can be used to view SYS/BIOS configuration in CCS4. Is there an equivalent in CCS5?

    Cheers

    Chiang 

  • I'm confused by what you mean when you say that all 4 are on by default -- because they aren't all on by default.

    What I was saying is that unless you explicitly include and put different arguments into the Cache.setMarMeta configuration, the performance should be the same.  This includes the case where you don't explicitly include the Cache module at all: it already caches DDR.

     

    XGCONF is in CCS5 and should be the default editor whenever you open a .cfg file in CCS4 or CCS5.  If not, you can open a cfg file with XGCONF by right-clicking on the cfg file in CCS, choosing "Open With" and then choosing "XGCONF".  Because XGCONF loads in so many settings, it takes a while to load, but it helps by letting you know what possible module parameters are rather than remembering them yourself in a source file.

    After you include a module in the source of the cfg file, then it should appear in XGCONF.

  • > I'm confused by what you mean when you say that all 4 are on by default -- because they aren't all on by default.

    Yes you are right, not all the four bits of the MAR registers are set by default. Cache_WTE is not set. I have forgotten about the line which I put in where all four bits set, oops. FYI I noticed that setMar is used in the documentation (under cdoc), rather than setMarMeta which is the recognised method.

    > What I was saying is that unless you explicitly include and put different arguments into the Cache.setMarMeta configuration, the performance should be the same.  This includes the case where you don't explicitly include the Cache module at all: it already caches DDR.

    I concur with this.

    > XGCONF is in CCS5 and should be the default editor whenever you open a .cfg file in CCS4 or CCS5.  If not, you can open a cfg file with XGCONF by right-clicking on the cfg file in CCS, choosing "Open With" and then choosing "XGCONF".  Because XGCONF loads in so many settings, it takes a while to load, but it helps by letting you know what possible module parameters are rather than remembering them yourself in a source file.

    Haven't realised that that IS the XGCONF. Thanks. The MAR registers are not shown in XGCONF. I guess that is normal?

    > After you include a module in the source of the cfg file, then it should appear in XGCONF.

    Yes, it does.


    cheers,

    Chiang


  • XGCONF doesn't show everything unfortunately. As far as I know, the most comprehensive list is in the CDOC documentation typically found in each packages doc/ folder.  Most of those fields are valid to be typed into the cfg (and typically the ones that can't be set in the cfg can be set at runtime using C code)