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.

Memory Configurations

Other Parts Discussed in Thread: SYSBIOS, TMS320C6678

Hello,

I have Shannon C6678 board with myself and I am able to run some simple OpenMP and Codes on it. I want to look into the memory configurations, I mean, I want to put my data in different levels of memory like, what will be the changes I will see if i will put it in L2 cache or will bypassL2 and put it in shared memory and then i want to see some time estimated stuffs and all.. I have searched but didn't get satisfied way to move on. For a Starting point, forget with large data's lets start with small multiplication codes, can Anyone suggest me something to start with?

Thanks.

  • Hi Arun,

    Here's one way you could do this using SYS/BIOS.

    First, create a custom RTSC platform in CCS. Here's a tutorial on how to create a custom RTSC platform. http://rtsc.eclipse.org/docs-tip/Demo_of_the_RTSC_Platform_Wizard_in_CCSv4. You could use the default platform if it satisfies your requirements.

    Next you need to specify a memory section. From SPRAAS7D: "Memory sections in SYS/BIOS 6 are specified to load into Memory segments using the Program module’s sectMap[ ] array. This array maps section name strings to the Memory segments into which that section is to be loaded. This pseudo-configuration code shows a mapping: Program.sectMap[“<section name>”] = <Memory segment>.name; You should replace <section name> above with the string name of the section to be mapped. Also, replace <Memory segment> with the Memory segment name to load that section into."

    As an example, in your BIOS cfg file, say bios6.cfg, you would add:
    Program.sectMap[".iobuff"]  = "L2SRAM";

    In your C code, you would place your buffer in this section as:
    #ifdef __TI_COMPILER_VERSION__
    #pragma DATA_SECTION(pOut, ".iobuff");
    #pragma DATA_ALIGN(pOut, 8);
    #endif
    int_least16_t pOut[MAX];

    In terms of cycle measurements, one way to do it is to use the timeStamp module. Add the module in your BIOS configuration file as:
    var timeStamp = xdc.useModule('xdc.runtime.Timestamp');
    // set to C64+ timestamp provider; c64x+ timestamp provider works for c66 as well
    timeStamp.SupportProxy = xdc.useModule('ti.sysbios.family.c64p.TimestampProvider');

    And in your C file, you would do something like:
    #include <xdc/runtime/Timestamp.h> 
    cpuCycles = Timestamp_get32();
    // Function that you need to profile here
    cpuCyclesAcc += Timestamp_get32() - cpuCycles;

  • Hello Uday,

    Thanks for replying. I am trying this and will get back to you if I need anything else. 

  • Hello Uday,

    I have tried but while Configuring memory I have done everything as shown in video of RTSC as as you stated, but it is giving me some message like Check Code memory like that. I think I am missing something here. Is there any Video or tutorial I can go through for that. I will appreciate your help.

    Thanks. 

  • Hi Arun,

    You can go through the SYS/BIOS guide (especially chapter on Memory) at http://www.ti.com/lit/ug/spruex3j/spruex3j.pdf for more details.

    For your reference, I have also attached an example RTSC platform package for 6678 that we used for one of our demo projects. 2337.evm6678.zip. You can unzip 'evm6678.zip' and view it in CCS by going to Tools --> RTSC Tools --> Platform --> Edit/View.

  • Hello Uday,

    Thanks for your reply. It give me some sort of clear picture what actually is going on. Well, I have tried with one 3 *3 matrix multiplication and I am trying to get some time elapsed in that computation by each core or on combining cores together at different memory locations and then profile it. But, Same program is running fine on different IDE's, but on CCSv5.1, When I include  #include <sys/time.h>,  on compilation it is giving me an error message that could not open source file "sys/time.h". is this problem with eclipse, or i am missing something here. 

    Thanks. 

  • Replace "#include <sys/time.h>" with "#include <time.h>". With that, it should pick up the file from "ccsv5/tools/compiler/c6000/include/time.h"

  • Hello Uday,

    Thanks for the reply. I have tried that. Well, new problem has been arisen when I am trying to debug my Program on CCS, It is giving me an error message: 
    This I am getting on every debug and I have reset the board, I have restarted the System But no help. 

    I am also getting one more Error, Like this.: 


    Any Help? Thanks.
     

  • Hello Uday, I think By mistake I have not attached original Error message which I am getting on every Debugging. Here it is: 




    Thanks. 

  • Arun,

    About the 'target connect' issue, can you ensure you have the latest emilation drivers :

    http://software-dl.ti.com/sdoemb/sdoemb_public_sw/bios_mcsdk/latest/index_FDS.html
    
    
    
    


  • Hello Varada,

    Yes, I have the latest emulation drivers installed.

    Thanks. 

  • Arun,
    There are multiple reasons for this type of issue. Maybe, your executable is accessing memory that is not mapped. Where are your data buffers stored ?

    One way to isolate the issue is to run your test on a simulator. You can use either C6678 Functional /Cycle accurate Simulator.

    Let us know so that we can assist further.
  • Hello Varada,

    I have Just tried with Simulator and It gives me Same error message. As far as Memory mapping is concerned, I was using default one, at this moment because I am trying to run only one simple Matrix multiplication of 3*3 Matrix and trying to see the time elapsed during that on various front. I have attached snapshot of memory thing for You:




    Thanks. 

  • Hi Arun,

    Can you please share your code for us to have a look.

  • Hello Varada,

    I have attached the file for you.  Thanks

  • Hi Arun,

    I created a simple CCS project (Not a RTSC project. ) and copied your code.
     I used an old style linker command file for creating the memory sections. 
    Stored and run everything from DDR and it seems to run fine.

    I am attaching the project file. 
    Please try this on your setup and let us know.
    8877.MatMul.zip
  • Hello Varada,

    I have tried this and unfortunately I am getting Error Message:

    C66xx_0: Trouble Writing Memory Block at 0x8000 on Page 0 of Length 0x6280: (Error -1190 @ 0x8000) Unable to access device memory. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 5.0.520.0) 
    C66xx_0: GEL: File: /home/akmishra/workspace_v5_2/axe/Debug/axe.out: Load failed.

    I don't Know what is going On? Can you tell me How you have used old style linker command file for creating the memory sections? I mean, I don't know as per message I only getting this is there is something wrong with Memory....

    Next Question, As this is just a Simple Program, So Whats wrong with creating RTSC one?

    Thanks. 

  • Arun,

     

    Are you trying to run this on the C6678 simulator ? PLease try it there first.

     

    Couple things I wish to suggest :

    1. Before you load the code, run the gel file to initialize the device.

    2. I see you load axa.out file.

    Instead please try to load the .out generated by the example project.

    It is under 'debug' directory. Name "..\MatMul\Debug\MatMul.out"

     

    You can certainly create a RTSC project and configure the memory map using XDC tools.

    However if you are not using any features of SYSBIOS, then creating

    a simple C/C++ project should suffice.

  • Hello Varada,

    I appreciate your patience! I am sorry I am in kind of learning phase so may  be I am little bit slow in understanding.

    Well, I have tried it on C6678 Simulator and Emulator both. Unfortunately, I am getting the error:

    C66xx_0: Trouble Writing Memory Block at 0x8800a000 on Page 0 of Length 0x6260: (Error -1060 @ 0x64) Device is not responding to the request. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 5.0.520.0) 
    C66xx_0: GEL: File: /home/akmishra/workspace_v5_2/MatMul/Debug/MatMul.out: Load failed.

    Thanks.

     

  • Arun,
    No problem with the Qs. We want to help you make progress.

    Can you please share your active target configuration file - the .ccxml files.
    You would have one file for using emulator and the other for simulator.
    
    
    I am also trying to locate some more tutorial resources to help you further. Will keep you posted.
  • Hello Varada,

    Bottom one is .ccxml file for emulator: XDS100v1 USB Emulator:


    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <configurations XML_version="1.2" id="configurations_0">
    <configuration XML_version="1.2" id="Texas Instruments XDS100v1 USB Emulator_0">
            <instance XML_version="1.2" desc="Texas Instruments XDS100v1 USB Emulator_0" href="connections/TIXDS100usb_Connection.xml" id="Texas Instruments XDS100v1 USB Emulator_0" xml="TIXDS100usb_Connection.xml" xmlpath="connections"/>
            <connection XML_version="1.2" id="Texas Instruments XDS100v1 USB Emulator_0">
                <instance XML_version="1.2" href="drivers/tixds100icepick_d.xml" id="drivers" xml="tixds100icepick_d.xml" xmlpath="drivers"/>
                <instance XML_version="1.2" href="drivers/tixds100c66xx.xml" id="drivers" xml="tixds100c66xx.xml" xmlpath="drivers"/>
                <instance XML_version="1.2" href="drivers/tixds100cs_dap.xml" id="drivers" xml="tixds100cs_dap.xml" xmlpath="drivers"/>
                <instance XML_version="1.2" href="drivers/tixds100csstm.xml" id="drivers" xml="tixds100csstm.xml" xmlpath="drivers"/>
                <instance XML_version="1.2" href="drivers/tixds100etbcs.xml" id="drivers" xml="tixds100etbcs.xml" xmlpath="drivers"/>
                <platform XML_version="1.2" id="platform_0">
                    <instance XML_version="1.2" desc="TMS320C6678_0" href="devices/C6678.xml" id="TMS320C6678_0" xml="C6678.xml" xmlpath="devices"/>
                </platform>
            </connection>
        </configuration>
    </configurations>





    Now, Next one is for : Simulator: Texas Instrument Simulator: C6678Device cycle Approximate Simulator Little Endian




    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <configurations XML_version="1.2" id="configurations_0">
    <instance XML_version="1.2" desc="C6678 Device Cycle Approximate Simulator, Little Endian" href="configurations/tisim_c6678_cx_le.xml" id="C6678 Device Cycle Approximate Simulator, Little Endian" xml="tisim_c6678_cx_le.xml" xmlpath="configurations"/>
        <configuration XML_version="1.2" description="Simulates the C6678 device which includes C66x CorePac(8x), MSMC (Multicore Shared Memory Controller), Inter-processor communication, CPINTC(4x), EDMA(3x), TIMER64(16x), Semaphore2,Semaphore2, DDR3 Memory controller and DDR3 memory, GPIO, Queue-manager Sub-system, SRIO and Network coprocessor (Packet Accelerator, Switch Sub-system).This simulator does not model PCIe Sub-system, and PSC (Power and Sleep Controller). This configuration is cycle accurate and hence suitable for applications development and benchmarking. &#10; Note on other configurations available for this Device: &#10; * There is a corresponding faster configuration (C6678 Device Functional Simulator) in the &quot;Basic Setup&quot;, that can be used for applications development and understanding the system behavior, but doesn't support cycle accuracy." id="C6678 Device Cycle Approximate Simulator, Little Endian">
            <connection XML_version="1.2" desc="C6678 Device Cycle Approximate Simulator, Little Endian_0" id="C6678 Device Cycle Approximate Simulator, Little Endian"/>
        </configuration>
    </configurations>


    Thanks. 
  • Arun,
    If your issue is not yet resolved, can you try with the attached target configuration file.
    
    
    http://e2e.ti.com/cfs-file.ashx/__key/CommunityServer-Discussions-Components-Files/639/1323.C6678Functional.ccxml
  • Hello Varada,

    I was waiting for your reply, as I am still facing that same issue and I have tried everything whatever I can get.

    Well, I have linked your target configuration file and Debug the program, But I am getting error message:

     

    C66xx_0: Trouble Writing Memory Block at 0x8800a000 on Page 0 of Length 0x6260: (Error -1060 @ 0x64) Device is not responding to the request. Reset the device, and retry the operation. If error persists, confirm configuration, power-cycle the board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 5.0.520.0) 
    C66xx_0: GEL: File: /home/akmishra/workspace_v5_2/MatMul/Debug/MatMul.out: Load failed.

    I don't have any idea what is going on and Why I am not able to debug my program. the same program is working fine on others IDE's. 
  • Arun,

    The target configuration file should be launched, from the debug window.
    Can you share, step-by-step, from starting CCS and to loading the code, what procedure you are following.

    BTW : Here is some link to CCS user's tutorials.
    http://processors.wiki.ti.com/index.php/CCSv5_Getting_Started_Guide

    I believe, it is not the problem with IDE. It is mostly that your setup is missing something.
  • Hello Varada,

    I have already gone through those guide many times and What is troubling me most is, codes which were running on CCS before they are also giving me same error message on debugging. This is only thing which force me to think there is something wrong in settings or drivers. I am still looking on all these, Will post if I get anything.

    Thanks, 

  • Hi Arun.

    Sorry that you are still facing issues. Can you please try with a fresh install of CCSv5, in a separate location on your setup.

    http://processors.wiki.ti.com/index.php/Download_CCS#Code_Composer_Studio_Version_5_Downloads

    Let us know.

  • Hello Varada,

    I know that is the Only last option I have. I am doing that. Will let you know.
    Thanks. 

  • Hello Varada,

    Yes, That was the Problem, My Linux server daily updates has changed the drivers and other important Settings for my CCS Installation and because of that only, the configuration Errors and Connections issues were coming. Those Codes are running fine on my Laptop with TI Simulator, when I have installed totally  new CCS installation and Now, I have to tried this on Emulator. Will get back to you With the Emulators results,

    For Now, I have one thing to say, Linux headers updates has created problem. More Details will post soon.

    Thank You very much for all your support! 

  • Hi Arun,

    Glad to know that you can run on the simulator. For emulator, we hope it goes fine. You mentioned before that you already have the latest emulation driver package. Keep us posted.

    If you have any other unrelated questions, please start a new thread on the forums. Thus it becomes easy to search and archive.

    All the best.

  • Hello Varada,

    I was having latest emulation driver package, But The Linux Server headers Automatic updates, my Mind didn't goes to that point. While Discussing today with one of my friend, this got click in my mind, and I have tried fortunately I succeed.

    Yes, I will post about any new issues, Thanks again for your Support!