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.

Use custom timestamp for logging

Other Parts Discussed in Thread: SYSBIOS

Hello everyone,

(target C6678, CCS 5.5, BIOS 1.25, XDCTools 3.25, Syst Analyser 1.3)

We'd like to use the Log XDCTools facilities (Log_write, log_print) for both logging printf data and also SYS/BIOS events (the standard logging of sysbios, i.e. Semaphore.LM_pend// Logged on calls to Semaphore_pend())

For these Log we want to use our own external timestamp.

Basically it would mean to change
var obj = new Log.EventRec// The target representation of a recorded event;

        obj.serial// serial number of event = Bits32  ...
        obj.evt// target encoding of an Event = Bits32  ...
        obj.arg// arguments passed via Log_write/print = IArg[Log.NUMARGS]  ...

is it enough to do it like below ?
xdc.runtime.Timestamp.SupportProxy = xdc.useModule("usersTimestampProvider");

I want to make sure that if we develop our own timestamp module
it'll be used to log events instead of the C66x local timestamp ?

Thank you
Clement
  • Hi Clement,

    You should be able to do this.  As an example, I tried this:

    var Timestamp = xdc.useModule('xdc.runtime.Timestamp');
    var TimestampC66XGlobal = xdc.useModule('ti.uia.family.c66.TimestampC66XGlobal');
    Timestamp.SupportProxy = TimestampC66XGlobal;

    When you set a breakpoint at xdc_runtime_Timestamp_get32__E(), you should end up at your timestamp provider's get32() function.

    If you are planning to add UIA to your configuration, your timestamp provider should implement a getFreqMeta() function that returns the frequency, so that System Analyzer can display the correct times.  You can look at some of the BIOS timestamp providers as examples.  For example, ti.sysbios.family.c64p.TimestampProvider.

    Best regards,

        Janet

  • Ok good,

    It seems feasible to implement our own timestamp provider.
    I have seen the "extending timestamp" tutorial on RTSC's website.

    Now, do you think it will be an issue to have a 10 Mhz (100ns period) timestamp provider for all the logs of the 8 cores of the DSP ?

    For comparison, what are the frequency of TimestampC66xGlobal and local ?

    Thank you,
    Clement

  • Hi Clement,

    I don't foresee any problems with using a 10MHz timestamp provider.  It will be very low resolution, though, since the DSP may be running on the order of 100 times faster.  The local timestamp is running at the CPU frequency, since this just reads the TSCL and TSCH registers.  I'm not sure what the frequency of the Global timestamp is.  Maybe this is in the TRM?

    Best regards,

        Janet

  • Hi Janet,

    From the documentation it seems like the Global Timestamp is running at CPUfreq/4 so it would be 250 Mhz.

    We're not sure yet of how we will do it.

    Basically we want to log events with a free running Timestamp and every now and then change the tick count value with our own external timestamp.

    I'm currently investigating to use a timer of the C66x to act as the local timestamp but I'm not sure if we would be able to change its count value on the fly.

    Regards,
    Clement