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.

how to watch the PCIe registers

Hello,

I am trying watch the PCIe registers in ccsv5.2. But there's no PCIe registers in the Registers View.

I want to know how can I watch these registers in ccsv5.2.

thank you

  • Hi,

    I have another question about registers. When we use the emulator there some parts of the memory that is protected and wew can't read them. How can we see the content of the registers that are stored in the portion of the memory?

    Thanks

  • Hi Jing Bai,

    I think there's a way you can do that, altough it's not practical I think it works:

    Declare a pointer to your register

        unsigned int *NAME_OF_REG;

    And then make it points to the address of your register

        NAME_OF_REG = (unsigned int *) ADDRESS_OF_REG_IN_HEXADECIMAL;

    This way you could see the value of the register in the Expressions View dereferencing the register (*NAME_OF_REG), as I said, it's not practical. You would have to know the exact address of the registers. But it will work if the PCIe registers are defined as R (read) in the gel file, look for something like PCIe config in the memory map in the gel file. If it's protected you'll get a message like this

    unknown    Error: Memory map prevented reading of target memory at 0x........

    Does any know to read the content of the memory region that's is protected by the meory map of gel files?

    Thanks

  • Johannes said:
    Does any know to read the content of the memory region that's is protected by the meory map of gel files?

    If a region of memory is specified as non-accessible by the debugger memory map, but it is valid memory, you will need to disable (or modify) the debugger memory map.

    The debugger cannot access memory that is blocked by the debugger memory map.

    Thanks

    ki

  • Hi, Ki

    Thanks for tour answer.

    I do this by editing the gel file, right? Specifying the region like:

    GEL_MapAddStr( start_address, 0, size, "R|W|AS4", 0 );

    If I make some mistake will be there any problem or I can use the original .gel, start again and it will be ok?

    BTW, what these two '0' parameters mean? I've looked at this document (http://www.ti.com/lit/an/spraa74a/spraa74a.pdf) about gel files, but it just has the example of use, not the explanation of the function syntax.

    Regards

  • Johannes said:

    I do this by editing the gel file, right? Specifying the region like:

    GEL_MapAddStr( start_address, 0, size, "R|W|AS4", 0 );

    Yes, you can use GEL_MapAddStr to specify an additional range of memory to the debugger.

    Johannes said:
    If I make some mistake will be there any problem or I can use the original .gel, start again and it will be ok?

    Well you would confuse the debugger and you can potentially cause an emulation error if the debugger thinks a memory range is accessible when it is not. It can hang the debugger as it waits to access memory that is not there. But it is nothing major. You just close the debug session, make your change to the gel file and try again.

    Johannes said:
    BTW, what these two '0' parameters mean? I've looked at this document (http://www.ti.com/lit/an/spraa74a/spraa74a.pdf) about gel files, but it just has the example of use, not the explanation of the function syntax.

    It's in the help that ships with CCS. Cut and paste from the help:

    ----------

    GEL_MapAddStr()
    Adds to the memory map.

    Syntax

    GEL_MapAddStr(address, page, length, "attribute", waitstate );

    Parameters

    address:starting address of a range in memory. This Parameters can be an absolute address, any C expression, the name of a C function, or an assembly language label.

    page:identifies the type of memory to fill: 0 (Program memory), 1 (Data memory) or 2 (I/O space)

    For processors which do not have more than one type of memory, use 0 for this Parameters. For simulated targets, the I/O Space option is not supported.

    length:defines the length of the range. This Parameters can be any C expression.

    attribute:defines one or more attributes for the specified memory range. The attributes must be enclosed in quotation marks. See Predefined Attribute Strings. Additional attributes may be supported for your device driver.

    More than one attribute can be specified. Use the vertical bar "|" character to separate multiple attributes. For example, "R|W|P" is equivalent to "IOPORT".

    Access size can be specified using "ASn", where n is the access size in bytes. For example, "R|AS4" specifies 32 bits ROM.

    The attribute "SHnC" can be used to define a block of shared memory.

    waitstate:defines the number of waitstates. When reading from or writing to slower external memory, the CPU waits one extra clock cycle for every waitstate. The waitstate Parameters accepts any non-negative integer value (for example: 0, 1, 2, 3).