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.

UIA and output of data buffers from target - problem with scripts

Hi,

 

I am looking to output data buffers from my c66x target to files on a PC, and would like to use UIA loggers for that.

My intention is to use a separate logger instance to send to a file, and utilize XDCscript for this.

I found relevant scripts in the uia directory, under c:\TI\ccsv5\uia_1_00_01_09_eng\packages\ti\uia\scripts

and tried to execute as follows:

 

c:\TI\ccsv5\uia_1_00_01_09_eng\packages\ti\uia\scripts>xs ti.uia.scripts.ndk  -p -e < path to executable >

 

The output I get is:

ti.uia.scripts.ndk started.

js: "./ndk/Main.xs", line 48: xdc.services.global.XDCException: xdc.MODULE_NOT_FOUND: xdc.module: no module named 'NdkAgent' in the package ti.uia.scripts.ndk

 

 

Are these scripts supposed to work?

 

Is there any other way to implement buffer output on top of UIA, without using these scripts?

 

Thanks

Ran

 

  • Hi Ran,

    The scripts kind of work. There are some limitations. That's why we ended up not documenting them.

    We have two different ways to write the records to a file on the PC.

    1. If you have a JTAG connection, set the ServiceMgr's transportType to TransportType_FILE. Each core will write into a file on the PC. What happens is the UIA ServiceMgr collects the Log records at the configured interval (i.e. 100ms) and writes them to the file.

    2. Use Ethernet via the NONJTAGTRANSPORT. The ServiceMgr will send out the Log records via Ethernet instead. Of course you could use System Analyzer within CCS, but there is some support with the scripts. You can run uiaWriteToFile.xs (after you can some of the top lines in the script). You can parse the created file via the uiaReadFromFile.xs (again changing the top couple lines of the script). For this to work, all the .outs loaded on all the cores must be the same (one of the limitiations). You need to make sure you have ServiceMgr.topology set to multicore also.

    (Note: a couple of the above filename or parameter names might be a little off. I don't have access to the network right now, so I cannot confirm the exact names).

    Let me know which approach you want to take and I can give you more details.

    Todd

  • Hi Todd,

     

    Thanks. I am mostly interested in using Ethernet for transfer data buffers to the PC. Using a script would allow me to parse the UDP message and append the data portion to a file. With CCS this is not really possible...

    As you understand from my original post, the scripts didn't really run for me, perhaps I didn't execute it correctly.

     

    I'd appreciate more details to get this option running.

     

    Thanks

    Ran

     

  • Ran,

    There is a bigger problem with the scripts. Since we were not "supporting" the scripts, we were not actively testing them. The NdkAgent java class has a problem. I'll see if there is an easy way to work-around this. I'll add an update soon.

    Todd

  • 4784.package.jar.zip

    Ran,

    I've attached a rebuilt packages\ti\uia\scripts\ndk\java\package.jar file (note, you need to remove the .zip...the forum would not let me post it). Try replacing your file with this on.

    Then update the following lines in the UIAHostToFile.xs accordingly
      var outputFile = "C:/temp/UIAReceivedData.bin";
      agent.numProcessors = 1;
      agent.address = "146.252.161.72";
      var runTime = 10000;

    To run, do the following once the targets are running

    <uia install dir>\ti\uia\scripts>xs -f UIAHostToFile.xs

    When done (or after you ctrl-c it), you can parse the binary file with UIAHostFromFile.xs. Note: you need to update the following lines in this file
       var executable = "v:/toddm/uia/src/ti/uia/examples/evmti816x/ti_uia_examples_platforms_evmTI816X_video/debug/videoM3LoggerSM.xem3";
       var rtaXml = "v:/toddm/uia/src/ti/uia/examples/evmti816x/package/cfg/ti_uia_examples_platforms_evmTI816X_video/debug/videoM3LoggerSM_xem3.rta.xml";
       var inputFile = "C:/temp/UIAReceivedData.bin"; // must match the UIHostToFile.xs' outputFile name

    Please note that all cores must have the same .out file loaded.

    So you can see, there is some work that we need to do for the scripts to make them easier to use. Of course any feedback is appreciated.

    Todd

  • Hi Todd,

     

    Thanks, I will dive into it.

     

    You noted at the end that "all cores must have the same .out file loaded."...

    Now I am using 2 images, one for Core 0 which accesses the Ethernet (NDK) and one for the other cores. The reason for this split is due to problems I ran into with the network init when using a single image and a single CFG file. 

    Is it possible to have a single image for all cores while having core 0 initialize the Ethernet? I also noted that the C6678 image processing example has 2 images (is it for the same reason?).

     

    Thanks

    Ran

     


  • Ran,

    Different images are fine when using UIAHostToFile. You probably can run the UIAHostFromFile.xs multiple times with different .out and .xml filenames.

    For example assume you had foo.out (and foo.rta.xml) on core 0 and bar.out (and bar.rta.xml) on core 1.

    You could run UIAHostFromFile.xs with foo.out (and foo.rta.xml) in the script. Only the core 0 Log records would make sense. You should ignore the core 1 decodings (since the symbol locations will not be correct in foo.out for the bar.out app).

    Then you could change the script to decode core 1 by using bar.out (and bar.rta.xml). Now you need to ignore the core 0 decodings....Not ideal, but it probably works.

    I'd try using the scripts with just 1 core first (e.g. agent.numProcessors = 1; in UIAHostToFile.xs). See if you can get it to work and see if the output is what you expect.

    Todd

  • Ran,

    Is there a reason why you don't want to use System Analyzer in CCS? It has an option of writing the data to a file in case you want to save.

    Todd

  • Hi Todd,

     

    The DSP generates buffers of processed data that are fed to a PC for further processing, and following that data is generated that is fed back to the DSP later on. This is ongoing, therefore the CCS approach of recording the DSP output and then analyzing it offline is not appropriate.

    I would like to create a script that supports a more "online" approach to processing the logs.

    Btw, ideally I could have the CCS show regular "informational" logs from the DSP, and use the script for processing the "data buffer" logs. 

    As I understand, this is not possible because UIA uses the same UDP port for all logs and I can't have 2 PC application monitor the same UDP port. 

     

    Regards

    Ran

     

     

     

  • Hi Todd,

     

    I have a problem in the first stage (UIAHostToFile.xs). I get this error when executing xs -f ...

     

    C:\TI\ccsv5\uia_1_00_01_09_eng\packages\ti\uia\scripts>xs -f UIAHostToFile.xs

    js: "./UIAHostToFile.xs", line 13: TypeError: [JavaPackage ti.uia.scripts.ndk.NdkAgent] is not a function, it is org.mozilla.javascript.NativeJavaPackage.


     

     

    Any ideas why?
    Thanks
    Ran