Hello everyone,
(target C6678, CCS 5.5, BIOS 1.25, XDCTools 3.25)
Here's a question concerning Logs
There is the "The target representation of a recorded event"
typedef struct Log_EventRec{
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.
Hello everyone,
(target C6678, CCS 5.5, BIOS 1.25, XDCTools 3.25)
Here's a question concerning Logs
There is the "The target representation of a recorded event"
typedef struct Log_EventRec{
Clement,
Log_Event and Types_Event are not the same type. Let's first describe the relationship between Log_Event and Log.EventDesc. In Log.xdc, they are bound by the following definition:
@Encoded typedef EventDesc Event;
This means that Log_Event is a runtime type that encodes the metaonly type Log.EventDesc. This guide describes it in more details: http://rtsc.eclipse.org/docs-tip/Using_Encoded_Types.
The module that defines an encoded type also defines the encoding algorithm. In Log.xs, there is function Event$decode that creates a string, which is then used as an initializer for an Event in the generated C file. The output of that function would be something like this:
(((Log_Event)640) << 16 | 4).
Because Log_Event is defined as 32 bit type, this whole expression is a 32 bit value where 640 is 'id', a kind of a pointer to obj.msg, and 4 is a combination of obj.mask and obj.level.
Types_Event is not defined as an encoded type, but it is used in a similar way to encode an 'id' and the type Types_Site. You can see that encoding in the file Types__epilogue.h, in the macro xdc_runtime_Types_makeEvent.
Sasha,
Thank you for your detailled answer.
It makes way more sense now.
The relation between the 'id' (640 in your example) and the EventDesc msg field is a bit mysterious though.
I don't really need to know more details so don't bother.
Regards,
Clement