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.

CCS/TMS320C6670: Problems testing EDMA on C6670 simulator in CCSv5

Part Number: TMS320C6670

Tool/software: Code Composer Studio

I'm using Windows 7 64-bit, Service Pack 1, CCS version 5.5.0.00077 and Vision SDK 2.10.

I've been trying to test an EDMA autoincrement2D example as described in VISION_SDK_02_10_00_00\ti_components\algorithms_codecs\eve_sw_01_12_00_00\starterware\docs\eve_starterware_userguide.pdf using C6670 Device Cycle Approximate Simulator, Little Endian. (Note that in the end the example should work on a TDA2x board but I need to simulate it in CCS first).

However, I am facing a problem regarding wait(In/Out)Channel calls when a deadlock happens. Here is a code snippet (the test simply transfers data back and forth using two in and out buffers):

int bufId = 0;

//DMA trigger for pipe-up, out transfer is dummy and handled inside DMA utility EDMA_UTILS_autoIncrement_triggerInChannel(dmaAutoContextInOut[bufId]); //Below 2 extra transfers are dummy and needed by DMA utility EDMA_UTILS_autoIncrement_triggerOutChannel(dmaAutoContextInOut[bufId]); EDMA_UTILS_autoIncrement_triggerOutChannel(dmaAutoContextInOut[bufId^1]) ; numRowsPending = height ; while (numRowsPending) { //Wait for previous transfer of in EDMA_UTILS_autoIncrement_waitInChannel(dmaAutoContextInOut[bufId]); // it hangs here but it was triggered, it should finish eventually //DMA trigger for next in buffer EDMA_UTILS_autoIncrement_triggerInChannel(dmaAutoContextInOut[bufId^1]); //Wait for previous transfer out EDMA_UTILS_autoIncrement_waitOutChannel(dmaAutoContextInOut[bufId]) ; EDMA_UTILS_autoIncrement_triggerOutChannel(dmaAutoContextInOut[bufId]) ; bufId ^= 1; numRowsPending -= blkHeight; } //Need to wait for last out transfer EDMA_UTILS_autoIncrement_waitOutChannel(dmaAutoContextInOut[bufId]) ;

I was wondering if I could test this on a simulator at all, and if yes, do I need to configure some additional settings.

