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.

BIOS Sizing - removing dynamic management of BIOS objects

Hello,

I read that if you remove dynamic management of BIOS objects, it will remove the supporting code resulting in a significant code reduction included in your build. We make extensive use of SWI objects which are managed dynamically by SWI_create() and SWI_delete(). As a quick test I just removed the calls to these functions to see what code savings I would have using global swis instead. However I did not see any code reduction and I did check that those functions are no longer in the build. I must be missing something else, maybe an option in the TCF file or use of other SWI functions such as the SWI attrubute functions? I am using CCS3.3 and BIOS_5_33_03 and C55x 4.3.1 Code generation tools.

Thanks in advance.

Jordon

  • Hi Jordon,

    I'm assuming you are talking about the "No Dynamic Memory Heaps" option in the MEM configuration. You need to make sure that you do not do any MEM_alloc calls elsewhere in your app.

    Can you include some mapfile comparisons to make sure we are on the same page in regards to "significant"?

    I played with the BIOS Swi example some. Here is the top of the resulting mapfile. Note, I'm not sure which device you are using, so you mileage will vary.

         name               origin    length     used      unused    attr  fill
    ----------------------  --------  ---------  --------  --------  ----  --------
      L2RAM                 00800000   00100000  0000ae61  000f519f  RWIX
     

    When I enabled "No Dynamic Memory Heaps", the used went from 0x0000ae61 to 0x00008d41. So a drop of 8480 bytes. This is because the MEM module was not brought in.

    Couple questions:
    1. Can you take a look in the mapfile to make sure there are SWI_create/delete's hanging around.
    2
    . Did you enable the "No Dynamic Memory Heaps" option? Can you make sure there are no <BIOS Module>_create (or delete) calls present in the mapfile. Also make sure the MEM_xxx calls in the mapfile. If you leave any <BIOS Module>_create (or delete) calls in your app, MEM gets pulled in also.

    Todd

  • Hi Tom,

    Thanks for the input. You are correct in that I still had MEM_alloc/free calls in the code. Also I did not uncheck the use of dynamic heaps in the bios config. After I fixed that, I verified there were no XXX_create or XXX_delete in my map file as well as MEM_xxx calls. My heap was defined as 0x800 (is this in bytes of words?) in the BIOS/CONFIG GUI and located in DARAM and BIOS code is located in SARAM. I found:

    ORIGINAL:

             name            origin    length      used     unused   attr    fill

     

                            (bytes)   (bytes)    (bytes)   (bytes)

    ----------------------  --------  ---------  --------  --------  ----  --------

      DARAM                 00000100   0000ff00  0000d6c8  00002838  RWIX

      SARAM                 00010000   00017f00  000170ef  00000e11  RWIX

    NEW:

            name            origin    length      used     unused   attr    fill

                            (bytes)   (bytes)    (bytes)   (bytes)

    ----------------------  --------  ---------  --------  --------  ----  --------

      DARAM                 00000100   0000ff00  0000e6ee  00001812  RWIX

      SARAM                 00010000   00017f00  000176ea  00000816  RWIX

     

    Does this seem accurate based on my description above? It seems I made more gains in DARAM even with accounting for the 0x800 heap size (still is this bytes or words?) but we will have to replace the heap memory statically somewhere in internal memory so I really cant count that as a gain. I do not understand in what section the MEM module and the dynamic SWI management code benefits are located. It seems mostly in DARAM not SARAM where I would have expected the latter.

    By significant gains, I thought I had read by removing dynamic management for a BIOS object you can reduce the supporting code by 50%. I could not find where I read that but maybe that was just wishful thinking!

    BTW I am using the C55x. Also what is your heap size in your example? Again I do not think you can count that as a gain.

    Thanks Jordon

  • Hi Jordon,

    Good point about not counting the heap as saving. The Swi example that I did the test on did not actually need to the heap, so in this trivial example, it was true savings (and the majority also since the heap was 8192 bytes!).

    So you are looking at around 3600 bytes savings (not counting the actual heap memory). I'd have to look at the actual mapfile and your configuration file to know if this made sense. The best thing to do is simply compare the before and after mapfiles and see what was removed. Generally BIOS has a small footprint, so you can't get too much savings relative to your app.

    Do have a goal that you need to achieve or are you just looking to free up some memory for future growth? There are other things can be removed, at the cost of functionality. For instance, you can removed RTA/RTDX, but then you lose certain runtime debug capabilities. Take a look at http://focus.ti.com/general/docs/litabsmultiplefilelist.tsp?literatureNumber=spra772a for more details.

    Also the mapfiles numbers for 55x are in bytes, not words.

    Todd

  • Hi Todd,

    Yes I did go through that docuement and I beleive I have only the core BIOS functions that our app needs, no instrumentation, etc. I would be interested in you taking a look at my configuration. I requested you as a friend and maybe that allows me to send a PM or "conversation" as it is called?

    Thanks. Jordon