Relations and labels allow you to highlight relations between trace signals or add additional information to samples. Below example defines a set of event signals using enumeration values.
If you attach an associations or labels, they are bound to the previously written sample (they don't have own domain positions). An association requires:
A label just requires:
To create a label or relation, you need to:
The textual representation of the enumeration values for style, target and domain baseis added by using the flxWriteEnumDef/writeEnumDef methods.
Use this enumeration scope for relation target. The target is specified by the cell path of the signal e.g. "\scope\signal1"
t.b.d
t.b.d.
The flxWriteRelation/writeRelation methods shall be used after writing a sample flxWriteXXXAt/writeXXXAt.
The type is one of:
The target position can be defined either absolute (AT_ASSOC_POS,AT_ASSOC_POS_REV) or relative (AT_ASSOC_DELTA, AT_ASSOC_DELTA_REV). You have the option to define a relation from source to target (AT_ASSOC_DELTA, AT_ASSOC_POS), the reverse way (AT_ASSOC_DELTA_REV, AT_ASSOC_POS_REV) or both.
Also he flxWriteLabel/writeLabel methods shall be used after writing a sample.
// add event signals trace.addScope( 1, 0, "Enums", "Scope Description"); trace.addSignal( 2, 1, "enum0", null, Flx.TYPE_EVENT, "gantt<>"); trace.addSignal( 3, 1, "enum1", null, Flx.TYPE_EVENT, "gantt<>"); trace.addSignal( 4, 1, "enum2", null, Flx.TYPE_EVENT, "gantt<>"); // open // write enums for signal 2,3,4 (events) trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Started", 0xfff1); trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Running", 2); trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Reading", 1); trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Writing", 2); trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Fetching", 1); trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Pushing", 2); // write relation and label related enums for signal 2,4 (events) trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Trigger/444444/line/no", 1); trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Reference/00ff00/cubic/normal", 2); trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum1", 1); trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum2", 2); trace.writeEnumDef(4, Flx.ENUM_LABEL_STYLE, "My label/444444/star", 1); ... // write at n * 10ns trace.writeEventAt(2, 0, current, false, 0xfff1); trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 1, 1, 2, 0); trace.writeEventAt(3, 0, 0, true, 0); trace.writeEventAt(4, 0, 0, true, 0); trace.writeLabel(4, 1); // write at +2ns trace.writeEventAt(3, 0, 2, true, 1); // write at +1ns trace.writeEventAt(4, 0, 1, true, 1); // write at +2ns trace.writeEventAt(2, 0, 2, true, 1); trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 2, 2, 4, 0); trace.writeEventAt(3, 0, 0, true, 2); trace.writeEventAt(4, 0, 0, true, 2); // write at +2ns trace.writeEventAt(2, 0, 2, true, 2); // write at +2ns trace.writeEventAt(2, 0, 2, true, 0);
// add event signals flxAddScope(trace, 1, 0, "Enums", "Scope Description"); flxAddSignal(trace, 2, 1, "enum0", 0, FLX_TYPE_EVENT, "gantt<>"); flxAddSignal(trace, 3, 1, "enum1", 0, FLX_TYPE_EVENT, "gantt<>"); flxAddSignal(trace, 4, 1, "enum2", 0, FLX_TYPE_EVENT, "gantt<>"); // open // write enums for signal 2,3,4 (events) flxWriteEnumDef(trace, 2, FLX_ENUM_GLOBAL, "Started", 0xfff1); flxWriteEnumDef(trace, 2, FLX_ENUM_GLOBAL, "Running", 2); flxWriteEnumDef(trace, 3, FLX_ENUM_GLOBAL, "Reading", 1); flxWriteEnumDef(trace, 3, FLX_ENUM_GLOBAL, "Writing", 2); flxWriteEnumDef(trace, 4, FLX_ENUM_GLOBAL, "Fetching", 1); flxWriteEnumDef(trace, 4, FLX_ENUM_GLOBAL, "Pushing", 2); // write relation and label related enums for signal 2,4 (events) flxWriteEnumDef(trace, 2, FLX_ENUM_RELATION_STYLE, "Trigger/444444/line/no", 1); flxWriteEnumDef(trace, 2, FLX_ENUM_RELATION_STYLE, "Reference/00ff00/cubic/normal", 2); flxWriteEnumDef(trace, 2, FLX_ENUM_RELATION_TARGET, "\\Enums\\enum1", 1); flxWriteEnumDef(trace, 2, FLX_ENUM_RELATION_TARGET, "\\Enums\\enum2", 2); flxWriteEnumDef(trace, 4, FLX_ENUM_LABEL_STYLE, "My label/444444/star", 1); ... // write at n * 10ns flxWriteEventAt(trace, 2, 0, current, 0, 0xfff1); flxWriteRelation(trace, 2, FLX_AT_ASSOC_DELTA, 1, 1, 2, 0); flxWriteEventAt(trace, 3, 0, 0, 1, 0); flxWriteEventAt(trace, 4, 0, 0, 1, 0); flxWriteLabel(trace, 4, 1); // write at +2ns flxWriteEventAt(trace, 3, 0, 2, 1, 1); // write at +1ns flxWriteEventAt(trace, 4, 0, 1, 1, 1); // write at +2ns flxWriteEventAt(trace, 2, 0, 2, 1, 1); flxWriteRelation(trace, 2, FLX_AT_ASSOC_DELTA, 2, 2, 4, 0); flxWriteEventAt(trace, 3, 0, 0, 1, 2); flxWriteEventAt(trace, 4, 0, 0, 1, 2); // write at +2ns flxWriteEventAt(trace, 2, 0, 2, 1, 2); // write at +2ns flxWriteEventAt(trace, 2, 0, 2, 1, 0);
# add event signals trace.addScope( 1, 0, "Enums", "Scope Description"); trace.addSignal( 2, 1, "enum0", None, Flx.TYPE_EVENT, "gantt<>"); trace.addSignal( 3, 1, "enum1", None, Flx.TYPE_EVENT, "gantt<>"); trace.addSignal( 4, 1, "enum2", None, Flx.TYPE_EVENT, "gantt<>"); # open # write enums for signal 2,3,4 (events) trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Started", 0xfff1); trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Running", 2); trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Reading", 1); trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Writing", 2); trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Fetching", 1); trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Pushing", 2); # write relation and label related enums for signal 2,4 (events) trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Trigger/444444/line/no", 1); trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Reference/00ff00/cubic/normal", 2); trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum1", 1); trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum2", 2); trace.writeEnumDef(4, Flx.ENUM_LABEL_STYLE, "My label/444444/star", 1); ... # write at n * 10ns trace.writeEventAt(2, 0, current, False, 0xfff1); trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 1, 1, 2, 0); trace.writeEventAt(3, 0, 0, True, 0); trace.writeEventAt(4, 0, 0, True, 0); trace.writeLabel(4, 1); # write at +2ns trace.writeEventAt(3, 0, 2, True, 1); # write at +1ns trace.writeEventAt(4, 0, 1, True, 1); # write at +2ns trace.writeEventAt(2, 0, 2, True, 1); trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 2, 2, 4, 0); trace.writeEventAt(3, 0, 0, True, 2); trace.writeEventAt(4, 0, 0, True, 2); # write at +2ns trace.writeEventAt(2, 0, 2, True, 2); # write at +2ns trace.writeEventAt(2, 0, 2, True, 0);
// add event signals trace.addScope(1, 0, "Enums", "Scope Description"); trace.addSignal(2, 1, "enum0", null, Flx.TYPE_EVENT, "gantt<>"); trace.addSignal(3, 1, "enum1", null, Flx.TYPE_EVENT, "gantt<>"); trace.addSignal(4, 1, "enum2", null, Flx.TYPE_EVENT, "gantt<>"); // open // write enums for signal 2,3,4 (events) trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Started", 65521); trace.writeEnumDef(2, Flx.ENUM_GLOBAL, "Running", 2); trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Reading", 1); trace.writeEnumDef(3, Flx.ENUM_GLOBAL, "Writing", 2); trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Fetching", 1); trace.writeEnumDef(4, Flx.ENUM_GLOBAL, "Pushing", 2); // write relation and label related enums for signal 2,4 (events) trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Trigger/444444/line/no", 1); trace.writeEnumDef(2, Flx.ENUM_RELATION_STYLE, "Reference/00ff00/cubic/normal", 2); trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum1", 1); trace.writeEnumDef(2, Flx.ENUM_RELATION_TARGET, "\\Enums\\enum2", 2); trace.writeEnumDef(4, Flx.ENUM_LABEL_STYLE, "My label/444444/star", 1); ... // write at n * 10ns trace.writeEventAt(2, 0, current, false, 65521); trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 1, 1, 2, 0); trace.writeEventAt(3, 0, 0, true, 0); trace.writeEventAt(4, 0, 0, true, 0); trace.writeLabel(4, 1); // write at +2ns trace.writeEventAt(3, 0, 2, true, 1); // write at +1ns trace.writeEventAt(4, 0, 1, true, 1); // write at +2ns trace.writeEventAt(2, 0, 2, true, 1); trace.writeRelation(2, Flx.AT_ASSOC_DELTA, 2, 2, 4, 0); trace.writeEventAt(3, 0, 0, true, 2); trace.writeEventAt(4, 0, 0, true, 2); // write at +2ns trace.writeEventAt(2, 0, 2, true, 2); // write at +2ns trace.writeEventAt(2, 0, 2, true, 0);
// add event signals trace.addScope(1, 0, "Enums", "Scope Description"); trace.addSignal(2, 1, "enum0", null, Flx_1.Flx.TYPE_EVENT, "gantt<>"); trace.addSignal(3, 1, "enum1", null, Flx_1.Flx.TYPE_EVENT, "gantt<>"); trace.addSignal(4, 1, "enum2", null, Flx_1.Flx.TYPE_EVENT, "gantt<>"); // open // write enums for signal 2,3,4 (events) trace.writeEnumDef(2, Flx_1.Flx.ENUM_GLOBAL, "Started", 65521); trace.writeEnumDef(2, Flx_1.Flx.ENUM_GLOBAL, "Running", 2); trace.writeEnumDef(3, Flx_1.Flx.ENUM_GLOBAL, "Reading", 1); trace.writeEnumDef(3, Flx_1.Flx.ENUM_GLOBAL, "Writing", 2); trace.writeEnumDef(4, Flx_1.Flx.ENUM_GLOBAL, "Fetching", 1); trace.writeEnumDef(4, Flx_1.Flx.ENUM_GLOBAL, "Pushing", 2); // write relation and label related enums for signal 2,4 (events) trace.writeEnumDef(2, Flx_1.Flx.ENUM_RELATION_STYLE, "Trigger/444444/line/no", 1); trace.writeEnumDef(2, Flx_1.Flx.ENUM_RELATION_STYLE, "Reference/00ff00/cubic/normal", 2); trace.writeEnumDef(2, Flx_1.Flx.ENUM_RELATION_TARGET, "\\Enums\\enum1", 1); trace.writeEnumDef(2, Flx_1.Flx.ENUM_RELATION_TARGET, "\\Enums\\enum2", 2); trace.writeEnumDef(4, Flx_1.Flx.ENUM_LABEL_STYLE, "My label/444444/star", 1); ... // write at n * 10ns trace.writeEventAt(2, 0, current, false, 65521); trace.writeRelation(2, Flx_1.Flx.AT_ASSOC_DELTA, 1, 1, 2, 0); trace.writeEventAt(3, 0, 0, true, 0); trace.writeEventAt(4, 0, 0, true, 0); trace.writeLabel(4, 1); // write at +2ns trace.writeEventAt(3, 0, 2, true, 1); // write at +1ns trace.writeEventAt(4, 0, 1, true, 1); // write at +2ns trace.writeEventAt(2, 0, 2, true, 1); trace.writeRelation(2, Flx_1.Flx.AT_ASSOC_DELTA, 2, 2, 4, 0); trace.writeEventAt(3, 0, 0, true, 2); trace.writeEventAt(4, 0, 0, true, 2); // write at +2ns trace.writeEventAt(2, 0, 2, true, 2); // write at +2ns trace.writeEventAt(2, 0, 2, true, 0);