I will appreciate any help. Thanks.

  • Hi Nik,
    Unfortunately, we have not supported simulators for quite some time so there is not much help we can provide with them. Sorry

    ki
  • Hi Ki,

    Is there a chance for this thread to be moved to a VisionSDK-related part of the forum because the question is more related to the example which comes with VisionSDK installation? I only seem to find this automotive (read-only) forum where it is not possible to make new thread.

    Thanks in advance.
  • Hi Nik,
    I moved it. Good luck!

    ki
  • Hi Nik,

    I have forwarded your question to an EVE expert.

    Regards,
    Yordan
  • Hi,
    TDA2X simulator supports EDMA so there should not be any problem in running EDMA example on simulator. Can you check the IPR register of EDMA value and see why during wait you are not getting the same value as it was set in ESR register during trigger.

    Regards,
    Anshu
  • Hi Anshu,

    Actually I'm testing the example on C6670 and TCI6616 simulators which have TMS320C66x cores so I should be able to test it on them. I'm having problems with debugging step by step at the moment so the only information I can provide you with is the state of interrupt-related registers that I get when I pause the execution of waitInChannel() call. They are here: http://tinypic.com/view.php?pic=2k1v8z&s=9#.WNuIfmclGUk

    What should I be expecting there?

    I will be back with more information when I configure debugging successfully.

    I appreciate your help and I'm looking forward to hearing from you.

    EDIT: I did step by step debugging on other machine and can now confirm that the register states from the aforementioned picture remain the same from the beginning of the example to the waitInChannel() and during its execution.

  • Hi Nik,

       In the code snippet you added  with this thread , the comment says it hanged in the wait call at the beginning of while loop. My question is that does it hang in the first iteration itself or at a later iteration?

    Regards,

    Anshu

  • Hi Anshu,

    Yes, it happens right away, in the first iteration. I inspected the problem further and have found that the execution is stuck in a while loop which waits for the wait_word to arrive by comparing the value of the IPR register to it, specifically in an inline function DMA_WAIT in the "dma_funcs.h" file. So you were right about the IPR register and the missing interrupt. Now my question is what is the cause to this behavior and do I need to make some adjustments to the target configuration in order to make it work or could the missing volatile keyword somewhere be the cause here? I can confirm that the test I am trying to run works correctly on the XDS220 emulator but I need to have it running in a simulator in CCS if it is possible.

    Thank you for your time, I'm very grateful to you for your help.

    EDIT: I have managed to make the execution leave the loop by manually setting the IPR value during debugging in the watches list but, as expected, the results are not logically correct in the end.

  • Hi Nik,

       When you say that this code works correctly on  XDS220 emulator,  which device you are using to run? Is it TDA2X? Generally if your code works on target it should work on simulator also, thats why want to get confirmation from you on this.


    Regards,

    Anshu

  • Hi Anshu,

    I couldn't reply earlier because I was on a vacation, I apologize for that.

    Answer to your question is yes, the test works correctly on XDS220 emulator on a TDA2x board.

    Something occured to me in the meantime, what if the execution is not blocked but takes very long time to finish? Is it a common thing for simulators? I get the same behavior when transferring any amount of data, from 8 bytes to 500 megabytes, it hangs there waiting for the correct word to arrive.

    Thanks in advance.
  • Hi Nik,

       It should not take too much time to copy even in simulator. But this is surprising that your code is working on EVM but not working on simulator. Did you tried running the same code on TDA2X(vayu) simulator?

  • Nik,

    Just a side question. Why are you using this ancient CCS version? Why not try to update to the latest CCSv7, it's free and maybe the simulator there would work just fine?

    thanks
    Alex
  • Hi Anshu,

    Thank you for the suggestion.

    Unfortunately I cannot acquire a vayu simulator at the moment, as I understand I need to have a CDDS account to download it which I don't have. I'll try contacting my manager for help.

    Will come back to you when I have some results.
  • Hi Alex,

    I am using CCSv5 because, as I know, it is the last version of CCS to support simulators. I have seen posts of people, here on the forum, trying to enable them by copying some files from CCSv5 to CCSv7 but I am not sure what the benefit is.

    It could be that I'm not thinking right which is why I would appreciate some clarification or a guide to enabling simulators in CCSs later than v5.

    Thank you in advance.
  • Nik Trif said:
    I am using CCSv5 because, as I know, it is the last version of CCS to support simulators

    This is correct. CCSv5 is the last version to come with simulators.

    Nik Trif said:
    I have seen posts of people, here on the forum, trying to enable them by copying some files from CCSv5 to CCSv7 but I am not sure what the benefit is.

    This theoretically should work. However this workaround is not a supported solution from TI, hence is not recommended. If you do choose to go this route, there is not much support we can provide since, again, this is an unsupported solution.

    Nik Trif said:
    It could be that I'm not thinking right which is why I would appreciate some clarification or a guide to enabling simulators in CCSs later than v5.

    There is no supported solution for enabling simulators past CCSv5. Simulators are simply not supported anymore.

    ki

  • Hi Anshu,

    I have finally got a Vayu Subsystem Simulator and I'm glad to say that the test is working, and what's more important it is logically correct! What I would like to know now is if this simulator is Cycle Accurate or Cycle Approximate, and generally how precise profiling can be done with it?

    Thank you for your huge help!
  • Hi Nik,

       If your profiling includes DMA then it is not cycle accurate. If you are measuring cycles just across the loops ( excluding DMA) then simulator basically assumes a flat memory model and hence if your loops are compute bound then cycles will be very close to simulator cycles. But if your loop is load store bound then the cycles will not match with the ones on target.

    Regards,

    Anshu