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.

two simple questions about simulation

I'm using the C55xx Cycle Accurate Simulator of CCS2.0 to simulate a project designed for 5509 DSK.There's a little thing puzzles me a lot.My cmd file is like this:

MEMORY
{
 PAGE 0:
    PROG0(RWX)    : origin = 04000h   length = 08000h
    P_VECT(RIX)     : origin = 0FF80h   length = 00080h
 PAGE 1:
    DATA0(RW)     : origin = 0C000h   length = 04000h
}

SECTIONS
{

  .vectors              : { } > P_VECT      PAGE 0
  .text                  : { } > PROG0       PAGE 0
  .cinit                 : { } > PROG0       PAGE 0  
  .csldata            : { } > DATA0           PAGE 1
  .stack                : { } > DATA0       PAGE 1 
  .sysstack          : { } > DATA0           PAGE 1
  .bss                  : { } > DATA0       PAGE 1  
  .cio                   : { } > DATA0       PAGE 1
  .const                : { } > DATA0       PAGE 1
  .sysmem               : { } > DATA0       PAGE 1 
}      
why's that when I look for _bss from the"memory",it starts at 006606,meanwhile _sysstack locates at 006412,although I assigned them from 0c000h? How come identifier _cio and _const can't be found? And why _cinit is found from "data"page? Would you tell me the causes?

My second question is which datasheet would you recomend me to read if I want to use CCS2.0 to debug my project?

Please excuse my poor English,thanks for your help.

  • For some background of this information, I would suggest reviewing the TMS320C55x Optimizing C/C++ Compiler User's Guide (SPRU281).

    KevinWoo said:

    MEMORY
    {
     PAGE 0:
        PROG0(RWX)    : origin = 04000h   length = 08000h
        P_VECT(RIX)     : origin = 0FF80h   length = 00080h
     PAGE 1:
        DATA0(RW)     : origin = 0C000h   length = 04000h
    }

    SECTIONS
    {

      .vectors              : { } > P_VECT      PAGE 0
      .text                  : { } > PROG0       PAGE 0
      .cinit                 : { } > PROG0       PAGE 0  
      .csldata            : { } > DATA0           PAGE 1
      .stack                : { } > DATA0       PAGE 1 
      .sysstack          : { } > DATA0           PAGE 1
      .bss                  : { } > DATA0       PAGE 1  
      .cio                   : { } > DATA0       PAGE 1
      .const                : { } > DATA0       PAGE 1
      .sysmem               : { } > DATA0       PAGE 1 
    }      
    why's that when I look for _bss from the"memory",it starts at 006606,meanwhile _sysstack locates at 006412,although I assigned them from 0c000h?

    You have defined a memory block starting at 0C000h with a size of 04000h.  In the SECTIONS statement, you are specifying to place the following sections into this memory block called DATA0, .csldata, .stack, .sysstack, .bss, .cio, .const, .sysmem.  These sections can not all start are 0C000h, otherwise they would overlap.  The linker will parse this file from top down and begin placing sections into the specified memories.  I suspect the section which is actually located at 0C000h is .csldata.  Your .stack will start at an address which is 0C000h+(size of .csldata).  This will be true for the other sections as well.

     

    KevinWoo said:

    How come identifier _cio and _const can't be found?

    Do you actually have C I/O buffers and Constant data in your program?  Are you looking at your map file for this information?

     

    KevinWoo said:

    And why _cinit is found from "data"page?

    I'm not sure I quite understand what you are meaning here.

     

    KevinWoo said:

    My second question is which datasheet would you recomend me to read if I want to use CCS2.0 to debug my project?

    Are you asking about manuals for CCS, or the device you are targeting?

  • KevinWoo said:

    why's that when I look for _bss from the"memory",it starts at 006606,meanwhile _sysstack locates at 006412,although I assigned them from 0c000h?

    The linker is described in the Assembly Language Tools Guide.  Chapter 8 in particular describes the linker.  On page 303 (of rev h) the MEMORY directive is described and it shows origin and length being specified in bytes.  Since data space on 55x is given in 16-bit words, the address/size is divided by 2 to convert from bytes to words.

    KevinWoo said:

    How come identifier _cio and _const can't be found? And why _cinit is found from "data"page? Would you tell me the causes?

    The cio and const sections are probably empty and therefore omitted.  The cinit function contains tables of initial values for global variables.  Therefore it is considered data, not code.

    KevinWoo said:

    My second question is which datasheet would you recomend me to read if I want to use CCS2.0 to debug my project?

    If you're looking for CCS help you should be able to find a lot of info under the Help menu directly in CCS.

  • Thank you all for your time and useful advice.I really appreciate your help.[;)]

    While the thing is neither 006606 nor 006412 belongs to the 4000h begins at 0c000h. Why's that?

  • Your DATA0 section starts at byte address 0xC000 and has a length of 0x4000.  That means anything assigned to it would be in the byte address range of 0xC000 - 0xFFFF.  In data space (16-bit) that corresponds to addresses 0x6000 - 0x7FFF.  The items you mention are both data and so they fall in the 0x6000 - 0x7FFF range since their addresses are word addresses, not byte addresses.