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.

Including c6x.h

Hi Chris,

I have  a question regarding the fir iuniversal example. I have managed to build it and it is running ok.

The problem is I am trying to benchmark the code using  the Time Stamp Counter Registers (TSCL, TSCH).

I get  an error when including #include <c6x.h>. No such file or directory. I have included all the libraries through rules.make

I also get errors when including dmai headers to fir iuniversal example. How do I include these headers correctly?

Thanks

Zoe

 

  • Are you using DSP/BIOS?  If you are using BIOS 4.x or 5.x, you should be able to use 'CLK_gethtime()' which returns the value of the TSCL register.

    If you are using DSP/BIOS 6.x, you should be able to call Timestamp_get32() or Timestamp_get64() which will return TSCL or TSCH+TSCL respectively.

    If you are not using DSP/BIOS, I would suggest writing a small function that uses 'cregister' to reference these from C.

    Something like the following (which I did not compile or test!)

     

     

    extern volatile cregister  UInt32 TSCL, TSCH;

    /*
     *  ======== TimestampProvider_get32 ========
     */
    Bits32 TimestampProvider_get32()
    {
        return (TSCL);
    }

    /*
     *  ======== TimestampProvider_get64 ========
     */
    Void TimestampProvider_get64(Types_Timestamp64 *result)
    {
        UInt key;

        key = Hwi_disable();
        /* must read TSCL before TSCH */
        result->lo = TSCL;
        result->hi = TSCH;
        Hwi_restore(key);
    }

  • Hi ,

     

    Even I am also trying something similar .

    Background : Trying to benchmark DSP vs ARM for using algorithm .Board : Beagleboard

    I am trying to benchmark the my_code_algo for DSP but not sure how should I print TSCL register on GPP/ARM side .Any clue ???

    Thanks,

    Param

  • Param, I  don't understand your question.  Is Karl's proposed BIOS solution not adequate for you?

  • Hi David ,

    Thank you for quick response .

    Background : Using Beagleboard ,  Rowboat Android, Running Loop Sample

    Well my question is : how to access TSCL register from GPP side ?

    Here is my code on DSP side , which got compiled :

    Sample : LOOP  ->  file : tskloop.c

    #include <c6x.h> // bring in references to TSCL, TSCH

    Int TSKLOOP_execute(TSKLOOP_TransferInfo * info)

    {

    -----

    TSCL = 0; // Initiate CPU timer by writing any val to TSCL
        t1 = TSCL; // benchmark snapshot of free-running ctr

    Code();

    t2=TSCL;

    result = t2-t1;

    }

    AS above , I cannot use printf so I have to use DSP/BIOS Link in order to send result to GPP side for printing the result on command line.

    Is this way is correct or if you have better way /suggestion ?

     

    Thanks,

    Param

  • Thanks David !!! Problem has been resolved .

    -Param