Post Go back to editing

How to caculate the addresses in LDF file

Hi,

Here is a part of an LDF file which is copied from a refrence ADSP-21487 project:

seg_sigma_extdata { TYPE(PM RAM) START (0x000E4DD8) END (0x000E5260) WIDTH (48)}
ss_block7_code { TYPE(SW RAM) START (0x001CF724) END (0x001CF72F) WIDTH (16)}
ss_block8_data { TYPE(DM RAM) START (0x000E7B98) END (0x000E7BA3) WIDTH (32)}

If we want to reduce the length of 'seg_sigma_extdata' and enlarge 'ss_block7_code', how can we caculate new end address of 'seg_sigma_extdata' and new start address of 'ss_block7_code'?

Thanks.

  • i think your can modified the LDF file directly. and whats more, the memory map file can be referneced

  • Dear Yosen,

    Thanks but my question is when we modify the LDF file, how to caculate the new address of the 48bit segment.

    For example, if we reduce the 'seg_sigma_extdata' to 0x000E4DD8 ~ 0x000E4fff, where the start of 'ss_block7_code' should be moved to?

    Thx

  • Solved, found the answer in programming reference guide:

    m = B + (3/2 (n – B)) + 1
    where:
    n is the first unused address after the end of 48-bit words
    • B is the base normal word 48-bit address of the internal memory block
    m is the first 32-bit normal word address to use after the end of 48-bit words.

     

    ......

     

    Example: Calculating a Starting Address for 32-Bit Addresses

    Given a block of words in the range 0x90000 to 0x92694 (block 0), the
    next valid address is 0x92695. The number of 48-bit words (n) is:
    n = 0x92695 - 0x80000 = 0x12695.
    When 0x12695 is converted to decimal representation, the result is 75413.
    The base (B) normal word address of the internal memory block is 0x80000. The first 32-bit normal word address to use after the end of the 48-bit words is given by:
    m = 0x80000 + (3/2 (75413)) + 1
    m = 0x80000 + 0x1B9E0
    m = 0x80000 + 0x1B9E0 = 0x9B9E0
    The first valid starting 32-bit address is 0x9B9E0.