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.

AM6442: PRU CCS Variables view pointing to the wrong memory location

Part Number: AM6442

Hello,

I an writing some code to test the CCS PRU Debug interface. I am using AM64x EVM, ICSSG0_PRU0, and CCS 11.2.

The variable window sees variables in the wrong location in memory. Because of that, changing the variable value in the window does not actually do anything.

In the above image, I set x = 1, y = 2, and z = 0. The stack is size 0x100, starting at Data Memory address 0x0. It looks like the PRU compiler has x placed at 0xF0, y placed at 0xF4, z placed at 0xF8. The statement z = x + y just executed, so we can see that 0xF8 just updated to a value of 3.

However, x, y, and z in the Variable view all still say 0. "Location" seems to indicate that they are stored at 0x0, 0x4, and 0x8. And when I update those values in the Variables window, those addresses are updated:

Any idea of what is going on?

Thanks,

Nick

  • Hi Nick,

    Can you share your executable and source files?

    Thanks

    ki

  • Hello Ki,

    project and executables are attached.

    Thanks,

    Nick

    pru_add_c_am64x.zip

  • Thanks Nick. I can reproduce the issue. I filed a bug for it and added you as a watcher. 

  • Sounds good, thanks Ki! For now I'll write my documentation as if the variables view is working as expected, then add a note documenting the bug behavior.

    Regards,

    Nick

  • For future readers:

    Status update:

    This will be fixed in CCS 12.1.

    Workaround for earlier CCS versions:

    I was given a workaround for this bug. Note that I have not tested this workaround, and we are unable to support the workaround on the e2e forums. If you are not able to get the workaround working on CCS 11.2 or earlier, the TI-supported solution is to migrate to CCS 12.1 or later.

    replace file proc_0x300080d0.xml in /ccs/ccs_base/emulation/tpi/xml.

    <?xml version="1.0"?>
    
    <!-- File name is based upon the Proc ID assigned to the ISA  -->
    <!-- Root node for all TPI data.                              -->
    
    <tpi_info id="tpi">
    
        <!-- machine_info node describes the ISA details like bus widths and data sizes -->
        <!-- target_name = Unique string name for ISA -->
    
        <!-- *** These next 21 entries are used to fill out the Value Bits array passed from TPI to the debug tool *** -->
        <!-- size_char        = Size in bits of a 'C' char.                 Value Bits index = 0          -->
        <!-- size_short       = Size in bits of a 'C' short.                Value Bits index = 1          -->
        <!-- size_enum        = Size in bits of a 'C' enum.                 Value Bits index = 2          -->
        <!-- size_int         = Size in bits of a 'C' int.                  Value Bits index = 3          -->
        <!-- size_long        = Size in bits of a 'C' long.                 Value Bits index = 4          -->
        <!-- size_void_ptr    = Size in bits of a 'C' void pointer.         Value Bits index = 5          -->
        <!-- size_dataNN      = Size in bits of a data units NN is just the width.                        -->
        <!--                    Must have entries for 8/16/24/32/40/48/64.  Value Bits indices = 6 to 12  -->
        <!-- size_far_ptr     = Size in bits of a far pointer.              Value Bits index = 13         -->
        <!-- size_near_ptr    = Size in bits of a near pointer.             Value Bits index = 14         -->
        <!-- size_long_long   = Size in bits of a longlong.                 Value Bits index = 15         -->
        <!-- size_float       = Size in bits of a float.                    Value Bits index = 16         -->
        <!-- size_ieee_float  = Size in bits of a IEEE float.               Value Bits index = 17         -->
        <!-- size_double      = Size in bits of a double.                   Value Bits index = 18         -->
        <!-- size_ieee_double = Size in bits of a IEEE double.              Value Bits index = 19         -->
        <!-- size_long_double = Size in bits of a long double.              Value Bits index = 20         -->
    
        <machine_info id="machine" target_name="PRU" 
        
                      size_char="8" size_short="16" size_enum="32" size_int="32" size_long="32" size_void_ptr="32" 
                      size_data8="8" size_data16="16" size_data24="24" size_data32="32" size_data40="40" size_data48="48" 
                      size_data64="64" size_far_ptr="32" size_near_ptr="16" size_long_long="64" size_float="32" size_ieee="32" 
                      size_double="32" size_ieee_double="64" size_long_double="64">
    
            <!--- List of all ELF magic numbers supported by this ISA -->
    
            <elfs id="elf_numbers">
    
                <!-- id      = index of the entry in the list -->
                <!-- elf_num = the number in hex              -->
    
                <elf id="0" elf_num="90" />
    
            </elfs>
    
            <!-- List of all page descriptors for this ISA -->
    
            <pages id="mem_pages">
    
                <!-- id              = index of the entry in the list -->
                <!-- page_name       = the text name of the page -->
                <!-- page_endian     = the endianess of the page BIG and LITTLE supported -->
                <!-- page_addr_unit  = Size in bits the addressable unit used for this page. Bus Bits index = [page][0]  -->
                <!-- page_short_word = Size in bits of a memory value cast as a 'C' short.   Bus Bits index = [page][1]  -->
                <!-- page_word       = Size in bits of a memory value cast as a 'C' int.     Bus Bits index = [page][2]  -->
                <!-- page_long_word  = Size in bits of a memory value cast as a 'C' long.    Bus Bits index = [page][3]  -->
                <!-- page_rdc_addr   = Size in bits the address used for reduced addr mode.  Bus Bits index = [page][4]  -->
                <!-- page_addr       = Size in bits the address used for memory access.      Bus Bits index = [page][5]  -->
                <!-- page_ext_addr   = Size in bits the address for extended addr mode.      Bus Bits index = [page][6]  -->
    
                <page id="0" page_name="Program_Memory" page_endian="LITTLE" 
                      page_addr_unit="8" page_short_word="16" page_word="32" page_long_word="32" 
                      page_rdc_addr="18" page_addr="18" page_ext_addr="18" />
    
                <page id="1" page_name="Data_Memory" page_endian="LITTLE" 
                      page_addr_unit="8" page_short_word="16" page_word="32" page_long_word="32" 
                      page_rdc_addr="32" page_addr="32" page_ext_addr="32" />
    
                <page id="2" page_name="PRU_Device_Memory" page_endian="LITTLE" 
                      page_addr_unit="8" page_short_word="16" page_word="32" page_long_word="32" 
                      page_rdc_addr="32" page_addr="32" page_ext_addr="32" />
    
            </pages>
    
            <sets id="reg_sets">
    
                <!-- reg_addr_unit  = Size in bits the addressable unit used for register access.         Reg Bus Bits index = 0  -->
                <!-- reg_short_word = Size in bits of a register value cast as a 'C' short.               Reg Bus Bits index = 1  -->
                <!-- reg_word       = Size in bits of a register value cast as a 'C' int.                 Reg Bus Bits index = 2  -->
                <!-- reg_long_word  = Size in bits of a register value cast as a 'C' long.                Reg Bus Bits index = 3  -->
                <!-- reg_rdc_addr   = Size in bits the address for register access in reduced addr mode.  Reg Bus Bits index = 4  -->
                <!-- reg_addr       = Size in bits the address used for register access.                  Reg Bus Bits index = 5  -->
                <!-- reg_ext_addr   = Size in bits the address for register access in extended addr mode. Reg Bus Bits index = 6  -->
    
                <set id="0" reg_addr_unit="32" reg_short_word="32" reg_word="32" reg_long_word="32" reg_rdc_addr="32" 
                     reg_addr="32" reg_ext_addr="32" />
    
                <set id="1" reg_addr_unit="8" reg_short_word="8" reg_word="8" reg_long_word="8" reg_rdc_addr="32" 
                     reg_addr="32" reg_ext_addr="32" />
                     
            </sets>
    
            <!-- Call conventions and dwarf not required for PRU -->
    
            <callconvention_info id="callconvention" reg_pc="PC" reg_sp="SP" reg_ret="RET"
                                 reg_params="R0,R1,R2,R3" reg_args="R4,R5,R6,R7" stack_movement="down" />
    
            <dwarf_regmap id="regmaps">
                <map id="  0 " name="R0_b0" />
                <map id="  1 " name="R0_b1" /> 
                <map id="  2 " name="R0_b2" /> 
                <map id="  3 " name="R0_b3" /> 
                <map id="  4 " name="R1_b0" /> 
                <map id="  5 " name="R1_b1" /> 
                <map id="  6 " name="R1_b2" /> 
                <map id="  7 " name="R1_b3" /> 
                <map id="  8 " name="R2_b0" /> 
                <map id="  9 " name="R2_b1" /> 
                <map id=" 10 " name="R2_b2" /> 
                <map id=" 11 " name="R2_b3" /> 
                <map id=" 12 " name="R3_b0" /> 
                <map id=" 13 " name="R3_b1" /> 
                <map id=" 14 " name="R3_b2" /> 
                <map id=" 15 " name="R3_b3" /> 
                <map id=" 16 " name="R4_b0" /> 
                <map id=" 17 " name="R4_b1" /> 
                <map id=" 18 " name="R4_b2" /> 
                <map id=" 19 " name="R4_b3" /> 
                <map id=" 20 " name="R5_b0" /> 
                <map id=" 21 " name="R5_b1" /> 
                <map id=" 22 " name="R5_b2" /> 
                <map id=" 23 " name="R5_b3" /> 
                <map id=" 24 " name="R6_b0" /> 
                <map id=" 25 " name="R6_b1" /> 
                <map id=" 26 " name="R6_b2" /> 
                <map id=" 27 " name="R6_b3" /> 
                <map id=" 28 " name="R7_b0" /> 
                <map id=" 29 " name="R7_b1" /> 
                <map id=" 30 " name="R7_b2" /> 
                <map id=" 31 " name="R7_b3" /> 
                <map id=" 32 " name="R8_b0" /> 
                <map id=" 33 " name="R8_b1" /> 
                <map id=" 34 " name="R8_b2" /> 
                <map id=" 35 " name="R8_b3" /> 
                <map id=" 36 " name="R9_b0" /> 
                <map id=" 37 " name="R9_b1" /> 
                <map id=" 38 " name="R9_b2" /> 
                <map id=" 39 " name="R9_b3" /> 
                <map id=" 40 " name="R10_b0" /> 
                <map id=" 41 " name="R10_b1" /> 
                <map id=" 42 " name="R10_b2" /> 
                <map id=" 43 " name="R10_b3" /> 
                <map id=" 44 " name="R11_b0" /> 
                <map id=" 45 " name="R11_b1" /> 
                <map id=" 46 " name="R11_b2" /> 
                <map id=" 47 " name="R11_b3" /> 
                <map id=" 48 " name="R12_b0" /> 
                <map id=" 49 " name="R12_b1" /> 
                <map id=" 50 " name="R12_b2" /> 
                <map id=" 51 " name="R12_b3" /> 
                <map id=" 52 " name="R13_b0" /> 
                <map id=" 53 " name="R13_b1" /> 
                <map id=" 54 " name="R13_b2" /> 
                <map id=" 55 " name="R13_b3" /> 
                <map id=" 56 " name="R14_b0" /> 
                <map id=" 57 " name="R14_b1" /> 
                <map id=" 58 " name="R14_b2" /> 
                <map id=" 59 " name="R14_b3" /> 
                <map id=" 60 " name="R15_b0" /> 
                <map id=" 61 " name="R15_b1" /> 
                <map id=" 62 " name="R15_b2" /> 
                <map id=" 63 " name="R15_b3" /> 
                <map id=" 64 " name="R16_b0" /> 
                <map id=" 65 " name="R16_b1" /> 
                <map id=" 66 " name="R16_b2" /> 
                <map id=" 67 " name="R16_b3" /> 
                <map id=" 68 " name="R17_b0" /> 
                <map id=" 69 " name="R17_b1" /> 
                <map id=" 70 " name="R17_b2" /> 
                <map id=" 71 " name="R17_b3" /> 
                <map id=" 72 " name="R18_b0" /> 
                <map id=" 73 " name="R18_b1" /> 
                <map id=" 74 " name="R18_b2" /> 
                <map id=" 75 " name="R18_b3" /> 
                <map id=" 76 " name="R19_b0" /> 
                <map id=" 77 " name="R19_b1" /> 
                <map id=" 78 " name="R19_b2" /> 
                <map id=" 79 " name="R19_b3" /> 
                <map id=" 80 " name="R20_b0" /> 
                <map id=" 81 " name="R20_b1" /> 
                <map id=" 82 " name="R20_b2" /> 
                <map id=" 83 " name="R20_b3" /> 
                <map id=" 84 " name="R21_b0" /> 
                <map id=" 85 " name="R21_b1" /> 
                <map id=" 86 " name="R21_b2" /> 
                <map id=" 87 " name="R21_b3" /> 
                <map id=" 88 " name="R22_b0" /> 
                <map id=" 89 " name="R22_b1" /> 
                <map id=" 90 " name="R22_b2" /> 
                <map id=" 91 " name="R22_b3" /> 
                <map id=" 92 " name="R23_b0" /> 
                <map id=" 93 " name="R23_b1" /> 
                <map id=" 94 " name="R23_b2" /> 
                <map id=" 95 " name="R23_b3" /> 
                <map id=" 96 " name="R24_b0" /> 
                <map id=" 97 " name="R24_b1" /> 
                <map id=" 98 " name="R24_b2" /> 
                <map id=" 99 " name="R24_b3" /> 
                <map id="100 " name="R25_b0" /> 
                <map id="101 " name="R25_b1" /> 
                <map id="102 " name="R25_b2" /> 
                <map id="103 " name="R25_b3" /> 
                <map id="104 " name="R26_b0" /> 
                <map id="105 " name="R26_b1" /> 
                <map id="106 " name="R26_b2" /> 
                <map id="107 " name="R26_b3" /> 
                <map id="108 " name="R27_b0" /> 
                <map id="109 " name="R27_b1" /> 
                <map id="110 " name="R27_b2" /> 
                <map id="111 " name="R27_b3" /> 
                <map id="112 " name="R28_b0" /> 
                <map id="113 " name="R28_b1" /> 
                <map id="114 " name="R28_b2" /> 
                <map id="115 " name="R28_b3" /> 
                <map id="116 " name="R29_b0" /> 
                <map id="117 " name="R29_b1" /> 
                <map id="118 " name="R29_b2" /> 
                <map id="119 " name="R29_b3" /> 
                <map id="120 " name="R30_b0" /> 
                <map id="121 " name="R30_b1" /> 
                <map id="122 " name="R30_b2" /> 
                <map id="123 " name="R30_b3" /> 
                <map id="124 " name="R31_b0" /> 
                <map id="125 " name="R31_b1" /> 
                <map id="126 " name="R31_b2" /> 
                <map id="127 " name="R31_b3" /> 
                <map id="128 " name="FP_b0" /> 
                <map id="129 " name="FP_b1" /> 
                <map id="130 " name="FP_b2" /> 
                <map id="131 " name="FP_b3" /> 
           </dwarf_regmap>
    
        </machine_info>
    
        <!-- TPI interface info that describes the main interfaces exported by TPI -->
    
        <interface_info id="interface">
    
            <!-- Node name defines the interface -->
            <!-- dll      = the DLL that supports the interface -->
            <!-- generic  = true/false.  True generic support or custom interface -->
            <!-- db       = location for XML to support a generic interface -->
            <!-- size_bis = Size of the base instruction in bits (used during disassembly). Simple ISAs will have a fixed BIS -->
    
            <ctpidasm id="dasm" dll="dasm_pru" generic="false" db="" size_bis="32"/>
            <ctpistep id="step" dll="step_pru" generic="false" db="" size_bis="32"/>
            <ctpigen  id="gen"  dll="tpi"      generic="true"  db="proc_0x300080d0.xml" />
    
            <!-- This interface not required for PRU -->
    
            <ctpicallconv id="callconv" dll="tpi" generic="true" db="proc_0x300080d0.xml" />
    
        </interface_info>
    
    </tpi_info>
    

    Regards,

    Nick