Reusable parts for assembled software systems

Information

  • Patent Application
  • 20020174082
  • Publication Number
    20020174082
  • Date Filed
    September 26, 2001
    23 years ago
  • Date Published
    November 21, 2002
    22 years ago
Abstract
The present invention provides a system of reusable parts for assembled software systems. the invention describes certain parts that provide advantageous features, including event source parts, distributor parts, concurrency parts, property parts, event manipulation parts, data manipulation parts, hardware access parts, system configuration parts, debugging and instrumentation parts, dynamic structure parts, and test framework parts.
Description


BACKGROUND OF THE INVENTION

[0001] This application claims priority from U.S. Provisional Patent Application No. 60/235,463, entitled REUSABLE PARTS FOR ASSEMBLED SOFTWARE SYSTEMS, filed Sep. 26, 2000, the disclosure of which is herein incorporated by reference.


[0002] 1. Field of the invention


[0003] The present invention relates generally to the field of object-oriented software engineering, and more specifically to reusable parts for assembled software systems.


[0004] 2. Description of the related art


[0005] Over the last twenty years, the object paradigm, including object-oriented analysis, design, programming and testing, has become the predominant paradigm for building software systems. A wide variety of methods, tools and techniques have been developed to support various aspects of object-oriented software construction, from formal methods for analysis and design, through a number of object-oriented languages, component object models and object-oriented databases, to a number of CASE systems and other tools that aim to automate one or more aspects of the development process.


[0006] With the maturation of the object paradigm, the focus has shifted from methods for programming objects as abstract data types to methods for designing and building systems of interacting objects. As a result, methods and means for expressing and building structures of objects have become increasingly important. Object composition has emerged and is rapidly gaining acceptance as a general and efficient way to express structural relationships between objects. New analysis and design methods based on object composition have developed and most older methods have been extended to accommodate composition.



Composition Methods

[0007] The focus of object composition is to provide methods, tools and systems that make it easy to create new objects by combining already existing objects.


[0008] An excellent background explanation of analysis and design methodology based on object composition is contained in Real-time Object-Oriented Modeling (ROOM) by Bran Selic et al., John Wiley & Sons, New York, in which Selic describes a method and a system for building certain specialized types of software systems using object composition.


[0009] Another method for object composition is described in HOOD: Hierarchical Object-Oriented Design-Oriented Design by Peter J. Robinson, Prentice-Hall, Hertfordshire, UK, 1992, and “Creating Architectures with Building Blocks” by Frank J. van der Linden and Jurgen K. Müller, IEEE Software, 12:6, November 1995, pp. 51-60.


[0010] Another method of building software components and systems by composition is described in a commonly assigned international patent application entitled “Apparatus, System and Method for Designing and Constructing Software Components and Systems as Assemblies of Independent Parts”, serial number PCT/US96/19675, filed Dec. 13, 1996 and published Jun. 26, 1997, which is incorporated herein by reference and referred to herein throughout as the “'675 application.”


[0011] Yet another method that unifies many pre-existing methods for design and analysis of object-oriented systems and has specific provisions for object composition is described in the OMG Unified Modeling Language Specification, version 1.3, June 1999, led by the Object Management Group, Inc., 492 Old Connecticut Path, Framingham, MA 01701.



Composition-based Development

[0012] Composition—building new objects out of existing objects—is the natural way in which most technical systems are made. For example, mechanical systems are built by assembling together various mechanical parts and electronic systems are built by assembling and connecting chips on printed circuit boards. But today, despite its many benefits, the use of composition to build software systems is quite limited, because supporting software design by composition has proven to be extremely difficult. Instead, inferior approaches to composition, which were limited and often hard-to-use, were taken because they were easier to support. Approaches such as single and multiple inheritance, aggregation, etc., have been widely used, resulting in fragile base classes, lack of reusability, overwhelming complexity, high rate of defects and failures.


[0013] Early composition-based systems include HOOD (see earlier reference), ObjecTime Developer by ObjecTime Limited (acquired by Rational Software Corp.), Parts Workbench by Digitalk, and Parts for Java by ObjectShare, Inc. (acquired by Starbase Corp.). Each of these systems was targeted to solve a small subset of problems. None of them provided a solution applicable to a broad range of software application types without impeding severely their performance. Specifically, use of these systems was primarily in (a) graphical user interfaces for database applications and (b) high-end telecommunication equipment.


[0014] One system that supports composition for a broad range of applications without performance impediments is the system described in the commonly assigned '675 application, with which it is possible to create new, custom functionality entirely by composition and without new program code. This system was commercialized in several products, including ClassMagic and DriverMagic, and has been used to create a variety of software components and applications ranging from graphical user interface property sheets, through Microsoft COM components, to various communications and device drivers.


[0015] Since 1996, other composition approaches have been attempted in research projects such as Espresso SCEDE by Faison Computing, Inc., and in commercial products such as Parts for Java by ParcPlace-Digitalk (later ObjectShare, Inc.), and Rational Rose RealTime by Rational Software Corp. None of these has been widely accepted or proven to be able to create commercial systems in a broad range of application areas. The only system known to the inventors that allows effective practicing of object composition in a wide area of commercial applications is the system described in the '675 application. The system and method described in the '675 application and its commercial and other implementations are referred to hereinafter as the “'675 system.”



Dynamically Changing Sets of Objects

[0016] Despite the apparent superiority of the system described in the '675 application, it, like all other composition-based systems described above failed to address adequately the important case in which part of the composed structure of objects needs to change dynamically, in response to some stimulus.


[0017] Except in trivial cases, most working, commercially viable software components and applications require at least one element that requires dynamic changes. Examples include the ability to dynamically create and destroy a number of sub-windows in a given window of a graphical user interface, and the ability to dynamically create and destroy a connection object in a communications protocol stack when a connection is established and dropped.


[0018] Although most of the above-described composition-based systems do have the ability to modify structure dynamically, they do this through some amount of custom code and a violation of the composition view of the software system being built—in both cases essentially undermining the composition approach and at least partially sacrificing its advantages.


[0019] In fact, one of the most common objections to the composition-based software design approach is that the structure of software applications is generally dynamic and changes all the time, and so the ability to compose statically new components is of very limited use. Furthermore, the implementation of the functionality required to handle dynamic structures is quite complex, requires high professional qualifications and is frequently a source of hard-to-find software defects. As a result, the systematic and effective practice of software design and development by composition is seriously limited whenever the underlying system does not provide a consistent, efficient, universal and easy-to-use support for dynamically changeable structures of objects.



Reusable Objects

[0020] Even if support for static composition and dynamic structures of objects is available, the use of composition is still difficult without a significant number of readily available and easily reusable objects from which new functionality can be composed.


[0021] Without such a library of reusable objects the composition systems mentioned above including the system described in the '675 application is useful primarily for decomposing systems and applications during design, and in fact, all these systems have been used mostly in this way. With decomposition, the system designer uses a composition-based system to express the required functionality in terms of subsystems and large-scale (thousands of lines of code) components, from which those systems are to be composed. This approach inevitably leads to defining subsystems and components in a way that makes them quite specific to the particular application. Individual components defined in such custom way then have to be custom implemented, which is typically achieved by either writing manually or generating unique code that expresses the specific functionality of the component being developed.


[0022] Because of this absence of a substantial set of reusable component objects from which new functionality can be easily composed, composition-based systems are essentially used in only two capacities: (a) as design automation aids, and (b) as integration tools or environments, with which individual components and subsystems designed for composition but developed in the traditional way can be put together quickly.


[0023] In order to practice composition to the full extent implied by the very name of this method and in a way that is similar to the way composition is used in all other technical disciplines, there is a need for a set of well-defined, readily available and easily reusable components, which is sufficiently robust to implement new and unanticipated application functionality, so that most, if not all of this new functionality can be built by composing these preexisting objects into new, application-specific structures.


[0024] The issue of software reusability has been addressed extensively over the last thirty years by a wide variety of approaches, technologies, and products. While the complete set of attempted approaches is virtually impossible to determine, most people skilled in the art to which this invention pertains will recognize the following few forms as the only ones which have survived the trial of practice. These include function libraries, object-oriented application frameworks and template libraries, and finally, reusable components used in conjunction with component object models like Microsoft COM, CORBA and Java Beans.


[0025] Function libraries have been extremely successful in providing reusable functionality related to algorithms, computational problems and utility functions, such as string manipulation, image processing, and similar to them. However, attempts to use function libraries to package reusable functionality that has to maintain a significant state between library calls, or that needs to use a substantial number of application-specific services in order to function, typically lead to exploding complexity of the library interface and increased difficulties of use, as well as application-dependent implementations. An excellent example of the inadequacy of the functional library approach to reusable functionality can be found in Microsoft Windows 98 Driver Development Kit, in particular, in libraries related to kernel streaming and USB driver support. These libraries, which provide less than half of the required functionality of both kernel streaming and USB drivers, do so at the expense of defining hundreds of API calls, most of which are required in order to utilize the reusable functionality offered by the library. As a result, attempts to actually use these libraries require very substantial expertise, and produce code that is unnecessarily complex, very difficult to debug, and almost impossible to separate from the library being used.


[0026] Application-specific object-oriented frameworks proliferated during the early to mid-nineties in an attempt to provide a solution to the exploding complexity of GUI-based applications in desktop operating systems like Microsoft Windows and Mac OS. These frameworks provide substantial support for functionality that is common among typical windows-based applications, such as menus, dialog boxes, status bars, common user interface controls, etc. They were, in fact, quite successful in lowering the entry barrier to building such applications and migrating a lot of useful functionality from DOS to Windows. Further use, however, showed that application-specific frameworks tend to be very inflexible when it comes to the architecture of the application and make it exceedingly difficult to build both new types of applications and applications that are substantially more complex than what was envisioned by the framework designers. It is not accidental that during the peak time of object-oriented framework acceptance, the major new Windows application that emerged—Visio from Shapeware, Inc., (now Microsoft Visio), was built entirely without the use of such frameworks.


[0027] Component object models, such as Microsoft COM and ActiveX, Java Beans and, to a lesser extent, CORBA, were intended to provide a substantially higher degree of reusability. These technologies provide the ability to develop binary components that can be shipped and used successfully without the need to know their internal implementations. Components defined in this way typically implement input interfaces, have some kind of a property mechanism and provide rudimentary mechanisms for binding outgoing interfaces, such as COM connectable objects and the Java event delegation model.


[0028] And, indeed, component object models are considerably more successful in providing foundations for software reuse. Today, hundreds of components are available from tens of different companies and can be used by millions of developers fairly easily.


[0029] Nevertheless, these component object technologies suffer from a fundamental flaw which limits drastically their usability. The cost at which these technologies provide support for component boundaries, including incoming and outgoing interfaces and properties, is so high (in terms of both run-time overhead and development complexity) that what ends up being packaged or implemented as a component is most often a whole application subsystem consisting of tens of thousands of lines of code.


[0030] This kind of components can be reused very successfully in similar applications which need all or most of the functionality that these components provide. Such components are, however, very hard to reuse in new types of applications, new operating environments, or when the functionality that needs to be implemented is not anticipated by the component designer. The main reason for their limited reusability comes from the very fact that component boundaries are expensive and, therefore, developers are forced to use them sparingly. This results in components that combine many different functions, which are related to each other only in the context of a specific class of applications.


[0031] As we have seen above, the type of reuse promoted by most non-trivial functional libraries and practically all application frameworks and existing component object models makes it relatively easy to implement variations of existing types of applications but makes it exceedingly difficult and expensive to innovate in both creating new types of applications, moving to new hardware and operating environments, such as high-speed routers and other intelligent Internet equipment, and even to add new types of capabilities to existing applications.


[0032] What is needed is a reuse paradigm that focuses on reusability in new and often unanticipated circumstances, allowing software designers to innovate and move to new markets without the tremendous expense of building software from scratch. The system described in the '675 application provides a component object model that implements component boundaries, including incoming and outgoing interfaces and property mechanisms, in a way that can be supported at negligible development cost and runtime overhead. This fact, combined with the ability to compose easily structures of interconnected objects, and build new objects that are assembled entirely from pre-existing ones, creates the necessary foundations for this type of reuse paradigm. Moreover, the '675 system, as well as most components built in conjunction with it, are easily portable to new operating systems, execution environments and hardware architectures.



Properties

[0033] One of the acknowledged goals of object-oriented design and programming is reusability—once an object class is implemented and made to work, it can be used in various circumstances, including ones for which the object has not been specifically designed. To facilitate reusability, certain attributes of the object are designed to be modifiable. Such modifiable attributes allow each object instance to be specialized, within limits, to fit its particular application. For example, a button object in a graphical user interface object library typically can be specialized with the button's position on the screen (x and y origins), size (width and height), label (text), etc. The process of specializing an object by setting its modifiable attributes is called parameterization.


[0034] In C++ and most object-oriented programming languages, such attributes can be specified when invoking the object's constructor, as arguments of the constructor; also, they can be provided as public members of the object class, visible and modifiable from outside the object instance. Both of these parameterization mechanisms require a strong level of binding, which, while consistent with the object-oriented design principles, limits the reusability of the code that creates the objects.


[0035] Component object models improve on the parameterization mechanism. Most component models provide a property mechanism, through which the object attributes can be modified without requiring (albeit not preventing) tight binding. Some component object systems have generic descriptors that allow the code that creates and specializes the newly object instances to be independent of the class of the created instances. For example, controls in Microsoft Visual Basic are parameterized by general purpose code using descriptors that contain the names and values of the properties to be set after the object is created.


[0036] It is the responsibility of each object class to implement the property mechanism so that the object's properties will be accessible. The implementation of the property mechanism usually requires significant amount of code, proportional to the number of properties of the class. Some component object systems provide assistance to the component writers: from tools that generate code (Microsoft Foundation Classes), base classes or libraries (Microsoft OLE Control Developer's Kit), to built-in support (the system described in the '675 application).


[0037] All these systems fail to provide support for class-independent handling of properties in the following cases:


[0038] There is no adequate support for properties of composite objects. While the '675 system provides the basic support—property redirection, group and broadcast properties—the designer of the composite object may be restricted to the types and set of properties that the subordinate objects provide.


[0039] There is no adequate support for manipulating properties of objects at runtime in a class-independent manner.


[0040] There is no adequate support for manipulating the properties of dynamically created instances in a class-independent manner.


[0041] All these limitations limit the utility of the property mechanisms to the most basic of cases. The lack of advanced support frequently leads designers to reduce the reusability of components, to implement custom components instead of using existing ones, or to violate the property mechanism defined by the object model. This is especially disruptive in object composition systems, where the reusability is otherwise extremely high.


[0042] A set of reusable components is needed to provide representation of arbitrary sets of properties without need to write or generate code, and to provide frequently used mechanisms for manipulating properties.



Part Libraries in Composition-based Systems

[0043] Each generation of software technologies provides certain means of achieving reusability. Once these means are defined, a library of general-purpose reusable software entities based on these means is developed and becomes widely used. Structured programming brought, for example, the FORTRAN mathematical libraries (still used to this day) and the standard C libraries. Object-oriented programming brought us standard Java class libraries and the C++ template library (the latter is excellently described in the book “The C++ Standard Template Library”, by P. J. Plauger, et. al., published by Prentice Hall, 2000).


[0044] Component-based systems are the next generation software technology following object-oriented systems. Among other advantages, they bring a higher level of reusability. While most early component systems have delivered relatively successful application-specific libraries, especially in graphical user interface and database access, they have failed to address the general-purpose libraries of components. Many of the shortcomings of those early systems are responsible for that; for example, the high cost of component boundaries forces developers into building components that combine many different functions which are related to each other only in the context of specific class of applications.


[0045] Composition-based component systems, such as the '675 system, provide the ability to have general-purpose component libraries. However, neither the function libraries nor the object libraries contain good candidates for general-purpose reusable components. There is a need to define a comprehensive set of such components so that frequently needed application behaviors can be composed using mostly, if not entirely, those components.


[0046] Such library components are parts described in U.S. patent application Ser. No. 09/640,898, entitled SYSTEM OF REUSABLE SOFTWARE PARTS AND METHODS OF USE, filed Aug. 16, 2000, and in PCT Patent Application Serial No. US00/22630, entitled SYSTEM OF REUSABLE SOFTWARE PARTS FOR IMPLEMENTING CONCURRENCY AND HARDWARE ACCESS, AND METHODS OF USE, the disclosures of which are herein incorporated by reference.



SUMMARY OF THE INVENTION


Advantages of the Invention

[0047] As described herein, the present invention has many advantages over the previous prior art systems. The following list of advantages is provided for purposes of illustration, and is not meant to limit the scope of the present invention, or imply that each and every possible embodiment of the present invention (as claimed) necessarily contains each advantageous feature.


[0048] 1. The present invention provides a system of reusable and composable objects that manipulate individual aspects of event and data processing, so that components and systems performing complex processing can be assembled by interconnecting these objects.


[0049] 2. The present invention provides a reusable object that has arbitrary set of properties that can be modified after the object is instantiated. The object provides two independent but complementary mechanisms for accessing the properties, making it possible for designers to utilize the appropriate mechanism.


[0050] 3. The present invention provides a reusable object that when used as a subordinate object in an assembly, can hold a set of properties of the assembly that no other subordinate has, allowing that set to be arbitrarily defined by the assembly designer.


[0051] 4. The present invention provides reusable container objects for holding data items. The set of data items held can be defined either by a designer at design time or may be defined at runtime.


[0052] 5. The present invention provides a reusable object for transferring properties or data items from one object to another.


[0053] 6. The present invention provides a system of reusable objects that convert variously encoded data fields to and from the native machine format. These objects allow separation of the data encoding from the processing of data, allowing usage of the same data processing objects with variously encoded data, including data received or to be sent to network or other systems.


[0054] 7. The present invention provides a system of reusable objects that provide the capability of assemblies to keep assembly-specific instance data and store, retrieve and otherwise manipulate that instance data, based on data and events that pass through these parts.


[0055] 8. The present invention provides a system of reusable objects for copying fields from data passing through these objects to and from instance data kept by the objects.


[0056] 9. The present invention provides a system of reusable objects for manipulating data in events passing through these objects.


[0057] 10. The present invention provides a reusable object for distributing and generating events based on the count of events received by that object.


[0058] 11. The present invention provides reusable objects that facilitate the life cycle—creation, parameterization, serialization and destruction—of dynamically created components.


[0059] 12. The present invention provides a reusable object for generating a predetermined event upon receiving an event.


[0060] To address the shortcomings of the background art, the present invention therefore provides:


[0061] In software system including a standard mechanism for accessing properties, the standard mechanism including:


[0062] a first operation for obtaining a property identifier;


[0063] a second operation for obtaining a property value; and


[0064] a third operation for setting the property value,


[0065] an object comprising:


[0066] a property, the property comprising a property identifier and a property value;


[0067] an implementation of the first operation;


[0068] an implementation of the second operation; and


[0069] an implementation of the third operation, the implementation of the third operation setting both the property identifier and the property value if the third operation is executed for a first time, and changing the property value to a specified new property value if the third operation was previously executed.


[0070] The property of this object may also further comprise a property type.


[0071] The present invention alternately may be practiced with a software system including a standard mechanism for accessing properties of objects, the standard mechanism including:


[0072] a first operation for enumerating property identifiers;


[0073] a second operation for obtaining a property value of a property identified by a property identifier; and


[0074] a third operation for setting the property value of a property identified by a property identifier,


[0075] an object comprising:


[0076] a table containing a plurality of entries, each entry comprising a property identifier and a property value;


[0077] an implementation of the first operation, the implementation of the first operation retrieving a first property identifier of a first property from one of the entries in the table;


[0078] an implementation of the second operation, the implementation of the second operation obtaining the property value from the one entry;


[0079] an implementation of the third operation, the implementation of the third operation setting a property value in the one entry if a value for the first property has been previously set, the implementation of the third operation setting a property identifier and a property value in the one entry in the table if a value for the first property has not been set.


[0080] The property of this object may also further comprise a property type or a terminal through which properties are accessed and their values from the first table.


[0081] The present invention alternately may be practiced with a copier object in a software system, the copier object comprising:


[0082] a first terminal through which the copier object requests enumeration of property identifiers;


[0083] a second terminal through which the copier object requests obtaining property values;


[0084] a third terminal through which the copier object requests setting property values;


[0085] a fourth terminal through which the copier object request receipt of a trigger signal, and


[0086] upon receipt of the trigger signal the copier object obtains a first property name identifier through the first terminal, through which the copier object requests obtaining a first property value using the first property identifier through the second terminal, and through which the copier object requests setting the first property value using the first property identifier through the third terminal.


[0087] The present invention alternately may be practiced with system of objects in a software system having a data memory, the system comprising:


[0088] an extractor object for extracting first encoded values from the data memory and storing them in the data memory in native machine format;


[0089] a stamper object for storing second encoded values into the data memory, the second encoded values obtained from the data memory in native machine format.


[0090] In such a system, the data memory can be an event object.


[0091] The present invention alternately may be practiced with a system of objects in a software system, the system comprising:


[0092] a container object for storing a plurality of data values;


[0093] an extractor object for extracting encoded data from data memory and storing the encoded data in the container object;


[0094] a stamper object for obtaining the plurality of data values from the container object and storing them as encoded data in the data memory.


[0095] Such a system may further comprise a comparator object for comparing a first data value of encoded data from the data memory to a second data value from the container object and sending a reference to the data memory to a first terminal if the first value is less than the second value, to a second terminal if the first value is equal to the second value, and to a third terminal if the first value is greater than the second value.


[0096] In such a system, the data memory can be an event object.


[0097] Such a system may further comprise an arithmetic-logic-unit object for performing arithmetic operations on data values in the container object.


[0098] The present invention alternately may be practiced with a method in a composition-based software system for transferring data values in event objects, the method comprising the steps of:


[0099] extracting a first value from a first event object;


[0100] storing the first value into a container object;


[0101] loading the first value from the container object;


[0102] storing the first value into a second event object.


[0103] Such a method may further comprise the step of modifying the first value in the container object, and in such a system the first event object and the second event object can be the same event object.


[0104] The present invention alternately may be practiced with a method in a composition-based software system for manipulating encoded data values in event objects, the method comprising the steps of:


[0105] extracting a first value from a first data field of a first event object;


[0106] decoding the first value into a normalized form;


[0107] storing the first value into a second data field of the first event object;


[0108] performing an operation that modifies the first value in the second data field, resulting in a second value being stored in the second data field;


[0109] loading the second value from the second data field;


[0110] storing the second value into the first data field.


[0111] The present invention alternately may be practiced with a system of interconnected objects in a software system, the system comprising:


[0112] an extractor object for extracting a first value from a first data field in a first event object and storing it into a second data field in the first event object;


[0113] a modifier object for modifying the second data field;


[0114] a stamper object for loading a second value from the second data field and storing it into a third data field in the first event object.


[0115] The present invention alternately may be practiced with an object in a software system, the object comprising:


[0116] a first terminal through which the object receives a source event;


[0117] a first offset property specifying starting offset in the source event;


[0118] a size property specifying size in the source event;


[0119] a second offset property specifying starting offset for merging;


[0120] a reference to a data memory for storing a data portion from the source event, starting from offset specified by the offset property and of size specified by the size property;


[0121] a second terminal through which the object receives a merge event;


[0122] a third terminal through which the object sends the merge event, the merge event modified by storing the data portion into the merge event at offset specified by the second offset property.


[0123] In such an object the first terminal and the second terminal can be the same terminal.


[0124] The present invention alternately may be practiced with an object in a software system, the object comprising:


[0125] an input terminal through which the object receives an input event;


[0126] a first output terminal through which the object sends an event containing a first portion of the input event;


[0127] a second output terminal through which the object sends an event containing a second portion of the input event;


[0128] a first property specifying the size of the first portion.


[0129] The present invention alternately may be practiced with n object in a software system, the object comprising:


[0130] a first input terminal through which the object receives a latch event;


[0131] a second input terminal through which the object receives a trigger event;


[0132] a field for storing a reference to the latch event when received on the first input terminal;


[0133] an output terminal through which the object sends the latch event when the trigger event is received through the second input terminal.


[0134] The present invention alternately may be practiced with n object in a software system, the object comprising:


[0135] an input terminal through which the object receives a first input signal;


[0136] an output terminal through which the object sends the first input signal;


[0137] a factory terminal through which the object requests the creation a new object instance when the object receives the first input signal;


[0138] a property terminal through which the object requests the setting of properties on the new object instance.


[0139] Such an object may further comprise a parameterization terminal through which the object sends a parameterization signal so that an external object can parameterize the new object instance.


[0140] The present invention alternately may be practiced with a system of interconnected objects in a software system, the system of interconnected objects comprising:


[0141] a factory object for receiving creation and destruction events;


[0142] a dynamic container object for containing objects created by the factory object.


[0143] The present invention alternately may be practiced with an object in a software system, the object comprising:


[0144] an input terminal through which the object receives events;


[0145] a property specifying a target number of events;


[0146] a field for maintaining a count of events received through the input terminal;


[0147] a first output terminal through which the object sends events received through the input terminal when the count of events reaches the target number.


[0148] Such an object may further comprise a reset terminal through which the object receives a request to reset the count to zero, or may further comprise a second output terminal through which the object sends events received through the input terminal when the count of events is under the target number.







BRIEF DESCRIPTION OF THE DRAWINGS

[0149] The aforementioned features and advantages of the invention as well as additional features and advantages thereof will be more clearly understood hereinafter as a result of a detailed description of a preferred embodiment of the invention when taken in conjunction with the following drawings in which:


[0150]
FIG. 1 illustrates the boundary of part, Timer Event Source (EVT and EVT2)


[0151]
FIG. 2 illustrates the boundary of part, Event Source Adapter (EVSADP)


[0152]
FIG. 3 illustrates the boundary of part, Event Generator (EGEN)


[0153]
FIG. 4 illustrates the boundary of part, Synchronous Event Sequencer (SSEQ)


[0154]
FIG. 5 illustrates the boundary of part, Switch On A Boolean Data Item (SWB)


[0155]
FIG. 6 illustrates the boundary of part, Event-Controlled Switch (SWE)


[0156]
FIG. 7 illustrates the boundary of part, Bi-directional Event-Controlled Switch (SWEB)


[0157]
FIG. 8 illustrates the boundary of part, Selective Asynchronous Completer (ACTS)


[0158]
FIG. 9 illustrates the boundary of part, Property Holder (PHLD)


[0159]
FIG. 10 illustrates the boundary of part, PRCCONST part


[0160]
FIG. 11 illustrates an advantageous use of part, PRCCONST


[0161]
FIG. 12 illustrates the boundary of part, Event Field Stamper (EFS)


[0162]
FIG. 13 illustrates the boundary of part, Event Field Extractor (EFX)


[0163]
FIG. 14 illustrates the boundary of part, Event Recoder (ERC)


[0164]
FIG. 15 illustrates the boundary of part, Bi-directional Event Recoder (ERCB)


[0165]
FIG. 16 illustrates the boundary of part, Fast Data Container (FDC)


[0166]
FIG. 17 illustrates Cascading FDC


[0167]
FIG. 18 illustrates the boundary of part, Arithmetic/Logic Unit (ALU)


[0168]
FIG. 19 illustrates the boundary of part, Data Concatenator (CAT)


[0169]
FIG. 20 illustrates the boundary of part, Integer Constant Stamper (ICS)


[0170]
FIG. 21 illustrates the boundary of part, Integer Transmogrifier (ITM)


[0171]
FIG. 22 illustrates the boundary of part, Status Code Stamper (SCS)


[0172]
FIG. 23 illustrates an advantageous use of part, SCS


[0173]
FIG. 24 illustrates the boundary of part, Status Code Extractor (SCX)


[0174]
FIG. 25 illustrates an advantageous use of part, SCX


[0175]
FIG. 26 illustrates the boundary of part, Integral Data Field Comparator (IDFC)


[0176]
FIG. 27 illustrates the boundary of part, Integral Data Field Stamper (IDFS)


[0177]
FIG. 28 illustrates the boundary of part, Integral Data Field Extractor (IDFX)


[0178]
FIG. 29 illustrates the boundary of part, Universal Data Field Comparator (UDFC)


[0179]
FIG. 30 illustrates the boundary of part, Universal Data Field Stamper (UDFS)


[0180]
FIG. 31 illustrates the boundary of part, Universal Data Field Extractor (UDFX)


[0181]
FIG. 32 illustrates the boundary of part, I_DAT to I_PROP Converter (DPC)


[0182]
FIG. 33: Use of DPC with Property Exposer (PEX)


[0183]
FIG. 34: Use of DPC at end of cascaded Fast Data Containers (FDC)


[0184]
FIG. 35 illustrates the boundary of part, SYSIRQ part


[0185]
FIG. 36 illustrates the boundary of part, SYS_EVPRM part


[0186]
FIG. 37 illustrates the boundary of part, Log File Output (SYS_LOG)


[0187]
FIG. 38 illustrates the boundary of part, Event to asynchronous request converter (UTL_E2AR)


[0188]
FIG. 39 illustrates the boundary of part, Property Copier part (UTL_PCOPY)


[0189]
FIG. 40 illustrates an advantageous use of part, UTL_PCOPY


[0190]
FIG. 41 illustrates the boundary of part, Property Query Processor (UTL_PRPQRY)


[0191]
FIG. 42 illustrates an advantageous use of part, UTL_PRPQRY


[0192]
FIG. 43 illustrates the boundary of part, UTL_PRCBA part


[0193]
FIG. 44 illustrates an advantageous use of part, UTL_PRCBA


[0194]
FIG. 45 illustrates the boundary of part, Virtual Property Container Extender (UTL_VPCEXT)


[0195]
FIG. 46 illustrates Chaining Multiple Virtual Property Container Extenders


[0196]
FIG. 47 illustrates the boundary of part, Return Status to Event Status Converter (UTL_ST2ES)


[0197]
FIG. 48 illustrates the boundary of part, Error Detection Coder and Verifier (UTL_EDC)


[0198]
FIG. 49 illustrates the boundary of part, Event Data Latch (UTL_EDLAT)


[0199]
FIG. 50 illustrates the boundary of part, Event Data Merger (UTL_EDMRG)


[0200]
FIG. 51 illustrates an advantageous use of part, UTL_EDMRG


[0201]
FIG. 52 illustrates the boundary of part, Event Data Splitter (UTL_EDSPL)


[0202]
FIG. 53 illustrates the boundary of part, Event Counter (UTL_ECNT)


[0203]
FIG. 54 illustrates the boundary of part, Life-Cycle Sequencer (APP_LFS)


[0204]
FIG. 55 illustrates the boundary of part, Instance Enumerator on Property Container (APP_ENUM)


[0205]
FIG. 56 illustrates Dynamic Creation and Destruction of a part Instance based on instance enumeration by property container


[0206]
FIG. 57 illustrates the boundary of part, APP_FAC part


[0207]
FIG. 58 illustrates instance creation by a factory upon receiving of a creation request


[0208]
FIG. 59 illustrates the boundary of part, APP_LFCCTL


[0209]
FIG. 60 illustrates an advantageous use of part, APP_LFCCTL


[0210]
FIG. 61 illustrates an advantageous use of part, APP_LFCCTL


[0211]
FIG. 62 illustrates the boundary of part APP_CFGM


[0212]
FIG. 63 illustrates an advantageous use of part, APP_CFGM


[0213]
FIG. 64 illustrates the boundary of part, APP_PARAM


[0214]
FIG. 65 illustrates Property Parameterization and Serialization


[0215]
FIG. 66 illustrates the boundary of part, APP_BAFILE part


[0216]
FIG. 67 illustrates the boundary of part, APP_EFD


[0217]
FIG. 68 illustrates an advantageous use of part, APP_EFD


[0218]
FIG. 69 illustrates an advantageous use of part, APP_EFD


[0219]
FIG. 70 illustrates the boundary of part, Event Hex Dump (APP_HEX)


[0220]
FIG. 71 illustrates an advantageous use of part, A-PP_HEX


[0221]
FIG. 72 illustrates an advantageous use of part, APP_HEX


[0222]
FIG. 73 illustrates the boundary of part, Exception Formatter (APP_EXCF)


[0223]
FIG. 74 illustrates the boundary of part, Exception Generator (APP_EXCG)


[0224]
FIG. 75 illustrates the boundary of part, Exception Generator on Status (APP_EXCGS)


[0225]
FIG. 76 illustrates the boundary of part, TST_DCC Component


[0226]
FIG. 77 illustrates the boundary of part, TST_DTA—Dynamic Test Adapter


[0227]
FIG. 78 illustrates the boundary of part, TST_DTAM—Dynamic Test Adapter for Multiple Tests


[0228]
FIG. 79 illustrates the boundary of part, TST_TCN—Test Console I/O


[0229]
FIG. 80 illustrates the boundary of part, TST_TMD Component


[0230]
FIG. 81 illustrates an advantageous use of part, TST_TMD and TST_DCC


[0231]
FIG. 82 illustrates the boundary of part, FAC—Factory


[0232]
FIG. 83 illustrates an advantageous use of part, FAC—Factory


[0233]
FIG. 84 illustrates the boundary of part, CMX—Connection Multiplexer/De-multiplexer


[0234]
FIG. 85 illustrates an advantageous use of part, CMX—Connection Multiplexer/De-multiplexer


[0235]
FIG. 86 illustrates an advantageous use of part, CMX—Connection Multiplexer/De-multiplexer


[0236]
FIG. 87 illustrates the boundary of part, FMX—Fast Connection Multiplexer/De-multiplexer


[0237]
FIG. 88 illustrates an advantageous use of part, FMX—Fast Connection Multiplexer/De-multiplexer


[0238]
FIG. 89 illustrates an advantageous use of part, FMX—Fast Connection Multiplexer/De-multiplexer


[0239]
FIG. 90 illustrates an advantageous use of part, FMX—Fast Connection Multiplexer/De-multiplexer FIG. 91 illustrates the boundary of part, SMX8—Static Multiplexer/De-multiplexer


[0240]
FIG. 92 illustrates an advantageous use of part, SMX8—Static Multiplexer/De-multiplexer


[0241]
FIG. 93 illustrates the boundary of part, EDFX—Extended Data Field Extractor


[0242]
FIG. 94 illustrates an advantageous use of part, EDFX—Extended Data Field Extractor


[0243]
FIG. 95 illustrates the boundary of part, EDFS—Extended Data Field Stamper


[0244]
FIG. 96 illustrates an advantageous use of part, EDFS—Extended Data Field Stamper







DETAILED DESCRIPTION OF THE INVENTION

[0245] The following description is provided to enable any person skilled in the art to make and use the invention and sets forth the best modes contemplated by the inventor for carrying out the invention. Various modifications, however, will remain readily apparent to those skilled in the art, since the basic principles of the present invention have been defined herein specifically to provide a configurable state machine driver and methods of use. Any and all such modifications, equivalents and alternatives are intended to fall within the spirit and scope of the present invention.



Glossary

[0246] The following definitions are provided to assist the reader in comprehending the following description of a preferred embodiment of the present invention. All of the following definitions are presented as they apply in the context of the present invention.
1Adaptera part which converts one interface, logical connectioncontract and/or physical connection mechanism to another.Adapters are used to establish connections between parts thatcannot be connected directly because of incompatibilities.Aliasan alternative name or path representing a part, terminal orproperty. Aliases are used primarily to provide alternativeidentification of an entity, usually encapsulating the exactstructure of the original name or path.Assemblya composite object most of the functionality of which isprovided by a contained structure of interconnected parts. Inmany cases assemblies can be instantiated by descriptor and donot require specific program code.Bind or bindingan operation of resolving a name of an entity to a pointer,handle or other identifier that can be used to access this entity.For example, a component factory provides a bind operationthat gives access to the factory interface of an individualcomponent class by a name associated with it.Bus, parta part which provides a many-to-many type of interactionbetween other parts. The name “bus” comes from the analogywith network architectures such as Ethernet that are based on acommon bus through which every computer can access allother computers on the network.Code, automaticallyprogram code, such as functions or parts of functions, thegeneratedsource code for which is generated by a computer program.Code, general purposeprogram code, such as functions and libraries, used by or onmore than one class of objects.COMan abbreviation of Component Object Model, a componentmodel defined and supported by Microsoft Corp. COM is thebasis of OLE2 technologies and is supported on all members ofthe Windows family of operating systems.Componentan instantiable object class or an instance of such class that canbe manipulated by general purpose code using onlyinformation available at run-time. A Microsoft COM object is acomponent, a Win32 window is a component; a C++ classwithout run-time type information (RTTI) is not a component.Component model(s)a class of object model based on language-independentdefinition of objects, their attributes and mechanisms ofinvocation. Unlike object-oriented languages, componentmodels promote modularity by allowing systems to be builtfrom objects that reside in different executable modules,processes and computers.Connectingprocess of establishing a connection between terminals of twoparts in which sufficient information is exchanged between theparts to establish that both parts can interact and to allow atleast one of the parts to invoke services of the other part.Connectionan association between two terminals for the purposes oftransferring data, invoking operations or passing events.Connection brokeran entity that drives and enforces the procedure for establishingconnections between terminals. Connection brokers are used inthe present invention to create connections exchanging theminimum necessary information between the objects beingconnected.Connection,a characteristic of a connection defined by the flow of controldirection ofon it. Connections can be uni-directional, such as when onlyone of the participants invokes operations on the other, or bi-directional, when each of the participants can invokeoperations on the other one.Connection, directiona characteristic of a connection defined by the data flow on it.of data flowFor example, a function call on which arguments are passedinto the function but no data is returned has uni-directionaldata flow as opposed to a function in which some argumentsare passed in and some are returned to the caller.Connection, logicala defined protocol of interaction on a connection recognized bycontractmore than one object. The same logical contract may beimplemented using different physical mechanisms.Connection, physicala generic mechanism of invoking operations and passing datamechanismthrough connections. Examples of physical mechanismsinclude function calls, messages, v-table interfaces, RPCmechanisms, inter-process communication mechanisms,network sessions, etc.Connection pointsee terminal.Connection,a characteristic of a connection which defines whether themechanismentity that invokes an operation is required to wait until theexecution of the operation is completed. If at least one of theoperations defined by the logical contract of the connectionmust be synchronous, the connection is assumed to besynchronous.Containeran object which contains other objects. A container usuallyprovides interfaces through which the collection of multipleobjects that it contains can be manipulated from outside.Control blocksee Data bus.CORBACommon Object Request Broker Architecture, a componentmodel architecture maintained by Object Management Group,Inc., a consortium of many software vendors.Critical sectiona mechanism, object or part the function of which is to preventconcurrent invocations of the same entity. Used to protect dataintegrity within entities and avoid complications inherent tomultiple threads of control in preemptive systems.Data busa data structure containing all fields necessary to invoke alloperations of a given interface and receive back results fromthem. Data buses improve understandability of interfaces andpromote polymorphism. In particular interfaces based on databuses are easier to de-synchronize, convert, etc.Data flowdirection in which data is being transferred through a functioncall, message, interface or connection. The directions areusually denoted as “in”, “out” or “in-out”, the latter defining abi-directional data flow.Descriptor tablean initialized data structure that can be used to describe or todirect a process. Descriptors are especially useful inconjunction with general purpose program code. Usingproperly designed descriptor tables, such code can be directedto perform different functions in a flexible way.De-serializationpart of a persistency mechanism in object systems. A processof restoring the state of one or more objects from a persistentstorage such as file, database, etc. See also serialization.De-synchronizera category of parts used to convert synchronous operations toasynchronous. Generally, any interface with unidirectional dataflow coinciding with the flow of control can be de-synchronized using such a part.Eventin the context of a specific part or object, any invocation of anoperation implemented by it or its subordinate parts or objects.Event-driven designs model objects as state machines whichchange state or perform actions in response to external events.In the context of a system of objects, a notification or requesttypically not directed to a single object but rather multicast to,or passed through, a structure of objects. In a context of asystem in general, an occurrence.Event, externalAn event caused by reasons or originated outside of the scopeof a given system.Execution contextState of a processor and, possibly of regions of memory and ofsystem software, which is not shared between streams ofprocessor instructions that execute in parallel. Typicallyincludes some but not necessarily all processor registers, astack, and, in multithreaded operating systems, the attributes ofthe specific thread, such as priority, security, etc.Factory, abstracta pattern and mechanism for creating instances of objects underthe control of general purpose code. The mechanism used byOLE COM to create object instances is an abstract factory; theoperator “new” in C++ is not an abstract factory.Factory, componentportion of the program code of a component or part whichor parthandles creation and destruction of instances. Usually invokedby an external abstract factory in response to request(s) tocreate or destroy instances of the given class.Flow of controla sequence of nested function calls, operation invocations,synchronous messages, etc. Despite all abstractions of object-oriented and event-driven methods, on single-processorcomputer systems the actual execution happens strictly in thesequence of the flow of control.Group propertya property used to represent a set of other properties for thepurposes of their simultaneous manipulation. For example, anassembly containing several parts may define a group propertythrough which similar properties of those parts can be set fromoutside via a single operation.Indicatora category of parts that provides human-readablerepresentation of the data and operations that it receives. Usedduring the development process to monitor the behavior of asystem in a given point of its structure.Inputa terminal with incoming flow of control. As related toterminals, directional attributes such as incoming and outgoingare always defined from the viewpoint of the object on whichthe terminal is defined.Interactionan act of transferring data, invoking an operation, passing anevent, or otherwise transfer control between objects, typicallyon a single connection between two terminals.Interaction, incomingin a context of a given object, an interaction that transfers data,control or both data and control into this object. Whenever bothcontrol and data are being transferred in one and the sameinteraction, the direction is preferably determined by thedirection of the transfer of control.Interaction, outgoingin a context of a given object, an interaction that transfers data,control or both data and control out of this object. Wheneverboth control and data are being transferred in one and the sameinteraction, the direction is preferably determined by thedirection of the transfer of controlInterfacea specification for a set of related operations that areimplemented together. An object given access to animplementation of an interface is guaranteed that all operationsof the interface can be invoked and will behave according tothe specification of that interface.Interface,an interface the operations of which are invoked throughmessage-basedmessages in message-passing systems. “Message-based”pertains to a physical mechanism of access in which the actualbinding of the requested operation to code that executes thisoperation on a given object is performed at call time.Interface, OLE COMa standard of defining interfaces specified and enforced byCOM. Based on the virtual table dispatch mechanismsupported by C++ compilers.Interface, remotinga term defined by Microsoft OLE COM to denote the processof transferring operations invoked on a local implementation ofan interface to some implementation running on a differentcomputer or in a different address space, usually through anRPC mechanism.Interface, v-tablea physical mechanism of implementing interfaces, similar tothe one specified by OLE COM.Marshalera category of parts used to convert an interface which isdefined in the scope of a single address space to a logicallyequivalent interface on which the operations and related datacan be transferred between address spaces.Multiplexora category of parts used to direct a flow of operations invokedon its input through one of several outgoing connections.Multiplexors are used for conditional control of the event flowsin structures of interconnected parts.Namea persistent identifier of an entity that is unique within a givenscope. Most often names are human-readable character strings;however, other values can be used instead as long as they arepersistent.Name spacethe set of all defined names in a given scope.Name space, joineda name space produced by combining the name spaces ofseveral parts. Preferably used in the present invention toprovide unique identification of properties and terminals ofparts in a structure that contains those parts.Object, compositean object that includes other objects, typically interacting witheach other. Composites usually encapsulate the subordinateobjects.Outputa terminal with outgoing flow of control. See also Input.Parameterizationa mechanism and process of modifying the behavior of anobject by supplying particular data values for attributes definedby the object.Partan object or a component preferably created through anabstract factory and having properties and terminals. Parts canbe assembled into structures at run-time.Propertya named attribute of an object exposed for manipulation fromoutside through a mechanism that is not specific for thisattribute or object class.Property interfacean interface which defines the set of operations to manipulateproperties of objects that implement it. Typical operations of aproperty interface include: get value, set value, and enumerateproperties.Property mechanisma mechanism defining particular ways of addressing andaccessing properties. A single property interface may beimplemented using different property mechanisms, as ithappens with parts and assemblies. Alternatively, the sameproperty mechanism can be exposed through a number ofdifferent property interfaces.Proxyprogram code, object or component designed to present anentity or a system in a way suitable for accessing it from adifferent system. Compare to a wrapper.Repeatera category of parts used to facilitate connections in cases wherethe number of required connections is greater than themaximum number supported by one or more of theparticipants.Return statusa standardized type and set of values returned by operations ofan interface to indicate the completion status of the requestedaction, such as OK, FAILED, ACCESS VIOLATION, etc.Serializationpart of a persistency mechanism in object systems. A processof storing the state of one or more objects to persistent storagesuch as file, database, etc. See also de-serialization.Structure of partsa set of parts interconnected in a meaningful way to providespecific functionality.Structured storagea mechanism for providing persistent storage in an objectsystem where objects can access the storage separately andindependently during run-time.Terminala named entity defined on an object for the purposes ofestablishing connections with other objects.Terminal, cardinalitythe maximum number of connections in which a given terminalcan participate at the same time. The cardinality depends on thenature of the connection and the way the particular terminal isimplemented.Terminal, exteriora terminal, preferably used to establish connections betweenthe part to which it belongs and one or more objects outside ofthis part.Terminal, interiora terminal, of an assembly, preferably used to establishconnections between the assembly to which it belongs and oneor more subordinate objects of this assembly.Terminal interfacean interface which defines the set of operations to manipulateterminals of objects that implement it.Terminal mechanisma mechanism defining particular ways of addressing andconnecting terminals. A single terminal interface may beimplemented using different terminal mechanisms, as happenswith parts and assemblies.Thread of executiona unit of execution in which processor instructions are beingexecuted sequentially in a given execution context. In theabsence of a multithreaded operating system or kernel, andwhen interrupts are disabled, a single-processor system hasonly one thread of execution, while a multiprocessor systemhas as many threads of execution as it has processors. Underthe control of a multithreaded operating system or kernel, eachinstance of a system thread object defines a separate thread ofexecution.Wrapperprogram code, object or component designed to present anentity or a system in a way suitable for inclusion in a differentsystem. Compare to a proxy.


[0247] The preferred embodiment of the present invention is implemented as software component objects (parts). The presently described parts are preferably used in conjunction with the method and system described in the '675 application, as well as with parts described in U.S. patent application Ser. No. 09/640,898, entitled SYSTEM OF REUSABLE SOFTWARE PARTS AND METHODS OF USE, filed Aug. 16,2000, and in PCT Patent Application Serial No. US00/22630, entitled SYSTEM OF REUSABLE SOFTWARE PARTS FOR IMPLEMENTING CONCURRENCY AND HARDWARE ACCESS, AND METHODS OF USE, the disclosures of which are herein incorporated by reference.


[0248] The terms ClassMagic and DriverMagic, used throughout this document, refer to commercially available products incorporating the inventive “System for Constructing Software Components and Systems as Assemblies of Independent Parts” (referenced above) in general, and to certain implementations of that system. Moreover, an implementation of the system is described in the following product manuals:


[0249] “Reference—C Language Binding—ClassMagic™ Object Composition Engine”, Object Dynamics Corporation, August 1998, which is incorporated herein in its entirety by reference;


[0250] “User Manual—User Manual, Tutorial and Part Library Reference—DriverMagic Rapid Driver Development Kit”, Object Dynamics Corporation, August 1998, which is incorporated herein in its entirety by reference;


[0251] “Advanced Part Library—Reference Manual”, version 1.32, Object Dynamics Corporation, July 1999, which is incorporated herein in its entirety by reference;


[0252] “WDM Driver Part Library—Reference Manual”, version 1.12, Object Dynamics Corporation, July 1999, which is incorporated herein in its entirety by reference.


[0253] Also, the terms Dragon, Z-force, Z-force engine, Dragon engine and Dragon system, used throughout this document, refer to products of Z-force Communications, Inc., incorporating the inventive “System for Constructing Software Components and Systems as Assemblies of Independent Parts” (referenced above) in general, and to certain implementations of that system.


[0254] Appendix 1 describes preferred interfaces used by the parts described herein. Appendix 2 describes preferred events used by the parts described herein.



Events

[0255] One inventive aspect of the present invention is the ability to represent many of the interactions between different parts in a software system in a common, preferably polymorphic way, called event objects, or events. Events provide a simple method for associating a data structure or a block of data, such as a received buffer or a network frame, with an object that identifies this structure, its contents, or an operation requested on it. Event objects can also identify the required distribution discipline for handling the event, ownership of the event object itself and the data structure associated with it, and other attributes that may simplify the processing of the event or its delivery to various parts of the system. Of particular significance is the fact that event objects defined as described above can be used to express notifications and requests that can be distributed and processed in an asynchronous fashion.


[0256] The term “event” as used herein most often refers to either an event object or the act of passing of such object into or out of a part instance. Such passing preferably is done by invoking the “raise” operation defined by the I_DRAIN interface, with an event object as the operation data bus. The I_DRAIN interface is a standard interface as described in the '675 application, it has only one operation—“raise”, and is intended for use with event objects. A large portion of the parts described in this application are designed to operate on events. Also in this sense, “sending an event” refers to a part invoking its output I_DRAIN terminal and “receiving an event” refers to a part's I_DRAIN input terminal being invoked.



Event Objects

[0257] An event object is a memory object used to carry context data for requests and for notifications. An event object may also be created and destroyed in the context of a hardware interrupt and is the designated carrier for transferring data from interrupt sources into the normal flow of execution in systems based on the '675 system. An event object preferably consists of a data buffer (referred to as the event context data or event data) and the following “event fields”:


[0258] a. event ID—an integer value that identifies the notification or the request.


[0259] b. size—the size (in bytes) of the event data buffer.


[0260] c. attributes—an integer bit-mask value that defines event attributes. Half of the bits in this field are standard attributes, which define whether the event is intended as a notification or as an asynchronous request and other characteristics related to the use of the event's memory buffer. The other half is reserved as event-specific and is defined differently for each different event (or group of events).


[0261] d. status—this field is used with asynchronous requests and indicates the completion status of the request (see the Asynchronous Requests section below).


[0262] The data buffer pointer identifies the event object. Note that the “event fields” do not necessarily reside in the event data buffer, but are accessible by any part that has a pointer to the event data buffer. The event objects are used as the operation data of the I_DRAIN interface's single operation—raise. This interface is intended for use with events and there are many parts that operate on events.


[0263] The following two sections describe the use of events for notifications and for asynchronous requests.



Notifications

[0264] Notifications are “signals” that are generated by parts as an indication of a state change or the occurrence of an external event. The “recipient” of a notification is not expected to perform any specific action and is always expected to return an OK status, except if for some reason it refuses to assume responsibility for the ownership of the event object. The events objects used to carry notifications are referred to as “self-owned” events because the ownership of the event object travels with it, that is, a part that receives a notification either frees it when it is no longer needed or forwards it to one of its outputs.



Asynchronous Requests

[0265] Using event objects as asynchronous requests provides a uniform way for implementing an essential mechanism of communication between parts:


[0266] a. the normal interface operations through which parts interact are in essence function calls and are synchronous, that is, control is not returned to the part that requests the operation until it is completed and the completion status is conveyed to it as a return status from the call.


[0267] b. the asynchronous requests (as the name implies) are asynchronous, control is returned immediately to the part that issues the request, regardless of whether the request is actually completed or not. The requester is notified of the completion by a “callback”, which takes a form of invoking an incoming operation on one of its terminals, typically, but not necessarily, the same terminal through which the original request was issued. The “callback” operation is preferably invoked with a pointer to the original event object that contained the request itself. The “status” field of the event object conveys the completion status.


[0268] Many parts are designed to work with asynchronous requests. Note, however that most events originated by parts are not asynchronous requests—they are notifications or synchronous requests. An event recoder part, in combination with other parts may be used to transform notifications into asynchronous requests.


[0269] The following special usage rules preferably apply to events that are used as asynchronous requests:


[0270] 1. Requests are used on a symmetrical bi-directional I_DRAIN connection.


[0271] 2. Requests may be completed either synchronously or asynchronously.


[0272] 3. The originator of a request (the request ‘owner’) creates and owns the event object.


[0273] No one except the ‘owner’ may destroy it or make any assumptions about its origin.


[0274] 4. A special data field may be reserved in the request data buffer, referred to as “owner context”—this field is private to the owner of the request and may not be overwritten by recipients of the request.


[0275] 5. A part that receives a request (through an I_DRAIN.raise operation) may:


[0276] a) Complete the request by returning any status except ST_PENDING (synchronous completion);


[0277] b) Retain a pointer to the event object and return ST_PENDING. This may be done only if the ‘attr’ field of the request has the CMEVT_A_ASYNC_CPLT bit set. In this case, using the retained pointer to execute I_DRAIN.raise on the back channel of the terminal through which the original request was received completes the request. The part should store the completion status in the “status” event field and set the CMEVT_A_COMPLETED bit in the “attributes” field before completing the request in this manner.


[0278] 6. A part that receives a request may re-use the request's data buffer to issue one or more requests through one of its I_DRAIN terminals, as long as this does not violate the rules specified above (i.e., the event object is not destroyed or the owner context overwritten and the request is eventually completed as specified above).


[0279] Since in most cases parts intended to process asynchronous requests may expect to receive any number of them and have to execute them on a first-come-first-served basis, such parts are typically assembled using desynchronizers which preferably provide a queue for the pending requests and take care of setting the “status” field in the completed requests.



The Notion of Event as Invocation of an Interface Operation

[0280] It is important to note that in many important cases, the act of invoking a given operation on an object interface, such as a v-table interface, can be considered an event, similar to the events described above. This is especially true in the case of interfaces which are defmed as bus-based interfaces; in such interfaces, data arguments provided to the operation, as well as, data returned by it, is exchanged by means of a data structure called bus. Typically, all operations of the same bus-based interface are defined to accept one and the same bus structure.


[0281] Combining an identifier of the operation being requested with the bus data structure is logically equivalent to defining an event object of the type described above. And, indeed, some of the reusable parts use this mechanism to convert an arbitrary interface into a set of events or vice-versa.


[0282] The importance of this similarity between events and operations in bus-based interfaces becomes apparent when one considers that it allows to apply many of the parts, design patterns and mechanisms for handling, distributing, desynchronizing and otherwise processing flows of events, to any bus-based interface. In this manner, an outgoing interaction on a part that requires a specific bus-based interface can be distributed to multiple parts, desynchronized and processed in a different thread of execution, or even converted to an event object. In all such cases, the outgoing operation can be passed through an arbitrarily complex structure of parts that shape and direct the flow of events and delivered to one or more parts that actually implement the required operation of that interface, all through the use of reusable software parts.



XDL—Event Sources


EVT, EVT2—Timer Event Source

[0283]
FIG. 1 illustrates the boundary of part, Timer Event Source (EVT and EVT2)


[0284] 1. Functional Overview


[0285] EVT is an event source that generates both single and periodic timer events for a part connected to its evs terminal. EVT is armed and disarmed via input operations on its evs terminal and generates events by invoking the f i r e output operation on the same terminal. A caller-defined context value may be passed to EVT when it is armed and is passed back with the fire operation.


[0286] EVT2 has the same boundary and functionality as EVT, except that it invokes its output in a dedicated worker thread.


[0287] EVT[2] may be armed only once. If EVT[2] has not been armed to generate periodic events, it may be re-armed successfully as soon as the event is generated; this includes being re-armed while in the context of the fire operation call.


[0288] EVT[2] may be disarmed at any time. Once disarmed, EVT[2] will not invoke the fire operation on evs until it is re-armed. The context passed to EVT[2] when disarming it must match the context that was passed with the arm operation.


[0289] EVT[2] may be parameterized with default values to use when generating events and flags that control the use of the defaults.


[0290] The ‘fire’ call from EVT may be invoked in interrupt time. The part connected to the ‘evs’ terminal should be able to operate in interrupt time. Typically, the ‘fire’ call should be converted to an event and passed through ‘desynchronizer with thread’, e.g., DWT to obtain a timer event in normal thread time.


[0291] The ‘fire’ call from EVT2 always comes in normal thread time, in a dedicated worker thread created by EVT2.


[0292] In the text below, EVT refers to either EVT or EVT2.


[0293] 2. Boundary
22.1 TerminalsNameDirTypeNotesevsBidirIn:Used to arm and disarm the event sourceI_EVSon the input and to send the event on theOut:output. EVT will accept NULL bus pointerI_EVS_Rfor the “arm” and “disarm” operations anduse the values of its properties as argumentsfor the operation. The I_EVS.arm operationmay be invoked in interrupt context.


[0294] 3. Events and Notifications


[0295] EVT has no incoming or outgoing events. The “event” generated by EVT is a fire operation call defined in I_EVS_R; it is not a Dragon event object passed via an I_DRAIN interface.


[0296] 3.1 Special Events, Frames, Commands or Verbs


[0297] None.
33.2 PropertiesProperty nameTypeNotesforce_defaultsuint32Boolean. If TRUE, the time and continuousproperties override the values passed inthe I_EVS bus. Default is FALSE.timesint32Default time period in milliseconds.Valid range is 0-0x7fffffff.When this time period expires (after EVT isarmed), EVT will fire an event (by callingevs.fire). Default is 0.continuousuint32Boolean. If TRUE and EVT is armed, generateperiodic events until disarmed.Default is FALSE.thread_prioritysint32(EVT2 only) Worker thread priority. Thedefault value is 0.The following values are valid:−3 Lowest possible priority−2 Very low priority−1 Low priority 0 Normal priority 1 High priority 2 Very high priority 3 Highest possible priorityThe mapping of these values to the priorityscheme of the target environment is defined indetail in the Target Support Reference. Inany case (except, if the target environmenthas no priority scheme at all), −1 and +1are guaranteed to be lower and higher than thenormal priority, and −3 and 3 are alwaysthe lowest and the highest priority supportedby the system.


[0298] 4. Events and Notifications


[0299] None.


[0300] 5. Environmental Dependencies


[0301] 5.1 Encapsulated Interactions


[0302] EVT uses operating system services to set up a one-shot or a periodic timer. In some environments, thread and synchronization services may be used to create a worker thread for the ‘fire’ calls. For details on the services used in a specific environment, please refer to the Target Support Reference document.


[0303] 5.2 Other Environmental Dependencies


[0304] None.



EVSADP—Event Source Adapter

[0305]
FIG. 2 illustrates the boundary of part, Event Source Adapter (EVSADP)


[0306] 1. Functional Overview


[0307] The event source adapter (EVSADP) is a plumbing part that allows event sources to be connected to unidirectional I_DRAIN control and output terminals; making them easier to use in assembled parts.


[0308] EVSADP converts “arm” and “disarm” events into the arm and disarm operations on the I_EVS interface. It converts the fire I_EVS operation into a fire event sent through the out terminal. The events recognized as “arm” and “disarm” as well as the emitted “fire” event are parameterizable as properties.


[0309] By default, EVSADP ignores the data coming with the arm and disarm events, forcing the event source to use its default parameters. If the use_data property is changed to TRUE, the data coming with the arm and disarm events is passed to the event source (the incoming event data must be a correctly filled B_EVS structure).


[0310] In all cases, the fire event is sent with the data provided by the event source (B_EVS).


[0311] 2. Boundary
42.1 TerminalsNameDirInterfaceNotesCtlinI_DRAINEvent source arm and disarm events areexpected to be received through thisterminal.outOutI_DRAINAn event is generated through this terminalwhen the event source connected to the evsterminal fires.evsbiI_EVSEVSADP converts the arm and disarm(in)events received through ctl into evs.arm andI_EVS_Revs.disarm operations invoked through this(out)terminal.


[0312]

5











2.2 Properties









Property name
Type
Notes





arm_ev_id
uint32
Arm event source event ID.




This is the ID of the event used to arm the




event source connected to the evs terminal.




Upon receiving this event, EVSASP invokes




the evs.arm operation through the evs terminal.




Default value is EV_REQ_ENABLE.


disarm_ev_id
uint32
Disarm event source event ID.




This is the ID of the event used to disarm




the event source connected to the evs terminal.




Upon receiving this event, EVSASP invokes




the evs.disarm operation through the evs




terminal.




Default value is EV_REQ_DISABLE.


fire_ev_id
uint32
Event source fire event ID.




This is the ID of the event that is generated by




EVSADP (through the out terminal) when the




event source connected to the evs terminal fires




(by invoking evs.fire).




Default value is EV_PULSE.


use_data
uint32
Boolean.




TRUE if EVSADP uses the data as the




operation bus of the arm/disarm event to




arm/disarm the the event source. In this case,




the incoming event data must contain the




the B_EVS operation bus.




If FALSE, EVSADP passes a NULL operation




bus to the operations invoked through




the evs terminal. This causes the event source




to use its default parameters.




Default value is FALSE.










[0313] 3. Events and Notifications


[0314] The events recognized and generated by EVSADP are specified as properties.


[0315] 3.1 Special Events, Frames, Commands or Verbs


[0316] None.


[0317] 3.2 Encapsulated Interactions


[0318] None.


[0319] 4. Specification


[0320] 4.1 Responsibilities


[0321] Upon receiving the arm_ev_id or disarm_ev_id events through the ctl terminal, invoke the evs.arm and evs.disarm operations respectively.


[0322] If use_data is TRUE, use the operation buses contained in the incoming events as the buses used when invoking the evs operations. Otherwise, invoke the evs operations with NULL operation buses.


[0323] When the event source connected to the evs terminal fires, generate a fire_ev_id event through the out terminal.


[0324] 4.2 Theory of Operation


[0325] 4.2.1 Mechanisms


[0326] None.


[0327] 4.3 Use Cases


[0328] None.



XDL—Distributors


EGEN—Event Generator

[0329]
FIG. 3 illustrates the boundary of part, Event Generator (EGEN)


[0330] 1. Functional Overview


[0331] EGEN is a notifier part that generates a new event (zero-initialized) through the out terminal when an incoming event is received through the in terminal.


[0332] The generated event ID and attributes are specified through properties. The size of the generated event is calculated by taking the base size (specified through a property) and adding to it the specified data item's value or the size of the data item value (retrieved using the dat terminal).


[0333] The generated event processing status (return status from the out terminal) is propagated back to the original caller.


[0334] The dat terminal may be left unconnected (floating). In this case EGEN can be used to generate constant-sized events.


[0335] EGEN is typically used in assemblies to generate new events based on the value of a data item.


[0336] 2. Boundary
62.1 TerminalsNameDirInterfaceNotesininI_DRAINAn incoming event received through thisterminal triggers EGEN to generate a newevent through the out terminal. The generatedevent's ID, attributes and size are specifiedthrough properties.This terminal is unguarded.outoutI_DRAINAll events generated by EGEN are forwardedthrough this terminal.datoutI_DATEGEN invokes the bind, get_info and getoperations through this terminal to retrievethe value and size of the specified data item.The retrieved value and size can be used tomodify the size of the generated event.This terminal can remain unconnected(floating).


[0337]

7











2.2 Properties









Name
Type
Notes





ev_id
uint32
Event ID of the generated event sent through




the out terminal. If EV_NULL, EGEN




initializes the event ID to the ID of




the incoming event.




The default value is EV_NULL.


attr
uint32
Event attributes of the generated event




sent through the out terminal.




The default value is




(ZEVT_A_SELF_CONTAINED).


base_sz
uint32
Base size of the generated event sent




through the out terminal.




The default value is 0 (empty event).


item_name
asciz
Name of the data item whose value is used to




adjust the base size of the generated event.




If this property is empty or if the dat terminal




is not connected, EGEN does not modify the




base size for the generated event.




The default value is “”(empty).


item_is_sz
uint32
Boolean. If TRUE, EGEN adds the data item's




value to the base size for the generated event.




If FALSE, EGEN adds the size of the data item




value to the base size.




This property is used only if item_name is




not empty; otherwise it is ignored.




The default value is TRUE.










[0338] 3. Events and Notifications


[0339] EGEN accepts any Z-Force event through the in terminal.


[0340] 3.1 Special Events, Frames, Commands or Verbs


[0341] None.


[0342] 3.2 Encapsulated Interactions


[0343] None.


[0344] 4. Specification


[0345] 4.1 Responsibilities


[0346] Upon receiving an incoming event, generate a new event and pass it through the out terminal.


[0347] Initialize the generated event's ID and attributes according to the ev_id and attr properties. Calculate the size of the generated event according to the specified base size and data item.


[0348] If any of the operations invoked through the dat terminal fail, fail the incoming event.


[0349] After passing the generated event through the out terminal, free the event according to the specified attributes (see the Mechanisms section below for more information). Also propagate the return status back to the original caller.


[0350] Fail construction if both the ZEVT_A_ASYNC_CPLT and ZEVT_A_SELF_OWNED attributes are set for the generated event attributes.


[0351] 4.2 Theory of Operation


[0352] 4.2.1 State Machine


[0353] None.


[0354] 4.2.2 Mechanisms



Determining the Size of the Generated Event

[0355] The size of the generated event is determined as follows:


[0356] If no data item is specified (item_name equal to “”) or the dat terminal is not connected, the size of the generated event is the value of the base_sz property.


[0357] If a data item is specified (item_name not equal to “”), EGEN retrieves the data item value and type through the dat terminal. The generated event size is then calculated the following way:


[0358] If the item_is_sz property is TRUE, the generated event size is base_sz+data item value.


[0359] If the item_is_sz property is FALSE, the generated event size is base_sz+data item size (based on the size of the data item value).


[0360] Note that when using the data item value to determine the size of the generated event, the data item must be one of the following integral types: DAT_T_UINT32, DAT_T_SINT32, DAT_T_BOOLEAN or DAT_T_BYTE. If using the data item value size, the data item can be any type.



Generated Event Freeing Discipline

[0361] EGEN uses the following disciplines for freeing the generated event after passing it through the out terminal:


[0362] If the generated event allows asynchronous completion (ZEVT_A_ASYNC_CPLT attribute is set) and the return status of the event processing is ST_PENDING, EGEN does not free the event. It is up to the recipient of this event to free the event bus. EGEN will only free the event if a status other than ST_PENDING is returned.


[0363] If the generated event is self-owned (ZEVT_A_SELF_OWNED attribute is set), EGEN will only free the event bus if the return status is not equal to CMST_OK.


[0364] All other events are always freed regardless of return status or event attributes.


[0365] 5. Notes


[0366] EGEN zero initializes the data of the generated event before passing it through the out terminal.


[0367] EGEN's access through the dat terminal is non-atomic. Therefore, an assembly using this part may need to use external guarding.



SSEQ—Synchronous Event Sequencer

[0368]
FIG. 4 illustrates the boundary of part, Synchronous Event Sequencer (SSEQ)


[0369] 1. Functional Overview


[0370] SSEQ is a synchronization part that synchronously distributes incoming events received on in to the parts connected to the out1 and out2 terminals.


[0371] SSEQ relies on SEQ for the event distribution functionality. SSEQ is parameterized with the events distributed through its terminals. For more information about the event distribution, see the SEQ documentation.


[0372] 2. Boundary
82.1 TerminalsNameDirInterfaceNotesinInI_DRAINIncoming events for distribution are receivedhere. All recognized events are distributedaccording to their discipline.Unrecognized events are sent out the auxterminal.out1OutI_DRAINEvent distribution terminal.The distribution depends upon the disciplineof the event received on in.out2OutI_DRAINEvent distribution terminal.The distribution depends upon the disciplineof the event received on in.auxOutI_DRAINUnrecognized events received on in are sentout this terminal.This terminal may remain unconnected.


[0373] 3. Events and Notifications


[0374] SSEQ is parameterized with the event IDs of the events it distributes to out1 and out2.


[0375] When one of these events are received from in, SSEQ synchronously distributes the event according to its discipline. If the distribution fails and the discipline allows cleanup, SSEQ distributes the cleanup event in the reverse order from where the distribution failed.


[0376] 3.1 Special Events, Frames, Commands or Verbs


[0377] None.
93.2 PropertiesProperty nameTypeNotesunsup_okuint32If TRUE, a return status ofST_NOT_SUPPORTED from the eventdistribution terminals out1 or out2is remapped to ST_OK.Default is TRUE.ev[0].ev_id-uint32Event IDs that SSEQ distributes to out1ev[15].ev_idand out2 when received on the in terminal.This property is redirected to the SEQsubordinate.The default values are EV_NULL.ev[0].disc-ascizDistribution disciplines for ev[0].ev_id-ev[15].disc.ev[15].ev_id, can be one ofthe following:fwd_ignorebwd_ignorefwd_cleanupbwd_cleanupSee the Mechanisms section of the SEQdocumentation for descriptions of thedisciplines. This property is redirected tothe SEQ subordinate.The default values are fwd_ignore.ev[0].cleanup_id-uint32Event IDs used for cleanup if the eventev[15].cleanup_iddistribution fails.The cleanup event is not sent if itis EV_NULL.Cleanup events are used only if thedistribution discipline is fwd_cleanupor bwd_cleanup. This property isredirected to the SEQ subordinate.The default values are EV_NULL.


[0378] 4. Environmental Dependencies


[0379] 4.1 Encapsulated Interactions


[0380] None.


[0381] 4.2 Other Environmental Dependencies


[0382] None.


[0383] 5. Specification


[0384] 5.1 Responsibilities


[0385] For all recognized events received from in, distribute them to out1 and out2 according to their corresponding discipline (parameterized through properties).


[0386] Allow only synchronous completion of the distributed events.


[0387] Forward unrecognized events received from in to aux.


[0388] 6. Notes SSEQ does not allow self-owned events (ZEVT_A_SELF_OWNED) to be distributed through its terminals. Upon receiving such an event, SSEQ fails with ST_REFUSE.



SWB—Switch On A Boolean Data Item

[0389]
FIG. 5 illustrates the boundary of part, Switch On A Boolean Data Item (SWB)


[0390] 1. Functional Overview


[0391] SWB is a data manipulation part that splits the operation flow received on its in terminal.


[0392] The operation flow split depends upon whether the data item value, obtained through the dat terminal, is FALSE or not.


[0393] When the incoming data item is FALSE (zero), the incoming call is sent out through out_f terminal. When the data item value is not FALSE (i.e., the data item is non-zero), the incoming call is sent out through out_t terminal.


[0394] SWB obtains the value of the predefined data item by submitting bind and get requests through dat terminal. If any of the requests fails, SWB completes the incoming call with the status returned on the dat terminal.


[0395] The name of the data item is specified through a property. SWB fails its creation if there is no data item specified (i.e., when the data item name is an empty string).


[0396] SWB does not monitor or modify the content of the operations passing through it.


[0397] SWB provides a way to direct a flow of operations through different paths, depending on the current value of a data item.


[0398] 2. Boundary
102.1 TerminalsNameDirInterfaceNotesininI_POLYSWB receives an operation call. Dependingon the value of the specified data item, theoperation call is forwarded through one of theoutput terminals: out_f and out_t.This terminal is unguarded.out_foutI_POLYOperation calls received on the in terminal arepassed through this terminal when the value ofthe specified data item is FALSE (zero).out_toutI_POLYOperation calls received on the in terminalare passed through this terminal when the valueof the specified data item is not FALSE(i.e. non-zero).datoutI_DATSWB invokes bind and get operations out thisterminal to retrieve the data item value.


[0399]

11











2.2 Properties









Property name
Type
Notes





item.name
asciz
Name of the predefined data item whose value is




used to determine which terminal the operation




is sent out. The data item type must be




DAT_T_UINT32. The value of this property




cannot be an empty string. This property is




mandatory.










[0400] 3. Events and Notifications


[0401] None.


[0402] 3.1 Special Events, Frames, Commands or Verbs


[0403] None.


[0404] 3.2 Encapsulated Interaction


[0405] None.


[0406] 4. Specification


[0407] 4.1 Responsibilities


[0408] Retrieve the data value by invoking the bind and get operations through the dat terminal.


[0409] Fail the incoming call if the data item value cannot be retrieved.


[0410] Sent the event out through out_f or out_t terminals depending on value of the specified data item.


[0411] 4.2 Theory of Operation


[0412] 4.2.1 State Machines


[0413] None.


[0414] 4.2.2 Mechanisms


[0415] None.



SWE and SWEB—Event-Controlled Switches

[0416]
FIG. 6 illustrates the boundary of part, Event-Controlled Switch (SWE)


[0417]
FIG. 7 illustrates the boundary of part, Bi-directional Event-Controlled Switch (SWEB)


[0418] 1. Functional Overview


[0419] The event-controlled switches forward operations received on the in input to one of their outputs (out1 or out2), depending on the current state of the part. The state of the switch is controlled by three events that are received on the ctl terminal.


[0420] The parts are parameterized with the three events via properties. One event switches outgoing operations to out1, one event switches outgoing operations to out2, and the last event toggles the outgoing operation terminal (i.e., out1 if out2 is selected and out2 if out1 is selected)


[0421] In the initial state, operations received its in terminal to the out1 terminal.


[0422] SWEB is a bi-directional version of SWE. In the in to out direction it operates exactly as SWE. It forwards all operations received on its out1 and out2 terminals to the in terminal.


[0423] SWE/SWEB may be used at interrupt time.


[0424] 2. Boundary
122.1 Terminals (SWE)NameDirInterfaceNotesininI_POLYOperations received are forwarded to either out1or out2.out1outI_POLYOutput for forwarded operations. This terminalmay be left unconnected.out2outI_POLYOutput for forwarded operations. This terminalmay be left unconnected.ctlinI_DRAINReceive events that control the switch state.


[0425]

13











2.2 Terminals (SWEB)










Name
Dir
Interface
Notes





in
bi
I_POLY
Operations received are forwarded to either out1





or out2.


out1
bi
I_POLY
Output for forwarded operations.





Operations received on this terminal are for-





warded to in.





This terminal may be left unconnected.


out2
bi
I_POLY
Output for forwarded operations.





Operations received on this terminal are for-





warded to in.





This terminal may be left unconnected.


ctl
in
I_DRAIN
Receive events that control the switch state.










[0426]

14











2.3 Properties









Property name
Type
Notes





ev_out1
uint32
Event ID to switch to out1.




If the value is EV_NULL, this functionality




is disabled.




The default is EV_REQ_ENABLE.


ev_out2
uint32
Event ID to switch to out2.




If the value is EV_NULL, this functionality




is disabled.




The default is EV_REQ_DISABLE.


ev_toggle
uint32
Event ID to switch to the other output (i.e.,




out1 if out2 is selected and out2 if out1 is




selected).




If the value is EV_NULL, this functionality




is disabled.




The default is EV_NULL.










[0427] 3. Events and Notifications


[0428] The events recognized by SWE/SWEB on the ctl terminal are specified by the ev_out1, ev_out2 and ev_toggle properties.


[0429] 3.1 Special Events, Frames, Commands or Verbs


[0430] None.


[0431] 3.2 Encapsulated Interaction


[0432] None.


[0433] 4. Specification


[0434] 4.1 Responsibilities


[0435] Forward operations received on in to out1 or out2 based upon control events received on ctl terminal.


[0436] (SWEB) Forward operations received on out1 and out2 to in.


[0437] 4.2 Theory of Operation


[0438] 4.2.1 State Machines


[0439] The part keeps state as to which outx terminal it is to forward operations received on its in terminal to. The state is controlled by the events it receives on its ctl input. An atomic “exchange” operation is used to change the part's state, allowing it to operate in any execution context, including interrupt time. The initial state is “direct output to out1”.


[0440] 4.2.2 Mechanisms


[0441] None.


[0442] 4.3 Use Cases


[0443] None.



XDL—Concurrency


ACTS—Selective Asynchronous Completer

[0444]
FIG. 8 illustrates the boundary of part, Selective Asynchronous Completer (ACTS)


[0445] 1. Functional Overview


[0446] ACTS is a synchronization part that simulates asynchronous completion for a specified range of events received on its input and that complete synchronously on its output.


[0447] ACTS forwards all incoming events received on in to out. ACTS always completes the events received through in asynchronously. If the event sent through out completes synchronously, ACTS updates the completion status and completes the event by sending the same event back through in with the ZEVT_A_COMPLETED attribute set.


[0448] Events that complete asynchronously on out are simply passed through with no modification.


[0449] All events received on out are passed to in without modification.


[0450] The range of events considered by ACTS is parameterized through properties. Events not in the specified range are passed through out without modification (in this case ACTS acts as a pass-through channel).


[0451] ACTS is typically used in situations where asynchronous completion is required for only a selected range of events.


[0452] ACTS is not guarded and may be used at interrupt time.


[0453] 2. BOUNDARY
152.1 TerminalsNameDirInterfaceNotesinbiI_DRAINIncoming events are received here.If the event is not in the specified range, it ispassed through the out terminal withoutmodification.outbiI_DRAINOutgoing events are sent through here.All events received through this terminal arepassed through the in terminal without modifi-cation.


[0454]

16











2.2 Properties









Property name
Type
Notes





ev_min
uint32
Specifies the lowest event ID value (inclusive)




that will be considered by ACTS.




If ev_min is EV_NULL, ACTS considers all




events if their event ids are less than ev_max.




If both ev_min and ev_max are EV_NULL,




all events are considered by ACTS.




Default: EV_NULL.


ev_max
uint32
Specifies the highest event ID (inclusive) of




events that should be considered by ACTS.




If ev_max is EV_NULL, ACTS considers




all events if their event ids are greater than




ev_min.




If both ev_min and ev_max are EV_NULL,




all events are considered by ACTS.




Default: EV_NULL.


enforce_async
uint32
Boolean.




Set to TRUE to enforce that the incoming




events (in the specified range) allow asyn-




chronous completion.




If TRUE and the incoming event does not




allow asynchronous completion, ST_REFUSE




is returned as an event distribution status.




If FALSE, ACTS forwards the event through




out without interpretation.




Default is FALSE.










[0455] 3. Events and Notifications


[0456] ACTS accepts any Dragon event.


[0457] 4. Environmental Dependencies


[0458] 4.1 Encapsulated Interaction


[0459] None.


[0460] 5. Specification


[0461] 5.1 Responsibilities


[0462] If the incoming events on in are not in the specified range, pass through the out terminal without modification.


[0463] For events received on the in terminal that are in the specified range, transform synchronous completion of the outgoing event into asynchronous completion of the incoming event that generated the former.


[0464] Pass all events received through the out terminal through the in terminal without modification.


[0465] 5.2 External States


[0466] None.


[0467] 5.3 Use Cases


[0468] 5.3.1 Transformation of Synchronous Completion to Asynchronous one


[0469] Sending a completion event back to the channel that originated the event within the input call simulates asynchronous completion.


[0470] This feature is used by ACTS to transform synchronous completion of events on its out terminal to events completing asynchronously on in.


[0471] ACTS passes all incoming events through its out terminal. For those events that are in the specified range and return a status other than ST_PENDING (synchronous completion), ACTS stores the status in the completion status field of the event bus (the same one passed on in) and sends the same event back through the in terminal with the ZEVT_A_COMPLETED attribute set.


[0472] For events that, when passed to out, naturally complete asynchronously (by returning ST_PENDING), ACT does not do anything and is only a pass-through channel.



XDL—Property Space Support


PHLD—Property Holder

[0473]
FIG. 9 illustrates the boundary of part, Property Holder (PHLD)


[0474] 1. Functional Overview


[0475] PHLD is a magic part that implements a virtual property container where the properties within the container are exposed as if they were actual properties of PHLD itself.


[0476] PHLD does not enforce any limit as to the number of properties it can maintain. The set of properties maintained by PHLD may be accessed using any valid Z-Force property mechanism.


[0477] PHLD supports the entire set of property operations (i.e., get, set, chk, and enumeration) on the virtual properties. However, PHLD own properties (.xxx) are excluded from enumeration.


[0478] All properties within the container have attributes as specified by one of PHLD's properties and these attributes are returned on property get_info requests. This is due to the fact that there is no other mechanism by which to specify attributes for specific properties.


[0479] PHLD has the option of sending a notification event either before and/or after a property value is about to be changed (i.e., property set operation). The event Ids are specified via properties and the generated event contains, as data a B_PROP structure as specified in the I_PROP interface. The notifications are sent within a critical section region therefore a possible deadlock may occur.


[0480] PHLD can be used as a placeholder for properties exposed on an assembly boundary and are not implemented by other subordinates within the assembly.


[0481] 2. Boundary
172.1 TerminalsNameDirInterfaceNotesnfyOutI_DRAINPHLD sends an event out this terminal eitherbefore and/or after a property is set.This terminal may remain unconnected.


[0482]

18











2.2 Properties









Property




name
Type
Notes





.prop_type
uint32
Property type that is returned when the Z-Force




engine retrieves the information about an




unknown property.




Default value is ZPRP_T_NONE.


.prop_attr
uint32
Property attributes that are returned when the




Z-Force engine retrieves the information about




an unknown property.




Default value is ZPRP_A_NONE.


.max_sz
uint32
Maximum size of storage for each property




value (specified in bytes).




On a property set operation (invoked through




the engine), if the length of the property value




exceeds the maximum size, PHLD fails the




operation.




If the value is 0, there is no limit. PHLD is




limited only by the amount of available




memory.




Default value is 0.


.pre_ev
uint32
ID of event to generate out nfy prior to a




property value being set.




If EV_NULL, no event is generated.




The default is EV_NULL.


.post_ev
uint32
ID of event to generate out nfy after a




property has been set.




If EV_NULL, no event is generated.




The default is EV_NULL.










[0483] 3. Events and Notifications
193.1 Terminal: nfyEventDirBusNotes(.pre_ev)outB_PROPThis event is generated just prior to settinga property.(.post_ev)outB_PROPThis event is generated after a property hasbeen successfully set.


[0484] 4. Environmental Dependencies


[0485] 4.1 Encapsulated Interaction


[0486] None.


[0487] 4.2 Other Environmental Dependencies


[0488] None.


[0489] 5. Specification


[0490] 5.1 Responsibilities


[0491] Maintain a set of virtual properties (like the part array—ARR). The properties can be parameterized using any valid Z-Force property mechanism.


[0492] Return the parameterized property type (.prop_type) and attributes (.prop_attr) on get info operations for unknown properties; otherwise return the appropriate information.


[0493] On a property set operation, if the specified property does not exist, create the property and store its value.


[0494] On a property get operation, if the specified property does not exist, return an empty value.


[0495] Generate notification out nfy terminal just prior to setting a property if (.pre_ev) is not EV_NULL.


[0496] Generate notification out nfy terminal after a property has been successfully modified if (.post_ev) is not EV_NULL.


[0497] Implement property enumeration over the virtual properties.


[0498] 5.2 External States


[0499] None.


[0500] 5.3 Use Cases


[0501] There are three possible use cases for PHLD:


[0502] The assembly that uses PHLD knows the properties it needs to store in the property holder. It uses the paramT macro in order to parameterize PHLD with the properties specifying the property type. In this case the assembly knows the names and types of the properties it needs to expose.


[0503] The assembly uses the param macro in order to parameterize PHLD with the properties; the property type is specified by PHLD's .prop_type property.


[0504] The assembly redirects some properties to PHLD, but does not provide default values for them. These properties will all have their type defined when they are first set from outside.


[0505] 6. Typical Usage


[0506] None.


[0507] 7. Notes


[0508] When using PHLD within an assembly, the assembly should not redirect properties maintained by PHLD to other subordinates.


[0509] For the implementation of the virtual properties, see the part array—ARR.



PRCCONST—Property Container for Constants

[0510]
FIG. 10 illustrates the boundary of part, PRCCONST


[0511] 1. Functional Overview


[0512] PRCCONST is a magic part implementing a virtual property container that makes it possible to define a set of named data constants. The named data constants are set as if they are actual properties of PRCCONST. The number of properties maintained by PRCCONST is limited only by the amount of available memory.


[0513] The set of properties maintained by PPRCCONST may be accessed using any valid Z-Force Property mechanism or through the prp terminal. All properties maintained by PRCCONST are non-modifiable (i.e., property set and chk requests are not allowed after part activation).


[0514] PRCCONST exposes only the properties within the container upon property enumeration.


[0515] Property get_info requests received through the Z-Force engine return the attributes specified by one of the PRCPROP's properties. This is due to the fact that there is no mechanism by which property attributes may be specified.


[0516] PRCCONST is typically used to hold the hard-parameterized values for parts that require parameterization during run-time such a part contained in a part array (ARR.)


[0517] PRCCONST must be guarded. The part cannot be used in an interrupt context.


[0518] 2. Boundary
202.1 TerminalsNameDirInterfaceNotesprpinI_PROPThis terminal is used to get, and enumerateproperties in the container.


[0519]

21











2.2 Properties









Property name
Type
Notes





.prop_type
uint32
Property type that is returned when the Z-Force




engine retrieves the information about an




unknown property.




Default value is ZPRP_T_NONE.


.prop_attr
uint32
Property attributes that are returned when the




Z-Force engine retrieves the information about




an unknown property.




Default value is ZPRP_A_NONE.


(Any)
(Any)
Virtual properties declared in the assembly




declaration of the assembly containing this part.










[0520] 3. Events and Notifications


[0521] None


[0522] 4. Environmental Dependencies


[0523] 4.1 Encapsulated Interaction


[0524] None


[0525] 5. Specification


[0526] 5.1 Responsibilities


[0527] Maintain a set of virtual properties. The properties can be parameterized using any valid Z-Force property mechanism.


[0528] Return the parameterized property type (.prop_type) and attributes (.prop_attr) on get_info operations received from the Z-Force engine for unknown properties; otherwise return the appropriate information.


[0529] On a property set operation received from the Z-Force engine and if the specified property does not exist, create the property and store its value.


[0530] On a property get operation received from the Z-Force engine and if the specified property does not exist, return an empty value.


[0531] Implement property enumeration over the virtual properties only.


[0532] Refuse all set and chk operations after part activation.


[0533] Return ST_INVALID on any attempt to open a query with a query string other than “*”. See note 2.


[0534] 5.2 External States


[0535] none


[0536] 5.3 Use Cases


[0537] There are two possible use cases for PRCCONST:


[0538] The assembly that uses PRCCONST knows the properties it needs to hard-parameterize in the property holder. It uses the paramT macro to parameterize PRCCONST with the properties specifying the property type. In this case, the assembly knows the names and types of the properties it needs to expose. After activation, the properties are enumerable and their values readable on the prp terminal


[0539] Similar to Use Case 1 except the assembly uses the param macro in order to parameterize PRCCONST with properties. The property type is specified by PRCCONST's . prop_type property.


[0540] 6. Typical Usage


[0541] 6.1 De-serializing a Part Array Element from “Factory Settings”


[0542] This use case demonstrates how PRCCONST can be used to provide “factory-default” settings for the de-serialization of elements of a part array.


[0543]
FIG. 11 illustrates an advantageous use of part, PRCCONST This example has PRCCONST connected to UTL_PRPQRY for the purpose of de-serializing component elements within ARR. In the assembly declaration for MY_ASSEMBLY, properties intended for the parameterization of MY_PART are declared using the paramT macro under the part declaration for PRCCONST. When APP_PARAM is triggered, de-serialization begins with the enumeration of properties out of PRCCONST. Properties declared on PRCCONST are enumerated and provided for the parameterization of MY_PART within the part array.


[0544] 7. Document References


[0545] None.


[0546] 8. Unresolved Issues


[0547] None


[0548] 9. Notes


[0549] When using PRCCONST within an assembly, the assembly should not redirect properties maintained by PRCCONST to other subordinates. If specific attributes are desired in order to filter properties during enumeration, the assembly into which PRCCONST is placed must override the attributes of properties maintained by PRCCONST.


[0550] UTL_PRPQRY may be used in front of PRCCONST in order to support more complex property queries.



XDL—Event Manipulation


EFS—Event Field Stamper

[0551]
FIG. 12 illustrates the boundary of part, Event Field Stamper (EFS)


[0552] 1. Functional Overview


[0553] EFS is an event manipulation part that stamps a specified value into a specified event field (event ID, attributes, size or completion status) of events passing from in to out. The value can be stamped either before or after the event is forwarded through the out terminal.


[0554] The value that EFS stamps into the event may be specified through either a property (defined on the boundary of EFS) or a data item retrieved through the dat terminal.


[0555] EFS modifies the value before stamping it into the event using a bit-wise AND mask. The mask, value to stamp and which event field to update, are programmed through properties.


[0556] EFS is typically used in assemblies to initialize a generated event that needs to be sent. EFS parts are usually chained together in order to initialize multiple fields in a event.


[0557] 2. Boundary
222.1 TerminalsNameDirInterfaceNotesIninI_DRAINEFS stamps the specified value in the specifiedevent field of events received on this terminalbefore or after the event is forwarded throughthe out terminal.This terminal can be used during interrupt time.Note that EFS uses the dat terminal in theexecution context of the in operation.outoutI_DRAINEvents received from the in terminal are passedthrough this terminal either before or after thespecified value has been stamped into theevent.datOutI_DATEFS invokes the bind and get operationsthrough this terminal to retrieve the data valueto stamp. This terminal is floating (doesnot have to be connected).


[0558]

23











2.2 Properties









Property name
Type
Notes





field
asciz
Event field to stamp the specified value in. Can




be one of the following values:




“id”: event ID




“size”: event size




“attr”: event attributes




“stat”: event completion status




Default value is “id” (event ID).


mask
uint32
Bitwise mask that defines which bits are




affected in the event field that the value is




stamped.




EFS ANDs this mask with the retrieved




value and also ANDs the complement of




this mask with the value of the specified




event field.




If field is “attr”, this property may not




contain event creation attributes (ZEVT




A_SHARED and ZEVT_A_SAFE) in




checked build.




Default value is 0xFFFFFFFF.


stamp_pre
uint32
Boolean. If TRUE, the specified value is




stamped before the incoming event is passed




through the out terminal; otherwise the value is




stamped after the event is passed through the




out terminal.




Note: Care should be taken when stamping the




value after (post) passing the event through out.




The recipient on the out terminal may destroy




the event.




Default value is TRUE.


val
uint32
Value that should be stamped into the incoming




event. Used only if the name property is “”.




If field is “attr”, this property may not contain




event creation attributes (ZEVT_A_SHARED




or ZEVT_A_SAFE) in checked build.




This property is active-time.




Default value is 0.


name
asciz
Name of the data item that stores the value that




should be stamped into the incoming event.




If this property is empty (“”), EFS stamps the




value of the val property into the incoming




event.




Default value is “”.


type
uint32
Data type of the data item [DAT_T_XXX].




Valid values for this property are: DAT_T




BYTE, DAT_T_UINT32 and DAT_T




SINT32.




Default value is DAT_T_UINT32.


restore
Uint32
Boolean. If TRUE, EFS restores the modified




event field to its original value after passing




the event through the out terminal.




Used only if stamp_pre iS TRUE.




Note: Care should be taken when restoring the




value after (post) passing the event through out.




The recipient on the out terminal may destroy




the event.




Default value is FALSE.










[0559] 3. Events and Notifications


[0560] EFS accepts any event through the in terminal. EFS does not modify or interpret the event data.


[0561] 3.1 Special Events, Frames, Commands or Verbs


[0562] None.


[0563] 3.2 Encapsulated Interaction


[0564] None.


[0565] 4. Specification


[0566] 4.1 Responsibilities


[0567] Stamp the specified value into the specified event field either before or after forwarding the event through out as specified by the stamp_pre property.


[0568] Retrieve the value to stamp either from the val property or from a data item (by invoking the bind and get operations through the dat terminal). Update only the bits in the event field as specified by the mask property.


[0569] Restore the original value of the modified event field after forwarding the event through the out terminal (only if the stamp_pre and restore properties are TRUE).


[0570] 4.2 Theory of Operation 4.2.1 Mechanisms



Value Retrieval

[0571] EFS retrieves the value to stamp either from the val property or from the specified data item. If the name property is empty (“”), the value is retrieved from the val property. Otherwise, EFS first invokes the bind operation (through dat) to retrieve the data item handle associated with the data item name. Next, EFS invokes the get operation to retrieve the value of the data item.


[0572] If EFS fails to bind to the data item or retrieve its value, EFS displays an error message to the debug console (checked builds only) and fails the call.


[0573] Note that if the incoming event pointer is NULL, EFS passes the event through the out terminal.



Modification of Event Field Values

[0574] After the value to stamp is retrieved, as described above, EFS ANDs (bitwise) the value with the mask property value. Next, EFS ANDs (bitwise) the event field value with the complement of the mask property value. Finally, the two resulting values are ORed together. Below is the formula used by EFS to update the specified event field in the incoming event:


event field value=(event field value & ˜mask)|(value & mask)


[0575] If the stamp_pre and restore properties are TRUE, EFS restores the event field to its original value after forwarding the event through out.


[0576] Note that if an incoming event is constant (the ZEVT_A_CONST attribute is set), EFS fails and returns ST_REFUSE.


[0577] 4.3 Use Cases


[0578] 4.3.1 Stamping Event IDs


[0579] The use case presented below updates the event ID field of the incoming events with the value of a data item named “event_id”. The dat terminal of EFS should be connected to a data item container used to store the data items.


[0580] Typically, this is used in assemblies where an event needs to be generated with specific fields. A chain of EFSes is strung together to initialize all the fields of a particular event.


[0581] EFS is parameterized with the following:


[0582] field=“id” (event ID)


[0583] mask=0xFFFFFFFF (no change)


[0584] stamp_pre=TRUE


[0585] name=“event id”


[0586] type=DAT_T_UINT32


[0587] restore=FALSE


[0588] An event is received through EFS's in terminal.


[0589] EFS retrieves the “event_id” data item value using the dat terminal.


[0590] Next, EFS ANDs the event ID data item value with 0xFFFFFFFF (no change). The event ID of the incoming event is ANDed with the complement of 0xFFFFFFFF to clear its value.


[0591] EFS updates the event ID of the incoming event and forwards the event through the out terminal.


[0592] The event may travel through multiple EFS parts in order to initialize its fields.


[0593] EFX—Event Field Extractor


[0594]
FIG. 13 illustrates the boundary of part, Event Field Extractor (EFX)


[0595] 1. Functional Overview


[0596] EFX is an event manipulation part that extracts an event field value (event ID, attributes, size or completion status) from an event passing from in to out and stores it in two places: as a data item out the dat terminal and in a read-only property defined on EFX's boundary.


[0597] EFX modifies the event field value before storing it using a bit-wise AND mask.


[0598] The event field value may be extracted either before or after passing the event through the out terminal.


[0599] The event field to extract, AND mask and the name of the data item to set are all specified through properties.


[0600] EFX is typically used in assemblies where one or more of the event fields need to be saved for use in the creation of a new event.


[0601] 2. Boundary
242.1 TerminalsNameDirInterfaceNotesininI_DRAINEvent field data is extracted from the eventsreceived on this terminal as specified by EFX'sproperties (before or after the event isforwarded through the out terminal).This terminal may be used during interrupttime. Note that EFX uses the dat terminal in theexecution context of the in operation.outoutI_DRAINEvents received from the in terminal are passedthrough this terminal either before or after theevent field data has been extracted from theevent.datoutI_DATEFX invokes the bind and set operationsthrough this terminal to store the extractedevent field data value (bind and set are calledevery time for each event received through in).This terminal is floating (does not have to beconnected).


[0602]

25











2.2 Properties









Property name
Type
Notes





field
asciz
Event field to extract from events received




through the in terminal. Can be one of the




following values:




“id”: event ID




“size”: event size




“attr”: event attributes




“stat”: event completion status




Default value is “id”(event ID).


mask
uint32
Bitwise mask ANDed with the specified event




field value extracted from the incoming event.




EFX masks the extracted value before storing




the value in the val property or in a data item.




Default value is 0xFFFFFFFF (no change).


extract_pre
uint32
Boolean. If TRUE, the event field value is




extracted before the event is passed through the




out terminal; otherwise the event field value is




extracted after the event is passed through the




out terminal.




Note: Care should be taken when extracting




the value after (post) passing the event through




out. The recipient on the out terminal may




destroy the event.




Default is TRUE.


val
uint32
Value of the event field extracted from the




incoming event.




EFX initializes this property to zero on




construction.




This property is read-only.


name
asciz
Name of the data item into which to store the




extracted event field value.




If this property is empty (“”), EFX only




updates the val property with the extracted




value. In this case the dat terminal is not used.




Default value is “”.


Type
uint32
Data type of the data item [DAT_T_XXX].




Valid values for this property are: DAT_T




BYTE, DAT_T_UINT32 and DAT_T




SINT32.




The default is DAT_T_UINT32.










[0603] 3. Events and Notifications


[0604] EFX accepts any event through the in terminal. EFX does not modify or interpret the event data.


[0605] 3.1 Special Events, Frames, Commands or Verbs


[0606] None.


[0607] 3.2 Encapsulated Interaction


[0608] None.


[0609] 4. Specification


[0610] 4.1 Responsibilities


[0611] Extract the event field value from the event bus either before or after forwarding the event through out as specified by the extract_pre property.


[0612] Modify the extracted value as specified by the mask property.


[0613] Store the extracted value in the val property and as a data item (if the name property is not “”).


[0614] 4.2 Theory of Operation


[0615] 4.2.1 State Machines


[0616] None.


[0617] 4.2.2 Mechanisms



Event Field Value Extraction and Storage

[0618] EFX extracts the value from the event based on the field property (using the provided Z-Force event macros). The extracted value is then ANDed (bitwise) with the mask property value. The value is extracted based on the extract_pre property (either before or after forwarding the event through the out terminal).


[0619] The resulting value is first stored in the val read-only property. Next, if the name property is not empty (“”), EFX stores the value as a data item using the dat terminal.


[0620] EFX first invokes the bind operation to retrieve the data item handle (associated with the data item name). Next, EFX invokes the set operation to set the value of the data item.


[0621] If EFX fails to bind to the data item or set its value, EFX only displays an error message to the debug console (checked builds only). The incoming event is always forwarded through the out terminal.


[0622] Note that in all cases, EFX extracts the specified value and stores it (even if passing the incoming event through out fails).


[0623] 4.3 Use Cases


[0624] 4.3.1 Extracting Event IDs


[0625] This use case extracts the event ID from the incoming event and stores it in a data item named “event_id”. The dat terminal of EFX should be connected to a data item container used to store the data items.


[0626] EFX is parameterized with the following:


[0627] field=“id” (event_ID)


[0628] mask=0xFFFFFFFF (no change)


[0629] extract_pre=TRUE


[0630] name=“event id”


[0631] type=DAT_T_UINT32


[0632] An event is received through EFX's in terminal.


[0633] EFX extracts the event ID and ANDs the ID with 0xFFFFFFFF (no change).


[0634] EFX updates the val property with the event ID and then sets the “event_id” data item through the dat terminal (after binding to the data item handle).


[0635] At a later time, the “event_id” data item may be read from the data container to create a new event with the same ID (using EFS).



ERC—Event Recoder

[0636]
FIG. 14 illustrates the boundary of part, Event Recoder (ERC)


[0637] 1. Functional Overview


[0638] ERC is an event manipulation part used to recode event fields (event ID, attributes, size or completion status) in an event flow. ERC recodes the specified event field in incoming events by either adding or subtracting a specific value to the field. The event field to recode and the value to add or subtract from the field are programmed through properties.


[0639] ERC may be parameterized to recode the event either before or after forwarding the event through the out terminal.


[0640] ERC has an option to restore the modified field to its original value before returning.


[0641] ERC restores the event bus only if it had originally modified the bus contents.


[0642] 2. Boundary
262.1 TerminalsNameDirInterfaceNotesInInI_DRAINThe incoming events received through thisterminal are recoded (if needed) and arepassed though out.This terminal may be used during interrupttime.outOutI_DRAINEvents received from the in terminal arerecoded (if needed) and are passed throughthis terminal.


[0643]

27











2.2 Properties









Property name
Type
Notes





field
asciz
Event field to recode. Can be one of the




following values:




“id”: event ID




“size”: event size




”attr”: event attributes




“stat”: event completion status




Default value is “id” (event ID).


val
uint32
Integer value that is either added to or




subtracted from the specified event field.




If field is “attr”, this property may not




contain event creation attributes (ZEVT_A




SHARED or ZEVT_A_SAFE) in checked




build.




Default value is 0 (no change).


add
uint32
Boolean. If TRUE, the val property is added




to the specified event field; otherwise the




val property is subtracted from the field.




Default value is TRUE.


recode_pre
uint32
Boolean. If TRUE, the specified event field




is recoded before the incoming event is




passed through the out terminal; otherwise




it is recoded after the event is passed




through the out terminal.




Note: Care should be taken when recoding the




event after (post) passing the event through




out. The recipient on the out terminal may




destroy the event.




Default value is TRUE.


restore
uint32
Boolean. If TRUE, ERC restores the recoded




event field to its original value before




returning. Used only if the recode_pre




property is TRUE.




Note: Care should be taken when restoring the




event after passing it through out. The




recipient on the out terminal may destroy the




event.




Default value is FALSE.










[0644] 3. Events and Notifications


[0645] ERC accepts any Dragon event through the in terminal. ERC does not modify or interpret the event data (except for the specified event field to be recoded).


[0646] 3.1 Special Events, Frames, Commands or Verbs


[0647] None.


[0648] 3.2 Encapsulated Interaction


[0649] None.


[0650] 4. Specification


[0651] 4.1 Responsibilities


[0652] Recode the incoming event as specified by properties. Recode the event either before or after passing the event through the out terminal.


[0653] Restore the modified event field to its original value before returning (only if the restore and recode_pre properties are TRUE).


[0654] 4.2 Theory of Operation


[0655] 4.2.1 Mechanisms



Recoding an Event Field

[0656] The event field to recode is specified through the field property. ERC retrieves the value of this field and either adds or subtracts the val property from this value.


[0657] ERC recodes the event either before or after the event is forwarded through the out terminal (depending on the recode_pre property).


[0658] ERC may be parameterized to restore the recoded field to its original value after forwarding the event. In this case after the event is recoded and passed through out, ERC restores the field to its original value and returns. This applies only when the event is recoded before passing the event through out (recode_pre is TRUE).


[0659] Note that if an incoming event is constant (the ZEVT_A_CONST attribute is set), ERC fails and returns ST_REFUSE.


[0660] 4.3 Use Cases


[0661] 4.3.1 Recoding and Event ID


[0662] The following use case recodes the event ID of all the incoming events by adding 1 to the ID. This can apply to any of the supported event fields: event ID, attributes, size or completion status.


[0663] ERC is created and parameterized with the following:


[0664] field=“id”


[0665] val=1


[0666] add=TRUE


[0667] recode_pre=TRUE


[0668] restore=FALSE


[0669] An event with the ID of 0x222 is passed to ERC through its in terminal.


[0670] ERC recodes the event ID to 0x223 (adds 1 to the event ID) and passes the event through the out terminal.



ERCB—Bi-directional Event Recoder

[0671]
FIG. 15 illustrates the boundary of part, Bi-directional Event Recoder (ERCB)


[0672] 1. Functional Overview


[0673] ERCB is an event manipulation part used to recode event fields (event ID, attributes, size or completion status) in an event flow. ERCB recodes the specified event field in incoming events (received through the in terminal) by either adding or subtracting a specific value to the field. The event field to recode and the value to add or subtract from the field are programmed through properties.


[0674] ERCB may be parameterized to recode the event either before or after forwarding the event through the out terminal.


[0675] ERCB has an option to restore the modified field to its original value before returning.


[0676] ERCB restores the event bus only if it had originally modified the bus contents.


[0677] Events received through the out terminal are forwarded through in without modification.


[0678] 2. Boundary
282.1 TerminalsNameDirInterfaceNotesIninI_DRAINThe incoming events received through thisterminal are recoded (if needed) and arepassed through out.This terminal may be used during interrupttime.outoutI_DRAINEvents received from the in terminal arerecoded (if needed) and are passed throughthis terminal.All events sent through this terminal are passeddirectly through in without modification.


[0679]

29











2.2 Properties









Property name
Type
Notes





field
asciz
Event field to recode. Can be one of the




following values:




“id”: event ID




“size”: event size




“attr”: event attributes




“stat”: event completion status




Default value is “id” (event ID).


val
uint32
Integer value that is either added to or




subtracted from the specified event field.




If field is “attr”, this property may not contain




event creation attributes (ZEVT_A




SHARED or ZEVT_A_SAFE) in checked




build.




Default value is 0 (no change).


add
uint32
Boolean. If TRUE, the val property is added




to the specified event field; otherwise the val




property is subtracted from the field.




Default value is TRUE.


recode_pre
uint32
Boolean. If TRUE, the specified event field is




recoded before the incoming event is passed




through the out terminal; otherwise it is




recoded after the event is passed through




the out terminal.




Note: Care should be taken when recoding




the event after (post) passing the event




through out. The recipient on the out




terminal may destroy the event.




Default value is TRUE.


restore
uint32
Boolean. If TRUE, ERCB restores the




recoded event field to its original value




before returning. Used only if the recode_pre




property is TRUE.




Note: Care should be taken when restoring




the event after passing it through out. The




recipient on the out terminal may destroy the




event.




Default value is FALSE.










[0680] 3. Events and Notifications


[0681] ERCB accepts any event through its inputs. ERCB does not modify or interpret the event data (except for the specified event field to be recoded).


[0682] 3.1 Special Events, Frames, Commands or Verbs


[0683] None.


[0684] 3.2 Encapsulated Interaction


[0685] None.


[0686] 4. Specification


[0687] 4. 1 Responsibilities


[0688] Recode the incoming event as specified by properties. Recode the event either before or after passing the event through the out terminal.


[0689] Restore the modified event field to its original value before returning (only if the restore and recode_pre properties are TRUE).


[0690] Pass all events received from out through in without modification.


[0691] 4.2 Theory of Operation


[0692] 4.2.1 Mechanisms



Recoding an Event Field

[0693] The event field to recode is specified through the field property. ERCB retrieves the value of this field and either adds or subtracts the val property from this value.


[0694] ERCB recodes the event either before or after the event is forwarded through the out terminal (depending on the recode_pre property).


[0695] ERCB may be parameterized to restore the recoded field to its original value after forwarding the event. In this case after the event is recoded and passed through out,


[0696] ERCB restores the field to its original value and returns. This applies only when the event is recoded before passing the event through out (recode_pre is TRUE).


[0697] Note that if an incoming event is constant (the ZEVT_A_CONST attribute is set), ERCB fails and returns ST_REFUSE.


[0698] 4.3 Use Cases


[0699] 4.3.1 Recoding and Event ID


[0700] The following use case recodes the event ID of all the incoming events by adding 1 to the ID. This can apply to any of the supported event fields: event ID, attributes, size or completion status.


[0701] ERCB is created and parameterized with the following:


[0702] field=“id”


[0703] val=1


[0704] add=TRUE


[0705] recode_pre=TRUE


[0706] restore=FALSE


[0707] An event with the ID of 0x222 is passed to ERCB through its in terminal.


[0708] ERCB recedes the event ID to 0x223 (adds 1 to the event ID) and passes the event through the out terminal.


[0709] Any events received through the out terminal are passed through in without modification.



XDL—Data Manipulation


FDC—Fast Data Container

[0710]
FIG. 16 illustrates the boundary of part, Fast Data Container (FDC)


[0711] 1. Functional Overview


[0712] FDC implements a container for data items; data items are typically used in assemblies to keep track of state variables and other information. The container can hold up to 16 data items.


[0713] The data items are identified by a data item handle (as defined by the I_DAT interface; please see the documentation of this interface for more information). The data item handle is used by FDC for fast data item identification and access.


[0714] Operations on the contained data items include: binding to a data item handle by name (in.bind), retrieving information about the data item (in.get_info), retrieving the data item value (in.get) and modifying the data item value (in.set).


[0715] The data item names, types and default values are specified through properties. On construction, FDC initializes each data item to its specified default value. FDC supports all the data item types and operations as defined by the I_DAT interface.


[0716] FDC may be cascaded (several FDCs connected together) in order to support more then 16 data items. When an operation is invoked through the in terminal for an unrecognized data item, FDC forwards the operation through its out terminal to the next container in the chain.


[0717] FDC is unguarded does not provide any protection of the data it stores. If FDC is to be used in an environment where it may be entered from multiple threads, an external guard or critical section should be used.


[0718] 2. Boundary
302.1 TerminalsNameDirInterfaceNotesininI_DATThis terminal is used to access the data itemsthat are stored in the container. FDC supportsall the operations defined by the I_DATinterface.outoutI_DATFDC forwards the incoming operations throughthis terminal for data items that are not found inthe container.This terminal is used for cascading FDC somore then 16 data items can be supported.This terminal may be left unconnected(floating).


[0719]

31











2.2 Properties









Property name
Type
Notes





name [0]-
asciz
Names of the data items that are stored in the data container.


name [15]

Each name may contain up to 16 characters (including the




terminating string character).




FDC supports up to 16 data items. Use cascaded FDCs to




support more data items.




If the name is an empty string (“”), it is ignored.




The default values for each name is “” (not used).


type [0]-
uint32
Types of the data items [DAT_T_XXX].


type [15]

The default value for each type is DAT_T_UINT32.


dflt_val [0]-
uint32
Depending on the data item type, these properties contain


dflt_val [15]

either the default value for the data item or the size of the




data item value storage.




For all property types except for fixed/variable-sized binary,




these properties contain the default value for the data item.




For asciz, unicoded and context types, these properties




contain a pointer to the default value.




For fixed/variable sized binary types, these properties




contain the initial size of the storage in the container for the




data item value. No default value can be specified for




binary types.




The default values are 0.


base
uint32
Data item handle base.




FDC uses this value as the base value for data item handles.




Data item handles are calculated by adding the data item




index (0 . . . 15) to the value of this property.




When cascading several FDCs, the base value can be used to




identify the contents that holds a specific data item.




The base value must be between 1 and 0×FFFFFFF0.




The default value is 1.










[0720] 3. Events and Notifications


[0721] None.


[0722] 3.1 Special Events, Frames, Commands or Verbs


[0723] None.


[0724] 3.2 Encapsulated Interaction


[0725] None.


[0726] 4. Specification


[0727] 4.1 Responsibilities


[0728] Maintain a static container for data item values (maximum of 16 data items).


[0729] On construction, allocate an array of entries used to store the data item values.


[0730] Initialize all data item values to their corresponding default values as specified through properties.


[0731] On the in.bind operation, search for the specified data item in the name property array and pass back the corresponding data item handle (handle=data item name index+the value of the base property).


[0732] On the in.get_info operation, pass back the type of the specified data item.


[0733] On the in.get operation, pass back the data item value for the specified data item.


[0734] On the in.set operation, update the specified data item value in the container.


[0735] On any of the I_DAT operations, if the specified data item is not found, forward the operation through the out terminal. Do not modify the operation bus.


[0736] 4.2 Theory of Operation


[0737] 4.2.1 State Machines


[0738] None.


[0739] 4.2.2 Mechanisms



Data Item Value Storage

[0740] On construction, FDC allocates an array of entries that are used to store the data item values and any other information needed by the container. The array is indexed in the same manner as the data item properties (0..15). On the in. get and in. set operations, FDC uses this array to retrieve and modify the data item values.



Data Item Binding and Identification

[0741] Data item handles identify data items. A data item handle is made up of the data item entry index (0..15) and the data item handle base (value of the base property). A data item handle is calculated by adding the data item entry index to the data item handle base.


[0742] Data item handles are retrieved using the bind operation. The operation bus specifies the data item name that FDC uses to calculate the corresponding data item handle. The data item handle is used in the rest of the operations for fast data item identification and access.



Data Container Cascading

[0743] FDC can only contain up to 16 data items. This limit can be overcome by cascading FDC.


[0744] If FDC receives a request for a data item that it does not contain, FDC passes the request through its out terminal. This allows multiple FDCs to be connected together in order to support more then 16 data items. The base property may be used to distinguish between which container a data item belongs to.


[0745] 4.3 Use Cases



4.3.1 Cascading Data Containers

[0746] This use case describes how to cascade multiple data containers together in order to support more then 16 data items. This example presents two FDC's connected together, each one containing one data item for simplicity.


[0747]
FIG. 17 illustrates Cascading FDC


[0748] PartXXX is a part that uses the services of FDC to maintain several state variables. The first variable is named “dat_item1” which is stored in FDC1. The second variable is named “dat_item2” which is stored in FDC2. PartXXX may use up to 32 variables: 16 stored in FDC1 and 16 stored in FDC2.


[0749] FDC1 of class FDC is created and parameterized with the following:


[0750] a. name [0]=“data_item1”


[0751] b. type [0]=DAT_T_UINT32


[0752] c. dflt_val [0]=10


[0753] d. base=1


[0754] FDC2 of class FDC is created and parameterized with the following:


[0755] a. name [0]=“data_item2”


[0756] b. type [0]=DAT_T_UINT32


[0757] c. dflt_val [0]=20


[0758] d. base=10


[0759] All parts are activated. FDC1 and FDC2 create a data item entry array and initialize the first entries (index 0) with the specified default values for the data items: “dat_item1”=10 and “dat_item2”=20.


[0760] FDC1 receives a request from PartXXX to bind to the “dat_item1” data item. FDC1 searches for the data item in the name array and finds it at index 0. FDC1 creates the data handle (index 0+base 1) and returns it to the caller (data item handle is 1).


[0761] FDC1 receives a request from PartXXX to bind to the “dat_item2” data item. FDC1 searches for the data item in the name array and does not find it. FDC1 passes the call through the out terminal to FDC2.


[0762] FDC2 receives a request from FDC1 to bind to the “dat_item2” data item. FDC2 searches for the data item in the name array and finds it at index 0. FDC2 creates the data handle (index 0+base 10) and returns it to the caller (data item handle is 10). The bind operation call returns back to PartXXX with the data item handle for “dat_item2”.


[0763] PartXXX may then get and set the data item values using the supplied data item handles.


[0764] 5. Notes


[0765] FDCs access through the dat terminal is non-atomic. Therefore, an assembly using this part may need to use external guarding.


[0766] For non-integral data item types, FDC does not provide conversion between different types of data items. When retrieving or modifying a data item value, the supplied data type in the operation bus must be the same as the data item type.



ALU—Arithmetic/Logic Unit

[0767]
FIG. 18 illustrates the boundary of part, Arithmetic/Logic Unit (ALU)


[0768] 1. Functional Overview


[0769] ALU is a data manipulation part that performs arithmetic/logic operation over integral data items when a trigger event is received.


[0770] When a trigger event is received on in terminal, ALU retrieves, through dat terminal, the value of data item(s) necessary to execute the arithmetic/logic operation. The result of the operation is sent out through dat terminal.


[0771] The trigger event, the operation type, the name and the type of operands and the name and the type of the result data item can be specified through properties.


[0772] 2. Boundary
322.1 TerminalsNameDirInterfaceNotesininI_DRAINWhen the trigger event is received on this terminal, ALUperforms arithmetic/logic operation over specified data items.This terminal is unguarded.datoutI_DATALU invokes bind and get operations through this terminal toretrieve the value of the operand items.ALU invokes bind and set operations out this terminal tostore the operation result in specified data item.


[0773]

33











2.2 Properties









Property name
Type
Notes





trigger_ev
uint32
Trigger Event ID. When this event is received, ALU




performs the specified by opcode operation.




When EV_NULL, any event received on in terminal will




trigger arithmetic/logic operation.




The default value is EV_NULL.


opcode
asciz
Type of arithmetic/logical operation to be executed over the




specified by op1.name and op2.name data items (operands).




This property is mandatory.


op1.name
asciz
Name of integral data item to be used in the arithmetic/logic




operation as a first argument.




The value of this property cannot be an empty string.




This property is mandatory.


op1.type
uint32
Type of the first data operand.




The allowed values are DAT_T_BYTE, DAT_T_UINT32,




DAT_T_SINT32 and DAT_T_BOOLEAN.




This property is mandatory.


op2.name
asciz
Name of integral data item to be used in the arithmetic/logic




operation as a second argument.




The default value is “” (this argument is not used).


op2.type
uint32
Type of the first data operand.




The allowed values are DAT_T_NONE, DAT_T_BYTE,




DAT_T_UINT32, DAT_T_SINT32 and DAT_T_BOOLEAN.




DAT_T_NONE type is used only when this argument is not




used (i.e., op2.name is en empty string)




The default value is DAT_T_NONE (this argument is not used).


res.name
asciz
Name of the data item used for storing the result of the




operation specified by opcode property.




The value of this property cannot be an empty string.




This property is mandatory.


res.type
uint32
Type of the data item used for storing the result of the




arithmetic/logic operation.




The allowed values are DAT_T_BYTE, DAT_T_UINT32,




DAT_T_SINT32 and DAT_T_BOOLEAN.




This property is mandatory.










[0774] 3. Events and Notifications
343.1 Terminal: inEventDirBusNotes(trigger_ev)inanyWhen this event is received, ALU performsarithmetic/logical operation over the specified data items.otherinanyAny other event received on in terminal is completed withstatus ‘not supported’.


[0775]

35











3.2 Special events, frames, commands or verbs


The following table describes the operations executed by the ALU upon receiving of the


trigger event.


Note that if the result of any operation cannot be fit into 32-bit, only the lowest


significant 32-bits are used.










Opcode
Operands
Type
Notes





“˜”
op1
Arithmetic
Complementary operation.





The result value is bitwize complement of the





value of the first operand. I.e., inverting all





operand bits creates the result.


“NEG”
op1
Arithmetic
Negative Operation.





This operation converts negative numbers into





positive and vice-versa.





For unsigned values, subtracting the operand from





zero produces the result.


“−”
op1
Arithmetic
Negative Operation. (Same as “NEG”)



(no op2

This operation converts negative numbers into



specified)

positive and vice-versa.





For unsigned values, subtracting the operand from





zero produces the result.


“++”
op1
Arithmetic
Increment by one.





The result of this operation is equal to the value of





the first operand incremented by one.


“−−”
op1
Arithmetic
Decrement by one.





The result of this operation is equal to the value of





the first operand decremented by one.


“+”
op1, op2
Arithmetic
Addition.





The result of this operation is equal to the sum of





the operands.


“−”
op1, op2
Arithmetic
Subtraction.





Subtracting the second operand from the first one





creates the result of this operation.


“*”
op1, op2
Arithmetic
Multiplication.





Multiplying both operands creates the result of





this operation.


“/”
op1, op2
Arithmetic
Division.





Dividing the first operand by the second one





creates the result of this operation.





When two signed operands are divided and only





one of them has a negative value, the division is





made by using operand's absolute values and





inverting the result sign.





Note that the second operand cannot be equal to





zero. (No division by zero is allowed.)


“%”
op1, op2
Arithmetic
Modulus (Division Reminder).





The result is the reminder when the first operand





is divided by the second operand.





When both operands are signed, the operation is





executed over their absolute values. The result





sigh is equal to the sign of the first operand.





Note that the second operand cannot be equal to





zero. (No division by zero is allowed.)


“|”
op1, op2
Arithmetic
Bitwise (Inclusive) OR





The result has its bit set when any of the operands





have their correspondent bit set. The result bit is





clear when both operands have their





correspondent bit clear.


“&”
op1, op2
Arithmetic
Bitwise AND





The result has its bit set when both operands have





their correspondent bit set. The result bit is clear





when any of the operands have their





correspondent bit clear.


“{circumflex over ( )}”
op1, op2
Arithmetic
Bitwise Exclusive OR





(Sum Modulo Two)





The result bit is set when correspondent operand





bits are different (e.g., one of them is set, the other





is clear). The result has its bit clear when the





correspondent bits (in both operands) are equal.


“<<”
op1, op2
Arithmetic
Bitwise Left Shift





The result is produced by shifting left the first





operand by the number of positions specified by





the second operand. This is equivalent to





multiplying the first operand by 2 raised to the





power of the second operand.





Note that the value of the second operand must be





greater or equal than zero.


“>>”
op1, op2
Arithmetic
Bitwise Right Shift





The result is produced by shifting right the first





operand by the number of positions specified by





the second operand. This is equivalent to dividing





the first operand by 2 raised to the power of the





second operand.





Note that the value of the second operand must be





greater or equal than zero.


“!”
op1
Logical
Logical Negation (logical-NOT).





When the operand is TRUE (non-zero), the result





is equal to FALSE (zero). When the operand is





FALSE (zero), the result is equal to TRUE (one).


“∥”
op1, op2
Logical
Logical OR.





When the value of any of the operands is TRUE





(non-zero), the result is equal to TRUE (one).





When both operands are FALSE (zero), the result





is equal to FALSE (zero).


“&&”
op1, op2
Logical
Logical AND.





When the values of both operands are TRUE





(non-zero), the result is equal to TRUE (one).





When any of the operands is FALSE (zero), the





result is equal to FALSE (zero).


“{circumflex over ( )}{circumflex over ( )}”
op1, op2
Logical
Logical Exclusive OR.





The result is TRUE (one), when one of the





operands is TRUE (non-zero) and the other





operand is FALSE (zero). Otherwise the result is





FALSE (zero).


“==”
op1, op2
Logical
Equality.





The result is TRUE (one), when the values of both





operands are equal. Otherwise the result is FALSE





(zero).


“!=”
op1, op2
Logical
Not-Equality.





The result is FALSE (zero), when the values of





both operands are different. Otherwise the result is





TRUE (one).


“>”
op1, op2
Logical
Greater (first operand).





The result is TRUE (zero), when the value of the





first operand is greater than the value of the





second operand. Otherwise the result is FALSE





(zero).


“<”
op1, op2
Logical
Less (smaller first operand).





The result is TRUE (zero), when the value of the





first operand is smaller than the value of the





second operand. Otherwise the result is FALSE





(zero).


“>=”
op1, op2
Logical
Greater-or-Equal (first operand).





The result is TRUE (zero), when the value of the





first operand is greater or equal to the value of the





second operand. Otherwise the result is FALSE





(zero).


“<=”
op1, op2
Logical
Less or Equal (smaller or equal first operand).





The result is TRUE (zero), when the value of the





first operand is smaller or equal to the value of the





second operand. Otherwise the result is FALSE





(zero).










[0776] For all operations listed bellow, ALU converts the signed operand to unsigned, if one of the operands is a signed integer and the other operand is not. The operand conversion does not change the operands bit-pattern.:


[0777] “+”—Addition.


[0778] “−”—Subtraction.


[0779] “*”—Multiplication.


[0780] “/”—Division.


[0781] “%”—Modulus (Division Reminder).


[0782] “|”—Bitwise (Inclusive) OR


[0783] “&”—Bitwise AND


[0784] “ˆ ”—Bitwise Exclusive OR (Sum Modulo Two)


[0785] “==”—Equality.


[0786] “!=”—Not-Equality.


[0787] “>”—Greater (first operand).


[0788] “<”—Less (smaller first operand).


[0789] “>=”—Greater-or-Equal (first operand).


[0790] “<=”—Less or Equal (smaller or equal first operand).


[0791] 3.3 Encapsulated Interaction


[0792] None.


[0793] 4. Specification


[0794] 4.1 Responsibilities


[0795] Fail all unrecognized events received on in terminal.


[0796] When the trigger event is received, retrieve the values of the data operands by invoking the bind and get operations through the dat terminal.


[0797] Execute the arithmetic/logic operation specified by opcode property.


[0798] Ensure that the ‘boolean’ type result has only two values: one (TRUE) and zero (FALSE)


[0799] Store the result in the result data item (res.name) by invoking the bind and set operations through the dat terminal.


[0800] Fail the trigger event if an error occurs.


[0801] 4.2 Theory of Operation


[0802] 4.2.1 State Machines


[0803] None.


[0804] 4.2.2 Mechanisms


[0805] None.



CAT—Data Concatenator

[0806]
FIG. 19 illustrates the boundary of part, Data Concatenator (CAT)


[0807] 1. Functional Overview


[0808] CAT is a data manipulation part that concatenates string or binary data on a trigger event.


[0809] When a trigger event is received on in terminal, CAT retrieves the value of two data items, concatenates them and stores the result in a third data item.


[0810] CAT utilizes dat terminal for retrieving the operand data and storing the result in the specified data item. If any of the requests sent out through dat terminal fails, CAT completes the trigger event with the status returned on the dat terminal.


[0811] If the type of the operands doesn't match, CAT converts them to a common type before concatenating them. When the result type and the result data item type, doesn't match, CAT converts the result to match the type of the data item.


[0812] The trigger event, the name and type of the data items and the maximum result size can be specified through properties.


[0813] CAT provides a way to concatenate two data items. It can also be used for modifying the size of a data item or modify the data item type.


[0814] 2. Boundary
362.1 TerminalsNameDirInterfaceNotesininI_DRAINWhen the trigger event is received on this terminal, CATconcatenates two data items and stores the result in a third dataitem.This terminal is unguarded.datoutI_DATCAT invokes bind and get operations out this terminal toretrieve the value of the operand items.CAT invokes bind and set operations out this terminal tostore the concatenation result in the specified data item.


[0815]

37











2.2 Properties









Property name
Type
Notes





trigger_ev
uint32
Trigger Event ID. When this event is received, CAT




concatenates two data items and stores the result in another




data item.




When EV_NULL, any event received on in terminal will




trigger data item concatenation.




The default value is EV_NULL.


op1.name
asciz
Name of the data item used as first operand in data




concatenation.




When no name specified, this operand is not used.




The default value is “” (this operand is not used).


op1.type
uint32
Type of the first data concatenation operand.




The allowed values are DAT_T_NONE, DAT_T_ASCIZ,




DAT_T_UNICODEZ, DAT_T_BIN_FIXED and DAT_T_BIN_VAR.




DAT_T_NONE type is used only when no operand name is




specified (e.g., op1.name is en empty string)




The default value is “” (this operand is not used).


op2.name
asciz
Name of the data item used as second operand in data




concatenation.




When no name specified, this operand is not used.




The default value is “” (this operand is not used).


op2.type
uint32
Type of the second data concatenation operand.




The allowed values are DAT_T_NONE, DAT_T_ASCIZ,




DAT_T_UNICODEZ, DAT_T_BIN_FIXED and DAT_T_BIN_VAR.




DAT_T_NONE type is used only when no operand name is




specified (e.g., op2.name is en empty string)




The default value is “” (this operand is not used).


res.name
asciz
Name of the data item used for storing the result of the data




concatenation.




The value of the data item specified by op2.name property is




attached at the end of the value of the data item specified by




op1.name added. The result is stored in the data item specified




by res.name property.




The value of this property cannot be an empty string.




This property is mandatory.


res.type
uint32
Type of the data item used for storing the result of the data




concatenation.




The allowed values are DAT_T_ASCIZ, DAT_T_UNICODEZ,




DAT_T_BIN_FIXED and DAT_T_BIN_VAR.




The default value is DAT_T_BIN FIXED


res.max_sz
uint32
Specifies the maximum size, in bytes, of the data concatenation




result.




When zero (0), there is no limitation in the result size.




The default value is 0 (no maximum).










[0816] 3. Events and Notifications
383.1 Terminal: inEventDirBusNotes(trigger_ev)inanyWhen this event is received, CAT executes data itemconcatenation.otherinanyAny other event received on in terminal is completed withstatus ‘not supported’.


[0817] 3.2 Special Events, Frames, Commands or Verbs


[0818] None.


[0819] 3.3 Encapsulated Interaction


[0820] None.


[0821] 4. Specification


[0822] 4.1 Responsibilities


[0823] When the trigger event is received, retrieve the values of the data concatenation operands by invoking the bind and get operations through the dat terminal.


[0824] If necessary convert data operands to the type used during data concatenation.


[0825] Concatenate two data items by attaching the second operand at the end of the first operand.


[0826] Convert the result to res.type.


[0827] If necessary, limit the size of the result to the value specified in res.max_sz.


[0828] Store the result in the result data item (res.name) by invoking the bind and set operations through the dat terminal.


[0829] Fail the trigger event if an error occurs.


[0830] 4.2 Theory of Operation


[0831] 4.2.1 State Machines


[0832] None.


[0833] 4.2.2 Mechanisms



Operand Type Conversion

[0834] The data concatenation is always executed over the operands with equal type. The following table displays type to which both operands are converted before concatenating them. Note that not all combinations are supported.
39Operand 1 TypeOperand 2 TypeConcatenation Typenonenonenonenoneascizasciznoneunicodezunicodeznonebinary fixedbinary fixednonebinary variablebinary variableasciznoneascizascizascizascizascizunicodezunicodezascizbinary fixed(bad type combination)ascizbinary variable(bad type combination)unicodeznoneunicodezunicodezascizunicodezunicodezunicodezunicodezunicodezbinary fixed(bad type combination)unicodezbinary variable(bad type combination)binary fixednonebinarybinary fixedasciz(bad type combination)binary fixedunicodez(bad type combination)binary fixedbinary fixedbinarybinary fixedbinary variablebinarybinary variablenonebinarybinary variableasciz(bad type combination)binary variableunicodez(bad type combination)binary variablebinary fixedbinarybinary variablebinary variablebinary



Converting Concatenation Result

[0835] When the type of the concatenation result is different than the type of the data item used to store the result, CAT converts the result type to the item type. The binary (fixed or variable size) type result can be converted only to a binary type.



Limiting the Concatenation Result Size

[0836] When the result size is bigger than the value of res.max_sz property, CAT reduces the result size to be no greater than the specified value. The cut off point is always at the end of a data item element_the bytes that build a single element cannot be separated. Note that the size of the result can be different than the value of res.max_sz property.



ICS—Integer Constant Stamper

[0837]
FIG. 20 illustrates the boundary of part, Integer Constant Stamper (ICS)


[0838] 1. Functional Overview


[0839] ICS is used to stamp an integer constant value into an integer field in the events received through the in terminal. After modification, the events are forwarded through the out terminal.


[0840] The integer value can be stored into the bus in any byte order (specified by a property)—either the CPU's natural order or fixed MSB-first or LSB-first order. This feature can be used in processing network packets or other data with a fixed byte order that may or may not match the host CPU's natural byte order.


[0841] The integer field may be 1, 2, 3 or 4 bytes long; specified through the size property.


[0842] ICS may be parameterized to restore the modified field to its original value after forwarding the event through the out terminal.


[0843] 2. Boundary
402.1 TerminalsNameDirInterfaceNotesininI_DRAINThe events received through this terminal are modifiedaccording to ICS's properties and are forwarded through out.outoutI_DRAINEvents received from the in terminal are passed through thisterminal after modification.


[0844]

41











2.2 Properties









Name
Type
Notes





offset
uint32
Specifies the location of the integer field in the




incoming event that ICS should modify




(specified in bytes).




Default is 0.


offset_neg
uint32
Boolean. If TRUE, the offset is event size—the




value of the offset property; otherwise, the offset




is calculated from the beginning of the event.




The default is FALSE.


offset_neg
uint32
Boolean. If TRUE, the offset specified by the




offset property is calculated from the end of the




event; otherwise, the offset is calculated from the




beginning of the event.




The default is FALSE.


size
uint32
Specifies the size of the integer field in the




incoming event identified by offset (specified




in bytes). The size can be one of the following:




1, 2, 3, or 4.




Default is 4 (size of uint32)


byte_order
sint32
Specifies the byte order of the integer field




(identified by offset) in the incoming event.




Can be one of the following values:




Can be one of the following values:




0 Native machine format




1 MSB—Most-significant byte first




−1 LSB—Least-significant byte first




Default is 0 (Native machine format).


aligned
uint32
Specifies whether the data field defined by the




offset property is correctly aligned. Set this




property to FALSE if ICS is used to process net-




work packets or other similar cases when offset




does not specify a valid uint16 or uint32 field




in the data bus.




Default value: TRUE.


value
uint32
Constant value that ICS pastes into the specified




field in the incoming event.




Default is 0.


restore
uint32
Boolean. If TRUE, ICS restores the modified




event field to its original value after passing the




event through the out terminal.




Note: Care should be taken when restoring the




value after (post) passing the event through out.




The event may be destroyed by the recipient on




the out terminal. In this case, ICS displays




a warning on the debug console and returns




without restoring the original field value




Default is FALSE.










[0845] 3. Events and Notifications


[0846] ICS accepts any Dragon event on its input.


[0847] 3.1 Special Events, Frames, Commands or Verbs


[0848] None.


[0849] 3.2 Encapsulated Interaction


[0850] None.


[0851] 4. Specification


[0852] 4.1 Responsibilities


[0853] Update the specified field with the constant value identified by the value property of all incoming events, and forward the events through the out terminal.


[0854] Before modifying the field value, convert the value using the proper byte order (as specified by the byte_order property).


[0855] After forwarding the event through the out terminal, if the restore property is TRUE, restore the modified field to its original value.


[0856] 4.2 Theory of Operation


[0857] 4.2.1 State Machines


[0858] None.


[0859] 4.2.2 Main data structures


[0860] None.


[0861] 4.2.3 Mechanisms



Calculating the Data Offset

[0862] ICS uses the following formula to calculate the data offset:


offset_neg?ev_sz(bp)−offset: offset


[0863] 4.3 Use Cases


[0864] This use case uses the following event definition:
42typedef struct B_EV_SAMPLE{uint32 value;} B_EV_SAMPLE;


[0865] In this case, ICS is used to stamp the constant value 1234 in the value field of B_EV_SAMPLE.


[0866] ICS is parameterized as follows:


[0867] offset=offset of the value field of B_EV_SAMPLE (0 bytes)


[0868] size=size of the value field of B_EV_SAMPLE (4 bytes)


[0869] byte_order=−1 (LSB)


[0870] value=1234 (constant value)


[0871] ICS receives an event through the in terminal (B_Ev_SAMPLE).


[0872] ICS updates the value field to 1234.


[0873] ICS forwards the event through the out terminal.


[0874] The event now contains the constant value 1234 in the value field.



ITM—Integer Transmogrifier

[0875]
FIG. 21 illustrates the boundary of part, Integer Transmogrifier (ITM)


[0876] 1. Functional Overview


[0877] ITM is used to modify a single integer field in the events received through the in terminal. After modification, the events are forwarded through the out terminal. ITM cannot modify the Z-force event object fields (evt_id, evt_sz, evt_attr and evt_stat). Use ERC to modify these fields.


[0878] ITM modifies the integer value using three masks: bit-wise AND mask, bit-wise OR mask, and bit-wise XOR mask. These masks are specified through properties.


[0879] The integer value can be stored in the bus in any byte order (specified by a property)—either the CPU's natural order or fixed MSB-first or LSB-first order. This feature can be used in processing network packets or other data with a fixed byte order that may or may not match the host CPU's natural byte order.


[0880] The integer field may be 1, 2, 3 or 4 bytes long; specified through the size property.


[0881] ITM may be parameterized to restore the modified field to its original value after forwarding the event through the out terminal.


[0882] ITM can be invoked at interrupt time.


[0883] 2. Boundary
432.1 TerminalsNameDirInterfaceNotesininI_DRAINThe events received through this terminalare modified according to ITM's propertiesand are forwarded through out.outoutI_DRAINEvents received from the in terminal arepassed through this terminal after modification.


[0884]

44











2.2 Properties









Property




name
Type
Notes





offset
uint32
Specifies the location of the integer field in the




incoming event that ITM should modify.




(Specified in bytes).




Default is 0.


offset_neg
uint32
Boolean. If TRUE, the offset is event




size—the value of the offset property; otherwise,




the offset is calculated from the beginning of the




event.




The default is FALSE.


size
uint32
Specifies the size of the integer field in the




incoming event identified by offset (specified




in bytes).




The size can be one of the following: 1, 2, 3, or 4.




Default is 4 (size of uint32)


byte_order
sint32
Specifies the byte order of the integer field




(identified by offset) in the incoming event.




Can be one of the following values:




0 Native machine format




1 MSB—Most significant byte first




−1 LSB—Least-significant byte first




Default is 0 (Native machine format).


aligned
uint32
Specifies whether the data field defined by the




offset property is correctly aligned. Set this




property to FALSE if ITM is used to process




network packets or other similar cases when




offset does not specify a valid uint16 or




uint32 field in the data bus.




Default value: TRUE.


and_mask
uint32
Mask that is bit-wise ANDed with the field value.




Default is OxFFFFFFFF (no change).


or_mask
uint32
Mask that is bit-wise ORed with the field value.




Default is 0 (no change).


xor_mask
uint32
Mask that is bit-wise XORed with the field value.




Default is 0 (no change).


restore
uint32
Boolean. If TRUE, ITM restores the modified




event field to its original value after




passing the event through the out terminal.




Note: Care should be taken when restoring the




value after (post) passing the event through




out. The event may be destroyed by the




recipient on the out terminal. In this case,




ITM displays a warning on the debug console




and returns without restoring the original




field value. Default is FALSE.










[0885] 3. Events and Notifications


[0886] ITM accepts any event on its input.


[0887] 3.1 Special Events, Frames, Commands or Verbs


[0888] None.


[0889] 3.2 Encapsulated Interaction


[0890] None.


[0891] 4. Specification


[0892] 4.1 Responsibilities


[0893] Modify the integer field (identified by the offset and size properties) of all incoming events according to the and_mask, or_mask and xor_mask properties and forward the event through the out terminal.


[0894] Before modifying the field value, convert the value using the proper byte order (as specified by the byte_order property). After modifying the value and storing it back into the field, convert the value back to the original byte order.


[0895] Modify the field value in the following order: bit-wise AND, bit-wise OR, bit-wise XOR. Pass the event through the out terminal.


[0896] After forwarding the event through the out terminal, if the restore property is TRUE, restore the modified field to its original value.


[0897] 4.2 Theory of Operation


[0898] 4.2.1 State Machines


[0899] None.


[0900] 4.2.2 Main Data Structures


[0901] None.


[0902] 4.2.3 Mechanisms



Calculating the Data Offset

[0903] ITM uses the following formula to calculate the data offset:


offset_neg?ev_sz(bp)−offset: offset



Modifying a Field in the Incoming Event

[0904] Upon receiving an event from the in terminal, ITM modifies the integer field at the specified offset. The offset is calculated from the beginning or the end of the event depending on whether the offset value is positive or negative.


[0905] After the field value is retrieved from the event, if needed, ITM converts the value according to the specified byte order.


[0906] ITM then modifies the field value according to the and_mask, or_mask and xor_mask values. After the field is modified, ITM forwards the event through the out terminal.


[0907] Note that ITM fails the incoming event with ST_INVALID if the specified field overflows the event (field offset plus field size exceeds the size of the event).


[0908] 4.3 Use Cases


[0909] This use case uses the following event definition:
45typedef struct B_EV_SAMPLE{dword value;} B_EV_SAMPLE;


[0910] In this case, ITM is used to stamp the constant value 1234 in the value field of B_EV_SAMPLE.


[0911] ITM is parameterized as follows:


[0912] offset=offset of the value field of B_EV_SAMPLE (0 bytes)


[0913] size=size of the value field of B_EV_SAMPLE (4 bytes)


[0914] byte_order=−1 (LSB)


[0915] and_mask=0 (clear out previous value of field)


[0916] or_mask=1234 (constant value)


[0917] xor_mask=0 (no change)


[0918] ITM receives an event through the in terminal (B13 EV_SAMPLE).


[0919] ITM retrieves the DWORD value of the value field and applies the masks to it.


[0920] ITM forwards the event through the out terminal.


[0921] The event now contains the constant value 1234 in the value field.


[0922] 5. Notes


[0923] ITM works only with memory-aligned buses.


[0924] The byte_order property applies only to the field in the incoming bus identified by the offset property. All property values are expected to be specified in the native machine format.



SCS—Status Code Stamper

[0925]
FIG. 22 illustrates the boundary of part, Status Code Stamper (SCS)


[0926] 1. Functional Overview


[0927] SCS is a data manipulation part that retrieves the value of an integral data item and uses it as a return status for the passing operation.


[0928] SCS does not monitor or modify the content of the operations passing through it.


[0929] SCS uses its dat terminal for binding to the data item and retrieving the operation completion status from the specified data item.


[0930] The name of the data item is specified through a property. SCS does not submit any requests through its dat terminal if there is no data item specified (i.e., when the data item name is an empty string).


[0931] SCS can be used, in combination with other parts, to complete any operation by stamping the operation completion status in the operation bus.


[0932] NOTE: care should be taken when this part is used with an I_DRAIN connection that carries notification events (self-owned events), because the return status from such events indicates whether the event was accepted (destroyed) or rejected (not destroyed) by the recipient. If the status is recoded from or to ST_OK, this may cause an attempt to double free the event, or the event will not be freed at all.


[0933] 2. Boundary
462.1 TerminalsNameDirInterfaceNotesininI_POLYCalls received from this terminal are forwardedthrough out terminal.SCS completes the call with the value of theintegral data item specified through item.nameproperty.Note that a terminal with any contract can beconnected to this output. It is the user'sresponsibility to ensure that the contract usedon both sides of SCS is the same.This terminal is unguarded.outoutI_POLYCalls received through the in terminal areforwarded through this terminal.Note that a terminal with any contract can beconnected to this output. It is the user'sresponsibility to ensure that the contract used onboth sides of SCS is the same.datoutI_DATSCS invokes bind and get operations out thisterminal to retrieve the completion status of theoperation received on in terminal.


[0934]

47











2.2 Properties









Property




name
Type
Notes





item.name
asciz
Name of the predefined data item whose value is used




as a completion status of the operation received on in




terminal. The data item type must be




DAT_T_UINT32.




If the value of this property is an empty string, SCS




does not send any requests out through dat terminal.




The default value is “”










[0935] 2.3 Events and Notifications


[0936] None.


[0937] 2.4 Special Events, Frames, Commands or Verbs


[0938] None.


[0939] 2.5 Encapsulated Interaction


[0940] None.


[0941] 3. Specification


[0942] 3.1 Responsibilities


[0943] Forward all calls received on in terminal through out terminal without modifications.


[0944] If data item name is specified, bind to it and get the data item value and use it as a completion of the call received on in terminal.


[0945] If data item name is not specified, complete the incoming calls with the status returned on out terminal.


[0946] 3.2 Theory of Operation


[0947] 3.2.1 State Machine


[0948] None.


[0949] 3.2.2 Mechanisms


[0950] None.


[0951] 3.3 Use Cases


[0952] 3.3.1 Assembling a Status Recoder


[0953]
FIG. 23 illustrates an advantageous use of part, SCS


[0954] The figure illustrates how SCS can be used to assemble a status recoder.


[0955] The status returned on PART's out terminal is sent out through SCX's dat terminal as an I_DAT::set request. IFLT compares the operation completion status (stored in the operation bus) with the expected return status. If the status is the expected one, IFLT passes the operation to ICS, which recodes the stored completion status to the desired completion status. Finally the operation completion status (modified or unmodified) is stored in the fast data container (FDC). SCS retrieves the actual completion status from FDC and uses it as a completion status for the call received on PART's in terminal.


[0956] Note that PART is not protected from reentrancy.



SCX—Status Code Extractor

[0957]
FIG. 24 illustrates the boundary of part, Status Code Extractor (SCX)


[0958] 1. Functional Overview


[0959] SCX is a data manipulation part that extracts the completion status of the operations passing through its out terminal and stores it into an integral data item.


[0960] SCX does not monitor or modify the content of the operations passing through it.


[0961] SCX uses its dat terminal for binding to the data item and storing the operation completion status in the specified data item.


[0962] The name of the data item is specified through a property. SCX does not submit any requests through its dat terminal if there is no data item specified (i.e., when the data item name is an empty string).


[0963] SCX can be used, in combination with other parts, to stamp the operation completion status in the operation bus.


[0964] 2. Boundary
482.1 TerminalsNameDirInterfaceNotesininI_POLYCalls received from this terminal are forwardedthrough out terminal.Note that a terminal with any contract can beconnected to this output. It is the user'sresponsibility to ensure that the contract usedon both sides of SCX is the same.This terminal is unguarded.outoutI_POLYCalls received through the in terminal areforwarded through this terminal.When the call completes, SCX stores thecompletion status in a data item specifiedthrough properties.Note that a terminal with any contract canbe connected to this output. It is theuser's responsibility to ensure that thecontract used on both sides of SCX isthe same.datoutI_DATSCX invokes bind and set operations outthis terminal to store the completion status ofthe operation sent through out terminal.


[0965]

49











2.2 Properties









Property




name
Type
Notes





item.name
asciz
Name of the predefined data item whose value is to set




to the completion status of the operation forwarded




through out terminal. The data item type must be




DAT_T_UINT32. If the value of this property




is an empty string, SCX does not send any requests out




through dat terminal.




The default value is “”.










[0966] 3. Events and Notifications


[0967] None.


[0968] 3.1 Special Events, Frames, Commands or Verbs


[0969] None.


[0970] 3.2 Encapsulated Interaction


[0971] None.


[0972] 4. Specification


[0973] 4.1 Responsibilities


[0974] Forward all calls received on in terminal through out terminal without modifications.


[0975] Complete the incoming calls with the status returned on out terminal.


[0976] If data item name is specified, bind to it and set the data item value to the status returned on out terminal.


[0977] 4.2 Theory of Operation


[0978] 4.2.1 State Machines


[0979] None.


[0980] 4.2.2 Mechanisms


[0981] None.


[0982] 4.3 Use Cases


[0983] 4.3.1 Storing the Status in the Operation Bus


[0984]
FIG. 25 illustrates an advantageous use of part, SCX


[0985] The figure illustrates how SCX can be used to stamp the returned status in the event bus.


[0986] The event field stamper forwards to SCX the event received on its in terminal. SCX forwards it out through PART's out terminal. When the event completes, SCX extracts the status returned on its out terminal and stores it into the fast data container (FDC). EFS extracts the event completion status from the FDC and stamps it in the “stat” event field.


[0987] Note that PART cannot be used with self-owned events, because the recipient on the out terminal could destroy the event and the EFS will stamp the status value in an undefined place.



IDFC—Integral Data Field Comparator

[0988]
FIG. 26 illustrates the boundary of part, Integral Data Field Comparator (IDFC)


[0989] 1. Functional Overview


[0990] IDFC is a data manipulation part that splits the event flow received on its in terminal. The event flow split depends upon whether the data item value (contained in the incoming event) is greater, equal or less than a predefined data item1. 1Note that the ZP_IDFC compares only data item values of integral type e.g., ‘byte’, ‘boolean’, ‘signed integer’, and ‘unsigned integer’ types.


[0991] When the incoming data item is greater than the predefined one, the event is sent out through gt terminal. When the data item values are equal the event is sent out through eq terminal. When the incoming data item is less than the predefined data item, the event is sent out through lt terminal.


[0992] IDFC obtains the value of the predefined data item by submitting a request through dat terminal. If the request fails, IDFC completes the incoming event with the status returned on the dat terminal.


[0993] If the compared data items have different types, the value types are equalized before the item comparison.


[0994] IDFC modifies the incoming data item value, before the comparison, using a bit-wise AND mask and performing a SHIFT operation on the data. The mask and the number of bits to shift are specified as properties.


[0995] If needed, IDFC converts the incoming data item value according to the specified byte order (i.e., MSB first or LSB first).


[0996] The field into which the incoming data item is stored may be 1, 2, 3 or 4 bytes long. IDFC always converts the data items to 4 bytes, by adding the necessary padding, before executing the item comparison.


[0997] 2. Boundary
502.1 TerminalsNameDirInterfaceNotesininI_DRAINIDFC receives an event containing a data itemto be compared. Depending on the result of thecomparison, the event is forwarded through oneof the output terminals: gt, eq and it.This terminal is unguarded.gtoutI_DRAINEvents received from the in terminal are passed through this terminal when the value of theincoming data item is greater than the predefineddata item value.eqoutI_DRAINEvents received from the in terminalare passed through this terminal when the valueof the incoming data item is equal to thepredefined data item value.itoutI_DRAINEvents received from the in terminal are passedthrough this terminal when the value of theincoming data item is smaller than the predefineddata item value.datoutI_DATIDFC invokes bind and get operations out thisterminal to retrieve the data value to compare.


[0998]

51











2.2 Properties









Property




name
Type
Notes





item.name
asciz
Name of the predefined data item whose value is




to be compared with the value contained within




the incoming event.




If this property is empty, IDFC does not execute




any comparison; the incoming event is sent out




through the eq terminal.




The default value is “”.


item.type
uint32
Type of data item [DAT_T_XXX]. Valid values




for this property are: DAT_T_BYTE,




DAT_T_UINT32, DAT_T_SINT32,




and DAT_T_BOOLEAN




The default value is DAT_T_UINT32.


val.type
uint32
Type of data item [DAT_T_XXX]




placed in the incoming event. Valid values




for this property are: DAT_T_BYTE,




DAT_T_UINT32, DAT_T_SINT32,




and DAT_T_BOOLEAN




The default value is DAT_T_UINT32.


val.offs
uint32
Specifies the location in the incoming event that




IDFC should compare with the value of the data




item specified in item.name.




If this value is >=0, the offset is from the




beginning of the event. If this value is <0,




the offset is from the end of the event




(−1 specifies the last byte).




The default value is 0 (first field of the event).


val.offs_neg
uint32
Boolean. If TRUE, the offset is event size—




the value of the val.offs property; otherwise,




the offset is calculated from the beginning of




the event.




The default is FALSE.


val.sz
uint32
Specifies the size of the field in the incoming




event identified by val.offs (specified in bytes).




The size can be one of the following: 1, 2, 3, or 4.




The default value is 4 (size of DWORD)


val.order
sint32
Specifies the byte order of the value that is to




be stamped in the field (identified by val.offs)




in the incoming event.




Can be one of the following values:




0 Native machine format




1 MSB—Most-significant byte first (Motorola)




−1 LSB—Least-significant byte first (Intel)




The default value is 0 (Native machine format).


val.sgnext
uint32
Boolean. If TRUE, values smaller than 4 bytes




are sign extended before the value is operated




on using val.mask and val.shift properties.




The default value is FALSE.


val.mask
uint32
Mask that is bit-wise ANDed with the incoming




value before comparing it to the data item re-




turned on dat terminal.




The default value is OxFFFFFFFF (no change).


val.shift
sint32
Number of bits to shift the incoming value before




comparing it to the data item returned on dat




terminal. If the value is positive (greater than 0),




the value is shifted to the right. If the value is




negative (lesser than 0), the value is shifted




to the left.




The default value is 0 (no change)










[0999] 3. Events and Notifications


[1000] IDFC accepts any Dragon event through the in terminal. The event size must be enough to hold the specified data item.


[1001] 3.1 Special Events, Frames, Commands or Verbs


[1002] None.


[1003] 3.2 Encapsulated Interaction


[1004] None.


[1005] 4. Specification


[1006] 4.1 Responsibilities


[1007] Retrieve the data value by invoking the bind and get operations through the dat terminal.


[1008] Sign extend data values with size less than 4 bytes when the val.sgnext property is TRUE.


[1009] Modify the data value as specified by the val.mask and val.shift properties.


[1010] Compare the incoming data value with the value obtained through dat terminal.


[1011] Sent the event out through It, eq or gt terminals depending on the comparison result.


[1012] 5. Theory of Operation


[1013] 5.1 State Machine


[1014] None.


[1015] 5.2 Mechanisms


[1016] 5.2.1 Calculating the Data Offset


[1017] IDFC uses the following formula to calculate the data offset:


val.offs_neg?ev_sz(bp)−val.offs: val.offs


[1018] 5.2.2 Data Item Comparison


[1019] Before comparing the data item values, IDFC performs the following operations on the data value in the following order:


[1020] If necessary, IDFC converts the data value according to the specified byte order


[1021] If necessary, IDFC sign extends the data value if the val.sgnext property is TRUE.


[1022] ANDs the val .mask property with the data value.


[1023] Performs the SHIFT operation on the data value as specified by the val . shift property.


[1024] If necessary, IDFC extends the byte data value received on dat terminal. The byte value is always extended to a non-negative value.


[1025] Execute value comparison. Note that signed comparison is executed only when both, the incoming value and the value received on dat terminal are of values of signed type.


[1026] IDFC assumes that all values retrieved from the dat terminal were stored in the native machine format.



IDFS—Integral Data Field Stamper

[1027]
FIG. 27 illustrates the boundary of part, Integral Data Field Stamper (IDFS)


[1028] 1. Functional Overview


[1029] IDFS is a data manipulation part that retrieves a data item value (obtained through the dat terminal) and stamps the value into a field of the event received through the in terminal. After IDFS updates the event field with the retrieved data item value, the event is forwarded through the out terminal.


[1030] The location and size of the field in the incoming event into which the retrieved data item value is stamped is parameterized through properties. The location of the field in the incoming event may vary.


[1031] The data item value can be retrieved and stamped into the incoming event either before or after the event is forwarded through the out terminal.


[1032] Before stamping the retrieved data item value into the event, IDFS modifies the retrieved value using a bit-wise AND mask and performing a SHIFT operation on the value. The AND mask and the number of bits to shift the value by are specified through properties.


[1033] IDFS converts the retrieved data item value according to the specified byte order (i.e., MSB first or LSB first) after modifying the value as described above and before stamping the value into the event.


[1034] 2. Boundary
522.1 TerminalsNameDirInterfaceNotesininI_DRAINFor each event received through this terminal,IDFS stamps the value of the specified data iteminto the specified field of the event.This terminal is unguarded.outoutI_DRAINEvents received from the in terminal are passedthrough this terminal either before or after thespecified data item value has been stamped intothe event.datoutI_DATIDFS invokes the bind and get operations throughthis terminal to retrieve the data item value tostamp into the incoming event.


[1035]

53











2.2 PROPERTIES









Property Name
Type
Notes










The following properties identify the data item that


IDFS retrieves and stamps into the


event received through the in terminal:









item.name
asciz
Name of the data item whose value




is to be retrieved and




stamped into the incoming event.




If this property is empty (“”), IDFS




forwards the event




through the out terminal without




modification.




The default value is“”.


item.type
uint32
Type of the data item [DAT_T_XXX].




Valid values for this property are:




DAT_T_BYTE,




DAT—T_UINT32, DAT_T_SINT32,




and DAT_T_BOOLEAN




(integral types only).




The default value is DAT_T_UINT32.







The following properties identify the location


and size of the field in the incoming event which


IDFS updates with the retrieved data item value:









val.offs
uint32
Specifies the location of the




field in the incoming




event where IDFS should stamp the




retrieved data item




value (specified in bytes).




The default value is 0




(first field of the event).


val.offs_neg
uint32
Boolean. If TRUE, the offset is




event size—the value




of the val.offs property;




otherwise, the offset is




calculated from the beginning




of the event.




The default is FALSE.


val.offs_adj_name
asciz
Specifies the name of the data




item whose value is




added to the offset derived




from val.offs.




If the value of this property is “”,




the offset derived




from val.offs is not adjusted.




The data type of the specified data




item is expected to




be DAT_T_SINT32.




The default value is “”(not used).


val.sz
uint32
Specifies the size of the field




in the incoming event




identified by val.offs (specified in bytes).




The size can be one of the following:




1, 2, 3, or 4 bytes.




The default value is 4 (size of DWORD)







The following properties describe the


modifications that IDFS makes to the retrieved


data item value before stamping the


value into the incoming event:









val.order
sint32
Specifies the byte order of the value




that is to be stamped




into the field (identified by val.offs)




of the incoming event.




Can be one of the following values:




0 Native machine format




1 MSB—Most-significant byte




first (Motorola)




-1 LSB—Least-significant byte




first (Intel)




The default value is 0 (Native




machine format).


val.sgnext
uint32
Boolean. If TRUE, retrieved data




item values smaller




than 4 bytes are sign extended




before the value is




operated on using the val.mask and




val.shift properties.




The default value is FALSE




(no sign extension).


val.mask
uint32
Mask that is bit-wise ANDed with




the retrieved data




item value after sign extension and




before shifting.




The default value is 0xFFFFFFFF




(no change).


val.shift
sint32
Number of bits to shift the retrieved




data item value after




applying the AND mask.




If the value is >0, the value is




shifted to the right. If the




value is <0, the value is shifted to the left.




The default value is 0 (no shift)







The following properties describe when IDFS should


retrieve and stamp the data item


value into the incoming event:









get_first
uint32
Boolean. If TRUE, the data item value




is retrieved




before the event is passed through the




out terminal.




Otherwise, the data item value is retrieved




after the




event is passed through the out terminal.




The default value is TRUE.


stamp_pre
uint32
Boolean. If TRUE, the retrieved data




item value is




stamped into the event field




before the event is passed




though the out terminal; otherwise the data




item value




is stamped in the event field after




the event is passed




through the out terminal.




This property is valid only when




get_first is TRUE;




otherwise it is ignored.




The default value is TRUE.










[1036] 3. Events and Notifications


[1037] IDFS accepts any Dragon event through the in terminal.


[1038] 3.1 Special Events, Frames, Commands or Verbs


[1039] None.


[1040] 3.2 Encapsulated Interaction


[1041] None.


[1042] 4. Specification


[1043] 4.1 Responsibilities


[1044] Retrieve the specified data item value (by invoking the bind and get operations through the dat terminal) either before or after forwarding the event through out as specified by the get_first property.


[1045] Sign extend the retrieved data item values with size less than 4 bytes when the val.sgnext property is TRUE.


[1046] Modify the retrieved data item value as specified by the val.mask and val.shift properties.


[1047] Convert the data item value to the proper byte order.


[1048] Calculate the offset to the field in the incoming event where the value is stamped by retrieving the value of the val.off_adj_name data item and adding its value to the offset derived from val.offs.


[1049] Stamp the data item value into the calculated field of the incoming event either before or after forwarding the event through out as specified by the stamp_pre property.


[1050] 4.2 Theory of Operation


[1051] 4.3 State Machine


[1052] None.


[1053] 4.4 Mechanisms


[1054] 4.5 Calculating the Data Offset


[1055] IDFS uses the following formula to calculate the data offset:


val.offs neg?ev sz(bp)−val.offs: val.offs


[1056] 4.6 Modification of the Retrieved Data Item Values


[1057] Before stamping the retrieved data item value into the specified field of the incoming event, IDFS performs the following modifications to the retrieved value (in order):


[1058] IDFS sign extends the retrieved data item value if the val.sgnext property is TRUE and the size of the value is less then 4 bytes.


[1059] ANDs the val.mask property with the retrieved data item value


[1060] Performs a SHIFT operation on the retrieved data item value as specified by the val.shift property.


[1061] IDFS converts the retrieved data item value according to the specified byte order.


[1062] IDFS assumes that all of the data item values retrieved through the dat terminal are stored in the native machine format.


[1063] 5. Notes


[1064] IDFS's access through the dat terminal is non-atomic. Therefore, an assembly using this part may need to use external guarding.


[1065] IDFS zero-initializes the specified field of the incoming event before stamping the data item value into it.



IDFX—Integral Data Field Extractor

[1066]
FIG. 28 illustrates the boundary of part, Integral Data Field Extractor (IDFX)


[1067] 1. Functional Overview


[1068] IDFX is a data manipulation part that extracts an integral data value from the bus of events passing from in to out and stores it as a data item out the dat terminal. The location of the field whose value is extracted from the incoming event may vary.


[1069] IDFX modifies the data value before storing it using a bit-wise AND mask and by performing a SHIFT operation on the data. The mask and the number of bits to shift are specified as properties.


[1070] If needed, IDFX converts the data item value according to the specified byte order (i.e., MSB first or LSB first).


[1071] The field in the bus may be 1, 2, 3 or 4 bytes long; specified through the val . sz property.


[1072] 2. Boundary
542.1 TerminalsNameDirTypeNotesinInI_DRAINData is extracted from events receivedon this terminal asspecified by IDFX's properties beforeor after the event isforwarded to the out terminal.This terminal is unguarded.outOutI_DRAINEvents received from the in terminalare passed through thisterminal either before or after thedata has been extractedfrom the event.datOutI_DATIDFX invokes bind and set operationsout this terminal tostore the extracted data value.


[1073]

55











2.2 Properties









Property name
Type
Notes





item.name
ASCIZ
Name of data item into which




to store the extracted




value.




If this property is empty, IDFX




does not extract any




value.




The default is “”.


item.type
uint32
Type of data item [DAT_T_XXX].




Valid values for this




property are: DAT_T_BYTE,




DAT_T_UINT32,




DAT_T_SINT32,and




DAT_T_BOOLEAN




The default is DAT_T_UINT32.


val.offs
uint32
Specifies the location of the value




in the incoming




event that IDFX should extract.




(Specified in bytes).




Default is 0 (first field in event).


val.offs_neg
uint32
Boolean. If TRUE, the offset is




event size—the value




of the val.offs property; otherwise,




the offset is




calculated from the beginning of the event.




The default is FALSE.


val.offs_adj_name
asciz
Specifies the name of the data item




whose value is




added to the offset derived from val.offs.




If the value of this property is “”,




the offset derived




from val.offs is not adjusted.




The data type of the specified data




item is expected to be DAT_T_SINT32.




The default value is “”(not used).


val.sz
uint32
Specifies the size of the value field




in the incoming




event identified by val.offs




(specified in bytes).




The size can be one of the following:




1, 2, 3, or 4.




Default is 4 (size of DWORD)


val.order
sint32
Specifies the byte order of the field




(identified by




val.offs) in the incoming event.




Can be one of the following values:




0 Native machine format




1 MSB—Most-significant byte




first (Motorola)




-1 LSB—Least-significant byte




first (Intel)




Default is 0 (Native machine format).


val.sgnext
uint32
Boolean. If TRUE, values smaller




than 4 bytes are sign




extended before the value is




operated on using




val.mask and val.shift properties.




The default is FALSE.


val.mask
uint32
Mask that is bit-wise ANDed with




the field value




before being stored.




Default is 0xFFFFFFFF (no change).


val.shift
sint32
Number of bits to shift the field




value before being stored. If the




value is >0, the value is shifted




to the right. If the value is <0,




the value is shifted to the left.




Default is 0 (no change)


extract_first
uint32
Boolean. If TRUE, the data value is




extracted before




the event is passed to the out




terminal; otherwise the




data value is extracted after the




event is passed to the




out terminal.




Default is TRUE.


set_first
uint32
Boolean. If TRUE, the data value




is stored before the




event is passed to the out terminal.




This property is valid only when




extract_first is




TRUE; otherwise it is ignored.




Default is TRUE.










[1074] 3. Events and Notifications


[1075] IDFX accepts any Dragon event.


[1076] 3.1 Special Events, Frames, Commands or Verbs


[1077] None.


[1078] 3.2 Encapsulated Interaction


[1079] None.


[1080] 4. Specification


[1081] 4.1 Responsibilities


[1082] Calculate the offset to the field in the incoming event where the value is extracted by retrieving the value of the val.off_adj_name data item and adding its value to the offset derived from val.offs.


[1083] Extract the data field from bus using the calculated offset either before or after forwarding the event through out as specified by the extract_first property.


[1084] Sign extend data values with size less than 4 bytes when val.sgnext property is TRUE.


[1085] Modify the extracted value as specified by the val.mask and val.shift properties.


[1086] Store the data item value by invoking bind and set operations out the dat terminal as specified by the set_first property


[1087] 4.2 Theory of Operation


[1088] 4.2.1 State Machines


[1089] None.


[1090] 4.2.2 Mechanisms



Calculating the Data Offset

[1091] IDFX uses the following formula to calculate the data offset:


val.offs_neg?ev_sz(bp)−val.offs: val.offs



Modification of Data Values

[1092] Before storing a data value out the dat terminal, IDFX performs the following operations on the extracted data value:


[1093] If necessary, IDFX converts the data value according to the specified byte order


[1094] IDFX sign extends the data value if the val.sgnext property is TRUE


[1095] ANDs the val.mask property with the data value


[1096] Performs the SHIFT operation on the data value as specified by the val.shift property


[1097] IDFX stores all data values in native machine format.


[1098] UDFC—Universal Data Field Comparator


[1099]
FIG. 29 illustrates the boundary of part, Universal Data Field Comparator (UDFC)


[1100] 1. Functional Overview


[1101] UDFC is a data manipulation part that splits the event flow received on its in terminal. The event flow split depends upon whether the data item value is greater, equal or less than a predefined data item.


[1102] UDFC can compare integral data items (of type ‘byte’, ‘unsigned integer’, ‘signed integer’ and ‘Boolean’) and non-integral data items.


[1103] When the incoming data item is greater than the predefined one, the event is sent out through gt terminal. When the data item values are equal the event is sent out through eq terminal. When the incoming data item is less than the predefined data item, the event is sent out through lt terminal.


[1104] The length of the incoming value item can be a predefined constant, can be contained within the incoming event or obtained through a pointer, placed in the incoming event.


[1105] The incoming value item can be contained within the incoming event or obtained through a pointer, placed in the incoming event.


[1106] UDFC obtains the value of the predefined data item by submitting a request through dat request. If the request fails, UDFC completes the incoming event with the status returned on the dat terminal.


[1107] If the compared integral data items have different types, the value types are equalized before the item comparison. No conversion is applied if at least one of the data items is of non-integral type.


[1108] UDFC modifies the incoming integral item value, before the comparison, using a bit-wise AND mask and performing a SHIFT operation on the data. The mask and the number of bits to shift are specified as properties.


[1109] If needed, UDFC converts the incoming integral data item value according to the specified byte order (i.e., MSB first or LSB first).


[1110] 2. Boundary
562.1 TerminalsNameDirInterfaceNotesininI_DRAINUDFC receives an event containing adata item or adescription of a data item to becompared. Depending on theresult of the comparison, the eventis forwarded through one ofthe output terminals: gt, eq and lt.This terminal is unguarded.gtoutI_DRAINEvents received from the in terminalare passed through thisterminal when the value defined by theincoming data item isgreater than the predefined data item value.eqoutI_DRAINEvents received from the in terminalare passed through thisterminal when the value defined by theincoming data item isequal to the predefined data item value.When no item is specified (item.name is anempty string), allevents received on in terminal are passedthrough thisterminal.ltoutI_DRAINEvents received from the in terminal arepassed through thisterminal when the value defined by theincoming data item isslammer than the predefined data item value.datoutI_DATUDFC invokes bind and get operationsout this terminal toretrieve the data value to compare.


[1111]

57











2.2 Properties









Property name
Type
Notes





item.name
asciz
Name of the predefined data item whose




value is to be




compared with the value contained




within the incoming event.




If this property is empty, UDFC




does not execute any




comparison; the incoming event is




sent out through the eq terminal.




The default value is “”.


item.type
uint32
Type of data item




[DAT_T_XXX].




The default value is




DAT_T_UINT32.


var_sz
uint32
Boolean.




If TRUE, the value item has a




variable size specified




through len.xxx properties.




If FALSE, the value item has a




constant size specified




through val.sz property.




The default value is FALSE




(the value item size is a constant).


val.type
uint32
Type of data item [DAT_T_XXX]




placed in the incoming event.




The default value is DAT_T_UINT32.


val.by_ref
uint32
Boolean.




If TRUE, a reference pointer contained




within the event




identifies the value item. The offset of




the reference pointer




is specified by




val.ptr_offs property.




If FALSE, the value item is contained




within the event.




The offset of the value item is




specified by val.offs property.




The default value is FALSE




(the value item is contained




within the event).


val.ptr_offs2
uint32
When val.by_ref property




is TRUE, val.ptr_offs




specifies the location (in the




incoming event) of the pointer




to the value that UDFC should




compare with the value of




the data item specified in item.name.




The default value is 0 (first




field of the event).


val.offs
uint32
When val.by_ref property is




FALSE, val.offs specifies




the location in the incoming




event that UDFC should




compare with the value of the




data item specified in item.name.




The default value is 0




(first field of the event).


val.offs_neg
uint32
Boolean. If TRUE, the offset is




event size—the value of




the val.offs property; otherwise,




the offset is calculated




from the beginning of the event.




The default is FALSE.


val.sz
uint32
When var_sz property is




FALSE, val.sz specifies the size




of the field in the incoming event




identified by val.offs




(specified in bytes).




The size can be one of the following:




1, 2, 3, or 4.




The default value is 4 (size of DWORD)


val.order
sint32
Specifies the byte order of the




value that is to be stamped in




the field (identified by val.offs)




in the incoming event.




Can be one of the following values:




0 —Native machine format




1 —MSB—Most-significant byte




first (Motorola)




-1 —LSB—Least-significant byte




first (Intel)




The default value is 0




(Native machine format).


val.sgnext
uint32
Boolean.




If TRUE, integral values smaller




than 4 bytes are sign




extended before the value is




operated on using val.mask




and val.shift properties.




The default value is FALSE.


val.mask
uint32
Mask that is bit-wise ANDed with




the incoming integral




value before comparing it to the




data item returned on dat terminal.




The default value is 0xFFFFFFFF




(no change).


val.shift
sint32
Number of bits to shift the incoming




integral value before




comparing it to the data item returned




on dat terminal.




If the value is positive (greater than 0),




the value is shifted




to the right. If the value is negative




(lesser than 0), the




value is shifted to the left.




The default value is 0 (no change)


len.by_ref
uint32
Boolean.




Used only when var_sz




property is TRUE.




If TRUE, a reference pointer contained




within the event




identifies the length of the value




item. The offset of the




length pointer (in the event) is




specified by len.ptr_offs




property.




If FALSE, the value length is




contained within the event.




The offset of the value length is




specified by len.offs property.




The default value is FALSE (the




value item is contained




within the event).


len.ptr_offs3
uint32
When len.by_ref property is




TRUE, len.ptr_offs




specifies the location (in the incoming




event) of the pointer




to the value length.




The default value is 0 (first field




of the event).


len.offs
uint32
When len.by_ref property is




FALSE, len.offs specifies




the location (in the incoming event)




at which the value item




length is stored.




The default value is 0 (first




field of the event).


len.sz
uint32
Specifies the size of the field that




specifies the value length.




The length field is specified through




len.ptr_offs or




len.offs properties.




The size can be one of the following:




1, 2, 3, or 4.




The default value is 4 (size of DWORD)


len.order
sint32
Specifies the byte order of the




value length. The length field




is specified through




len.ptr_offs or len.offs properties.




Can be one of the following values:




0 —Native machine format




1 —MSB—Most-significant byte




first (Motorola)




-1 —LSB—Least-significant byte




first (Intel)




The default value is 0 (Native




machine format).


len.mask
uint32
Mask that is bit-wise ANDed with the




value




specified




through len.ptr_offs or len.offs




properties in order to




calculate the actual value length.




The default value is 0xFFFFFFFF (no




length change).


len.shift
sint32
Number of bits to shift the value specified




through




len.ptr_offs or len.offs properties




in order to calculate




the actual value length.




If the value is positive (greater than 0),




the value is shifted




to the right. If the value is negative




(lesser than 0), the




value is shifted to the left.




The default value is 0 (no change)








2
Note that the reference pointer is always stored in the processor native format. Its size may vary, depending on the system implementation.







3
Note that the reference pointer is always stored in the processor native format. Its size may vary, depending on the system implementation.









[1112] 3. Events and Notifications


[1113] UDFC accepts any Z-Force event through the in terminal. The event size must be enough to hold the specified data item.


[1114] 3.1 Special Events, Frames, Commands or Verbs


[1115] None.


[1116] 3.2 Encapsulated Interaction


[1117] None.


[1118] 4. Specification


[1119] 4.1 Responsibilities


[1120] Retrieve the data value by invoking the bind and get operations through the dat terminal.


[1121] Calculate the value length depending on len.xxx properties.


[1122] Sign extend integral data values with size less than 4 bytes when the val.sgnext property is TRUE.


[1123] Modify the integral data value as specified by the val.mask and val.shift properties.


[1124] Compare the incoming data value with the value obtained through dat terminal.


[1125] Sent the event out through lt, eq or gt terminals depending of the comparison result.


[1126] 4.2 Theory of Operation


[1127] 4.2.1 State Machines


[1128] None.


[1129] 4.2.2 Mechanisms



Calculating the Data Offset

[1130] UDFC uses the following formula to calculate the data offset:


val.offs_neg?ev_sz(bp)−val.offs: val.offs



Handling Incoming Events

[1131] When an event is received on in terminal, UDFC performs the following operations (in order):


[1132] If no item name is specified, the event is forwarded through eq terminal.


[1133] The checked version of the UDFC validates the incoming event against the property set.


[1134] Obtain a pointer to the data item value.


[1135] Calculate the value length.


[1136] Retrieve the data item through dat terminal.


[1137] Compare the values of the data items.


[1138] Forward the event out, depending on the result.



Integral Data Items Comparison

[1139] Before comparing the data item values, UDFC performs the following operations on the data value in the following order:


[1140] If necessary, UDFC converts the data value according to the specified byte order


[1141] If necessary, UDFC sign extends the data value if the val.sgnext property is TRUE.


[1142] ANDs the val.mask property with the data value.


[1143] Performs the SHIFT operation on the data value as specified by the val.shift property.


[1144] If necessary, UDFC extends the byte data value received on dat terminal. The byte value is always extended to a non-negative value.


[1145] Execute value comparison. Note that signed comparison is executed only when both the incoming value and the value received on dat terminal are of values of signed type.


[1146] UDFC assumes that all integral values retrieved from the dat terminal were stored in the native machine format.



UDFS—Universal Data Field Stamper

[1147]
FIG. 30 illustrates the boundary of part, Universal Data Field Stamper (UDFS)


[1148] 1. Functional Overview


[1149] UDFS is a data manipulation part that stamps any type of data item value into the bus of events passing from in to out. The data item can be stamped either before or after the event is forwarded through the out terminal.


[1150] For integral data types, UDFS modifies the data item value, before stamping it into the bus, using a bit-wise AND mask and performing a SHIFT operation on the data. The mask and the number of bits to shift are specified as properties. If needed, UDFS converts the data item value according to the specified byte order (i.e., MSB first or LSB first) before stamping the value into the bus.


[1151] The size of the storage for the data item value or the storage for the data item value length can be a predefined constant, can be contained within the incoming event or obtained through a pointer, placed in the incoming event.


[1152] If the data types of the data item and the event field (into which the data item value is stamped) are not compatible, UDFS fails the incoming event (UDFS does not provide any data type conversion except for integral types).


[1153] 2. Boundary
582.1 TerminalsNameDirInterfaceNotesininI_DRAINUDFS stamps the value of a dataitem into the bus of eventsreceived on this terminalbefore or after the event is forwardedto the out terminal.This terminal is unguarded.outoutI_DRAINEvents received from the in terminal arepassed through thisterminal either before or after the datavalue has been stampedinto the bus.datoutI_DATUDFS invokes the bind and get operationsthrough thisterminal to retrieve the datavalue to stamp.


[1154]

59











2.2 Properties









Property name
Type
Notes





item.name
asciz
Name of the data item whose value is




to be stamped into the event bus.




If this property is empty, UDFS does




not modify the event




bus.




The default value is “”.


item.type
uint32
Type of the data item




[DAT_T_XXX].




The default value is




DAT_T_UINT32.


stamp_pre
uint32
Boolean. If TRUE, the data item




value is stamped before the




event is passed to the out terminal;




otherwise the data value




is stamped after the event is passed




to the out terminal.




The default value is TRUE.


get_first
uint32
Boolean. If TRUE, the data item value




is retrieved before the




event is passed to the out terminal.




This property is valid only when




stamp_pre is FALSE;




otherwise it is ignored.




The default value is TRUE.


var_sz
uint32
Boolean.




If TRUE, the storage for the stamped




data item value has a




variable size specified through the




buf_sz.xxx properties.




If FALSE, the storage has a constant size




specified through val.sz property.




The default value is FALSE (the




storage size is constant).


val.type
uint32
Type of data item




[DAT_T_XXX] placed




in the incoming event.




The default value is




DAT_T_UINT32.


val.by_ref
uint32
Boolean.




If TRUE, a reference pointer contained




within the event




identifies the storage for the stamped




data item value. The




offset of the reference pointer is




specified by




val.ptr_offs property.




If FALSE, the storage is contained




within the event. The




offset of the value item is specified




by val.offs property.




The default value is FALSE (the storage




is contained within the event).


val.ptr_offs4
uint32
When the val.by_ref property




is TRUE, val.ptr_offs




specifies the location (in the




incoming event) of the pointer




to the storage that UDFS uses to store




the value of the data




item specified by item.name.




The default value is 0 (first field




of the event).


val.offs
uint32
When the val.by_ref




property is FALSE, val.offs




specifies the location in the




incoming event that UDFS uses




to store the value of the data item




specified in item.name.




The default value is 0 (first




field of the event).


val.offs_neg
uint32
Boolean. If TRUE, the offset is




event size—the value of




the val.offs property; otherwise,




the offset is calculated




from the beginning of the event.




The default is FALSE.


val.sz
uint32
When the var_sz property




is FALSE, val.sz specifies the




size of the field in the incoming




event identified by




val.offs (specified in bytes).




The default value is 4 (size of DWORD)


val.order
sint32
Specifies the byte order of the




value that is to be stamped in




the field (identified by val.offs)




in the incoming event.




Can be one of the following values:




0 —Native machine format




1 —MSB—Most-significant byte




first (Motorola)




-1 —LSB—Least-significant byte




first (Intel)




This property is valid for integral




data items only.




The default value is 0 (Native




machine format).


val.sgnext
uint32
Boolean.




If TRUE, integral values smaller




than 4 bytes are sign




extended before the data item value is




operated on using




val.mask and val.shift properties.




This property is valid for integral




data items only.




The default value is FALSE.


val.mask
uint32
Mask that is bit-wise ANDed




with the data item value




before it is stamped in the




incoming event.




This property is valid for integral




data items only.




The default value is 0xFFFFFFFF




(no change).


val.shift
sint32
Number of bits to shift the data




item value before it is




stamped in the incoming event.




If the value is positive (greater




than 0), the value is shifted




to the right. If the value is negative




(lesser than 0), the




value is shifted to the left.




This property is valid for integral




data items only.




The default value is 0 (no change)








4
Note that the reference pointer is always stored in the processor native format. Its size may vary, depending on the system implementation.









[1155]


[1156] The following properties are used to specify where to store the length of the stamped data item value in the incoming event. These properties are used only if the var_sz property is TRUE (variable size data values).
60Property nameTypeNoteslen.by_refuint32Boolean.If TRUE, a reference pointercontained within the incomingevent identifies the storage forthe length of the stampeddata item value. The offset of thelength pointer (in theevent) is specified by len.ptr offsproperty.If FALSE, the storage for the dataitem value length iscontained within the event. The offsetof the storage isspecified by the len.offs property.The default value is FALSE (the storageis contained within the event).len.ptr_offs5uint32When the len.by_ref propertyis TRUE, len.ptr_offsspecifies the location (in the incomingevent) of the pointerto where the stamped data item valuelength should be stored.The default value is 0 (firstfield of the event).len.offsuint32When the len.by_refproperty is FALSE, len.offsspecifies the location (in theincoming event) at which thedata item value length is stored.The default value is 0 (first fieldof the event).len.szuint32Specifies the size of the field used tostore the data itemvalue length. The length field isspecified through thelen.ptr_offs or len.offs properties.The size can be one of the following:1, 2, 3, or 4.The default value is 4 (size of DWORD)len.ordersint32Specifies the byte order of the dataitem value length. Thelength field is specified through thelen.ptr_offs orlen.offs properties.Can be one of the following values:0 —Native machine format1 —MSB—Most-significant bytefirst (Motorola)-1 —LSB—Least-significant bytefirst (Intel)The default value is 0 (Nativemachine format).len.maskuint32Mask that is bit-wise ANDed with thedata item valuelength before it is stored in theincoming event.The default value is 0xFFFFFFFF(no length change).len.shiftsint32Number of bits to shift the data itemvalue length before itis stored in the incoming event.If the value is positive (greaterthan 0), the value is shiftedto the right. If the value is negative(lesser than 0), thevalue is shifted to the left.The default value is 0 (no change)5 Note that the reference pointer is always stored in the processor native format. Its size may vary, depending on the system implementation.


[1157] The following properties are used to specify the size of the storage for the data item value in the incoming event. These properties are used only if the var_sz property is TRUE (variable size data values).
61Property nameTypeNotesbuf_sz.valuint32Specifies the size of the storagein the incoming eventthat is used to store the retrieveddata item value.When this property is zero, therest of the buf_szproperties are used to describethe size of the storage inthe incoming event.The default value is 0.buf_sz.ptr_offs6uint32When thebuf_sz.by_refproperty is TRUE,buf_sz.ptr_offsspecifies the location (in theincoming event) of the pointerto the storage size.The default value is 0 (firstfield of the event).buf_sz.offsuint32When the buf_sz.by_refproperty is FALSE,buf_sz.offs specifiesthe location (in the incomingevent) of the field that containsthe size of the storageused to store the data item value.The default value is 0 (firstfield of the event).buf_sz.szuint32Specifies the size of the fieldthat specifies the storagesize. The storage field is specifiedthroughbuf_sz.ptr_offsor buf_sz.offs properties.The size can be one of the following:1, 2, 3, or 4.The default value is 4 (size of DWORD)buf_sz.ordersint32Specifies the byte order of thestorage size field. Thestorage size field is specifiedthrough thebuf_sz.ptr_offsOr buf_sz.offs properties.Can be one of the following values:0 —Native machine format1 —MSB—Most-significant bytefirst (Motorola)-1 —LSB—Least-significant bytefirst (Intel)The default value is 0 (Native machineformat).buf_sz.maskuint32Mask that is bit-wise ANDed withthe value specifiedthrough the buf_sz.ptr_offsOr buf_sz.offsproperties in order to calculatethe actual storage size.The default value is 0xFFFFFFFF(no length change).buf_sz.shiftsint32Number of bits to shift the valuespecified through thebuf_sz.ptr_offs orbuf_sz.offs properties in orderto calculate the actual storage size.If the value is positive(greater than 0), the value isshifted to the right. If the valueis negative (lesser than0), the value is shifted to the left.The default value is 0 (no change)6 Note that the reference pointer is always stored in the processor native format. Its size may vary, depending on the system implementation.


[1158] 3. Events and Notifications


[1159] UDFS accepts any Dragon event through the in terminal. The event size must be large enough to store the specified data item value.


[1160] 3.1 Special Events, Frames, Commands or Verbs


[1161] None.


[1162] 3.2 Encapsulated Interaction


[1163] None.


[1164] 4. Specification


[1165] 4.1 Responsibilities


[1166] Retrieve the data item value by invoking the bind and get operations through the dat terminal.


[1167] Calculate the data item storage location and size depending on the var_sz, val.xxx and buf_sz.xxx properties.


[1168] Calculate where to store the data item length in the incoming event depending on the len.xxx properties.


[1169] Modify the data item value as specified by the val.mask and val.shift properties.


[1170] Sign extend data item values with size less than 4 bytes when the val.sgnext property is TRUE.


[1171] Stamp the data item value into the event bus either before or after forwarding the event through out as specified by the stamp_pre and get_first properties (zero initialize the storage buffer first before stamping the value into it).


[1172] If needed, stamp the length of the data item value into the event at the specified location (modify the length based on the len.xxx properties before updating the event).


[1173] 4.2 Theory of Operation


[1174] 4.2.1 State Machines


[1175] None.


[1176] 4.2.2 Mechanisms



Calculating the Data Offset

[1177] UDFS uses the following formula to calculate the data offset:


val.offs_neg?ev_sz(bp)−val.offs: val.offs



Handling Incoming Events

[1178] When an event is received through the in terminal, UDFS performs the following operations (in order):


[1179] If no data item name is specified, the event is forwarded through the out terminal and UDFS returns control back to the original caller.


[1180] Retrieve the data item value through the dat terminal.


[1181] Validate the incoming event against the property set (checked versions of UDFS only).


[1182] Obtain a pointer to the data item value storage and the data item value length storage in the incoming event.


[1183] Stamp the data item value into the event.


[1184] Store the data item value length in the event.


[1185] Forward the event through the out terminal.


[1186] Note that if UDFS is parameterized to stamp the data item value after the event has been forwarded through out, it will stamp the value only under the following conditions depending on the attributes of the incoming event:


[1187] If the event is self owned and the return status is not equal to ST_OK.


[1188] If the event is asynchronously completable and the return status is not equal to ST_PENDING.


[1189] If the event is not self owned or asynchronously completable (return status is not taken into account).


[1190] If the condition for the incoming event is not met, UDFS fails the event.



Modification of Data Item Values

[1191] Before stamping a data item value into the event bus, UDFS performs the following operations on the data value (in order):


[1192] ANDs the val.mask property with the data value.


[1193] Performs the SHIFT operation on the data value as specified by the val.shift property.


[1194] UDFS sign extends the data value if the val.sgnext property is TRUE.


[1195] UDFS converts the data value according to the specified byte order.


[1196] UDFS assumes that all values retrieved from the dat terminal are stored in the native machine format.



Modification of Value Lengths

[1197] UDFS performs the following operations on the value length before updating the incoming event (in order):


[1198] ANDs the len.mask property with the value.


[1199] Performs the SHIFT operation on the value as specified by the len.shift property.


[1200] UDFS converts the value to the native machine format.



Modification of Value Storage Sizes

[1201] UDFS performs the following operations on the value storage size read from the incoming event (in order):


[1202] UDFS converts the value to the native machine format.


[1203] ANDs the buf_sz.mask property with the value.


[1204] Performs the SHIFT operation on the value as specified by the buf_sz.shift property.



Data Type Conversion

[1205] Depending on the specified data types for the data item and the event field (where the data item value is stored), UDFS may need to convert one type to another. The following rules define how UDFS converts between different types:


[1206] If one type is non-integral and the other type is integral, UDFS fails the incoming event (no conversion possible).


[1207] If both types are non-integral, the types must be identical (if not UDFS fails the incoming event).


[1208] If both types are integral, UDFS converts between the two types. Integral types include DAT_T_BYTE,DAT_T_UINT32,DAT13 T_SINT32 and DAT_T_BOOLEAN.


[1209] 4.3 Use Cases


[1210] 4.3.1 Stamping Integral Values: Self-contained Storage, Constant Size


[1211] The following use case describes how to stamp an unsigned 32-bit integer into a field of an event (although any integral data type may be used). In this case, the event contains a 4-byte field used to store the data item value. The size of the field is fixed (4 bytes). Note that the data item value length does not need to be stored in the event for constant size values.


[1212] Below is a definition of the event bus used in this example:
62typedef struct B_EV_TESTtag{uint32 value; // storage for data item value} B_EV_TEST;


[1213] The steps below describe how to stamp an integer value into the B_EV_TEST event bus:


[1214] UDFS is created and parameterized with the following:


[1215] item.name=“my_uint32” (including terminating character)


[1216] item.type=DAT_T_UINT32


[1217] var_sz=FALSE (constant size)


[1218] val.type=DAT_T_UINT32


[1219] val.offs=0 (first field in B_EV_TEST bus)


[1220] val.sz=size of uint32 (4 bytes)


[1221] An EV_TEST event is received on UDFS's in terminal.


[1222] UDFS retrieves the “my_uint32” data item value through the dat terminal and copies the value into the value field of the EV_TEST event bus.


[1223] The event is forwarded through the out terminal.


[1224] Optionally, the data item value may be modified according to the val.order, val.sgnext, val.mask and val.shift properties. By default, UDFS does not modify the value before stamping it into the event bus.


[1225] 4.3.2 Stamping ASCII string values: self-contained storage, variable size


[1226] The following use case describes how to stamp an ASCII string into a field of an event. In this case, the event has a self-contained field used to store the retrieved string. The length of the string is variable and is stored in a special field in the event. Below is a definition of the event bus used in this example:
63typedef struct B_EV_TESTtag{char str [256]; // storage for the stringuint32 len ; // length of the string} B_EV_TEST;


[1227] The steps below describe how to stamp an ASCII string into the B_EV-TEST event bus:


[1228] UDFS is created and parameterized with the following:


[1229] item.name=“my_string” (including terminating character)


[1230] item.type=DAT_T_ASCIZ


[1231] var_sz=TRUE (variable size)


[1232] val.type=DAT_T_ASCIZ


[1233] val.offs=0 (first field in B_EV_TEST bus)


[1234] len.offs=offset of len field in B_EV_TEST bus (256 bytes)


[1235] len.sz=size of uint32 (4 bytes)


[1236] buf_sz.val=size of the str field (256 bytes)


[1237] An EV_TEST event is received on UDFS's in terminal.


[1238] UDFS retrieves the “my_string” data item value through the dat terminal and copies the value into the str field of the EV_TEST event bus.


[1239] UDFS stores the length of the retrieved data item value and stores it in the len field of the EV_TEST event bus.


[1240] The event is forwarded through the out terminal.


[1241] 4.3.3 Stamping ASCII string values: referenced storage, variable size


[1242] The following use case describes how to stamp an ASCII string into a field of an event. In this case, the event contains a reference to the buffer that contains the storage for the retrieved string. The length of the string is variable. The size and length for the string are stored in special fields in the event.


[1243] Below is a definition of the event bus used in this example:
64typedef struct B_EV_TESTtag{uint32 sz ; // size of the storage bufferchar *strp; // storage for the stringuint32 len ; // length of the string} B_EV_TEST;


[1244] The steps below describe how to stamp an ASCII string into the B_EV_TEST event bus:


[1245] UDFS is created and parameterized with the following:


[1246] item.name=“my_string” (including terminating character)


[1247] item.type=DAT_T_ASCIZ


[1248] var_sz=TRUE (variable size)


[1249] val.type=DAT_T_ASCIZ


[1250] val.by_ref=TRUE


[1251] val.ptr_offs=offset of strp field in B_EV_TEST bus (4 bytes)


[1252] len.offs=offset of len field in B_EV_TEST bus (256 bytes)


[1253] len.sz=size of uint32 (4 bytes)


[1254] buf_sz.val=0


[1255] buf_sz.offs=offset of sz field in B_EV_TEST bus (256 bytes)


[1256] buf_sz.sz=size of uint32 (4 bytes)


[1257] a An EV_TEST event is received on UDFS's in terminal (the sz field contains the size of the buffer pointed to by strp).


[1258] UDFS retrieves the “my string” data item value through the dat terminal and copies the value into the buffer pointed to by the strp field of the EV_TEST event bus.


[1259] UDFS stores the length of the retrieved data item value and stores it in the len field of the EV_TEST event bus.


[1260] The event is forwarded through the out terminal.


[1261] 5. Notes


[1262] UDFS's access through the dat terminal is non-atomic. Therefore, an assembly using this part may need to use external guarding.



UDFX—Universal Data Field Extractor

[1263]
FIG. 31 illustrates the boundary of part, Universal Data Field Extractor (UDFX)


[1264] 1. Functional Overview


[1265] UDFX is a data manipulation part that extracts data from the bus of events passing from in to out and updates the specified data item with the extracted value. The data can be extracted either before or after the event is forwarded through the out terminal.


[1266] For integral data types, UDFX modifies the extracted value before updating the specified data item. UDFX applies a bit-wise AND mask and performs a SHIFT operation on the value. The mask and the number of bits to shift are specified as properties. If needed, UDFX converts the value according to the specified byte order (i.e., MSB first or LSB first) before modifying the value and updating the data item.


[1267] The length of the value to extract from the event can be a predefined constant, contained within the incoming event or obtained through a pointer, placed in the incoming event.


[1268] If the data types of the extracted value and the data item are not compatible, UDFX fails the incoming event (UDFX does not provide any data type conversion except for integral types).


[1269] 2. Boundary
652.1 TerminalsNameDirInterfaceNotesininI_DRAINUDFX extracts the value fromthe bus of events received onthis terminal and updates thespecified data item.This terminal is unguarded.outoutI_DRAINEvents received from the interminal are passed through thisterminal either before or afterthe value has been extractedfrom the bus.datoutI_DATUDFX invokes the bind and setoperations through thisterminal to update the specified data item.


[1270]

66











2.2 Properties









Property name
Type
Notes





item.name
asciz
Name of the data item that is updated with the extracted




value from the incoming event bus.




If this property is empty, UDFX does not modify the event




bus or update the data item.




The default value is “”


item.type
uint32
Type of the data item [DAT_T_XXX].




The default value is DAT_T_UINT32.


set_first
uint32
Boolean. If TRUE, extract and update the data item value




before passing the event through the out terminal.




If FALSE, set the data item value after passing the event




through the out terminal. In this case, use the




extract_first property to control when the value is




actually extracted from the event.




The default value is TRUE.


extract_first
uint32
Boolean. If TRUE, extract the value from the incoming




event before passing the event through the out terminal;




otherwise the value is extracted after the event is passed




through the out terminal




This property is valid only when set_first is FALSE




otherwise it is ignored.




The default value is TRUE.


var_sz
uint32
Boolean.




If TRUE, the length of the value to extract from the incoming




event has a variable size specified through the len. xxx




properties.




If FALSE, the value has a constant size specified through




val.sz property.




The default value is FALSE (the length is constant).


val.type
uint32
Type of the value [DAT_T_XXX] in the incoming event.




The default value is DAT_T_UINT32.


val.by_ref
uint32
Boolean.




If TRUE, the value to extract from the event is identified by a




reference pointer contained within the event. The offset of




the reference pointer is specified by val.ptr_offs




property.




If FALSE, the value is contained within the event. The offset




of the value is specified by val.offs property.




The default value is FALSE (the value is contained within




the event).


val.ptr_offs7
uint32
When the val.by_ref property is TRUE, val.ptr_offs




specifies the location (in the incoming event) of the pointer




to the value that UDFX extracts from the event.




The default value is 0 (first field of the event).


val.offs
uint32
When the val.by_ref property is FALSE, val.offs




specifies the location in the incoming event that contains




the value that UDFX extracts from the event.




The default value is 0 (first field of the event).


val.offs_neg
uint32
Boolean. If TRU7E, the offset is event size - the value of




the val.offs property; otherwise, the offset is calculated




from the beginning of the event.




The default is FALSE.


val.sz
uint32
When the var_sz property is FALSE, val.sz specifies the




length of the value in the incoming event identified by




val.offs (specified in bytes).




The default value is 4 (size of DWORD)


val.order
sint32
Specifies the byte order of the value that is to be extracted




(identified by val.offs) from the incoming event.




Can be one of the following values:




0 -Native machine format




1 -MSB-Most-significant byte first (Motorola)




−1 -LSB-Least-significant byte first (Intel)




This property is valid for only integral values.




The default value is 0 (Native machine format).


val.sgnext
uint32
Boolean.




If TRUE, integral values smaller than 4 bytes are sign




extended before the extracted value is operated on using the




val.mask and val.shift properties.




This property is valid for only integral values.




The default value is FALSE.


val.mask
uint32
Mask that is bit-wise ANDed with the extracted value




before updating the specified data item.




This property is valid for only integral values.




The default value is 0×FFFFFFFF (no change).


val.shifts
int32
Number of bits to shift the extracted value before updating




the specified data item.




If the value is positive (greater than 0), the value is shifted




to the right. If the value is negative (lesser than 0), the




value is shifted to the left.




This property is valid for only integral values.




The default value is 0 (no change)








7
Note that the reference pointer is always stored in the processor native format. Its size may vary, depending on the system implementation.









[1271] The following properties are used to specify where the value length is stored in the incoming event. These properties are used only if the var_sz property is TRUE (variable size data values).
67Property nameTypeNoteslen.by_refuint32Boolean.If TRUE, a reference pointer contained within the eventidentifies the storage for the length of the value to extract.The offset of the length pointer (in the event) is specified bylen.ptr_offs property.If FALSE, the storage for the value length is containedwithin the event. The offset of the storage is specified bythe len.offs property.The default value is FALSE (the storage is contained withinthe event).len.ptr_offs8uint32When the len.by_ref property is TRUE, len.ptr_offsspecifies the location (in the incoming event) of the pointerto where the value length is stored.The default value is 0 (first field of the event).len.offsuint32When the len.by_ref property is FALSE, len.offsspecifies the location (in the incoming event) at which thevalue length is stored.The default value is 0 (first field of the event).len.szuint32Specifies the size of the field used to store the value length.The length field is specified through the len.ptr_off s orlen.offs properties.The size can be one of the following: 1, 2, 3, or 4.The default value is 4 (size of DWORD)len.ordersint32Specifies the byte order of the value length. The length fieldis specified through the len.ptr_offs or len.offsproperties.Can be one of the following values:0 -Native machine format1 -MSB Most-significant byte first (Motorola)−1 LSB-Least- significant byte first (Intel)The default value is 0 (Native machine format).len.maskuint32Mask that is bit-wise ANDed with the length value.The default value is 0×FFFFFFFF (no length change).len.shiftsint32Number of bits to shift the value length.If the value is positive (greater than 0), the value is shiftedto the fight. If the value is negative (lesser than 0), thevalue is shifted to the left.The default value is 0 (no change)8Note that the reference pointer is always stored in the processor native format. Its size may vary, depending on the system implementation.


[1272] 3. Events and Notifications


[1273] UDFX accepts any Dragon event through the in terminal. The event size must be large enough to store the value that UDFX extracts from the event.


[1274] 3.1 Special Events, Frames, Commands or Verbs


[1275] None.


[1276] 3.2 Encapsulated Interactions


[1277] None.


[1278] 4. Specification


[1279] 4.1 Responsibilities


[1280] Calculate the value length based on the val.sz\1en.xxx properties.


[1281] Extract the value from the incoming event based on the specified properties.


[1282] Convert the extracted value (integral values only) and value length from the specified byte order to the native machine byte order.


[1283] Modify the extracted data value (integral values only) and value length based on the specified properties.


[1284] Sign extend integral data values with sizes less than 4 bytes.


[1285] Update the specified data item with the modified extracted value by invoking the bind and set operations through the dat terminal.


[1286] 4.2 Theory of Operation


[1287] 4.2.1 State Machine


[1288] None.


[1289] 4.2.2 Mechanisms



Calculating the Data Offset

[1290] UDFX uses the following formula to calculate the data offset:


val.offs_neg?ev_sz(bp)−val.offs:val.offs



Handling Incoming Events

[1291] When an event is received through the in terminal, UDFX performs the following operations (in order):


[1292] If no data item name is specified, the event is forwarded through the out terminal. UDFX returns control back to the original caller.


[1293] Validate the incoming event against the property set (checked versions of UDFX only).


[1294] Obtain a pointer to the value and length storage in the incoming event.


[1295] Extract the value from the event and modify the value according to the parameterzation.


[1296] Update the data item value with the modified value.


[1297] Forward the event through the out terminal.


[1298] Note that if UDFX is parameterized to extract the value after the event has been forwarded through out, it will extract the value and update the data item only under the following conditions depending on the attributes of the incoming event:


[1299] If the event is self owned and the return status is not equal to ST_OK.


[1300] If the event is asynchronously completable and the return status is not equal to ST_PENDING.


[1301] If the event is not self owned or asynchronously completable (return status is not taken into account).


[1302] If the condition for the incoming event is not met, UDFX fails the event.



Modification of Extracted Values

[1303] Before updating the data item value, UDFX performs the following operations on the extracted value (in order):


[1304] UDFX converts the value to the native machine format.


[1305] ANDs the val. mask property with the value.


[1306] Performs the SHIFT operation on the value as specified by the val.shift property.


[1307] UDFX sign extends the value if the val.sgnext property is TRUE.



Modification of value lengths

[1308] UDFX performs the following operations on the value length read from the incoming event (in order):


[1309] UDFX converts the value to the native machine format.


[1310] ANDs the len.mask property with the value.


[1311] Performs the SHIFT operation on the value as specified by the len. shift property.


[1312] 4.3 Use Cases


[1313] 4.3.1 Extracting Integral Values: Self-contained Storage, Constant Size


[1314] The following use case describes how to extract an unsigned 32-bit integer from a field of an event (although any integral data type may be used). In this case, the event contains a 4-byte field used to store the value. The length of the value is fixed (4 bytes). Note that the value length does not need to be stored in the event for constant size values.


[1315] Below is a definition of the event bus used in this example:
68typedef struct B_EV_TESTtag{uint32 value; // storage for value} B_EV_TEST;


[1316] The steps below describe how to extract an integer value from the B_EV_TEST event bus and update the specified data item:


[1317] UDFX is created and parameterized with the following:


[1318] 1. item.name=“my_uint32” (including terminating character)


[1319] 2. item.type=DAT_T_UINT32


[1320] 3. var_sz=FALSE (constant size)


[1321] 4. val.type=DAT_T_UINT32


[1322] 5. val.offs=0(first field in B_EV_TEST bus)


[1323] 6. val. sz=size of uint32 (4 bytes)


[1324] An EV_TEST event is received on UDFX's in terminal.


[1325] UDFX extracts the value from the value field of the event and invokes the bind and set operations through the dat output in order to update the specified data item.


[1326] The event is forwarded through the out terminal.


[1327] Optionally, the extracted value may be modified according to the val. order, val.sgnext,val.mask and val.shift properties. By default, UDFX does not modify the value before updating the data item.


[1328] 4.3.2 Extracting ASCII String Values: Self-contained Storage, Variable Size


[1329] The following use case describes how to extract an ASCII string from a field of an event. In this case, the event has a self-contained field used to store the string. The length of the string is variable and is stored in a special field in the event.


[1330] Below is a definition of the event bus used in this example:
69typedef struct B_EV_TESTtag{char str [256]; // storage for the stringuint32 len ; // length of the string} B_EV_TEST;


[1331] The steps below describe how to extract an ASCII string from the B_EV_TEST event bus and update the specified data item:


[1332] UDFX is created and parameterized with the following:


[1333] 1. item. name=“my_string” (including terminating character)


[1334] 2. item.type=DAT_T_ASCIZ


[1335] 3. var_sz=TRUE (variable size)


[1336] 4. val.type=DAT_T_ASCIZ


[1337] 5. val.offs=0(first field in B_EV_TEST bus)


[1338] 6. len.offs=offset of len field in B_EV_TEST bus (256 bytes)


[1339] 7. len. sz=size of uint32 (4 bytes)


[1340] An EV_TEST event is received on UDFX's in terminal.


[1341] UDFX extracts the string from the str field of the event and invokes the bind and set operations through the dat output in order to update the specified data item. The length of the string is retrieved from the len field in the event.


[1342] The event is forwarded through the out terminal.


[1343] 4.3.3 Extracting ASCII String Values: Referenced Storage, Variable Size


[1344] The following use case describes how to extract an ASCII string from a field of an event. In this case, the event contains a reference to the buffer that contains the string. The length of the string is variable and is stored in a special field in the event.


[1345] Below is a definition of the event bus used in this example:
70typedef struct B_EV_TESTtag{char *strp; // storage for the stringuint32 len ; // length of the string} B_EV_TEST;


[1346] The steps below describe how to extract an ASCII string from the B_EV_TEST event bus and update the specified data item:


[1347] UDFX is created and parameterized with the following:


[1348] 1. item.name=“my_string” (including terminating character)


[1349] 2. item.type=DAT_T_ASCIZ


[1350] 3. var_sz=TRUE (variable size)


[1351] 4. val.type=DAT_T_ASCIZ


[1352] 5. val.by_ref=TRUE


[1353] 6. val.ptr_offs=offset of strp field in B_EV_TEST bus (0 bytes)


[1354] 7. len.offs=offset of len field in B_EV_TEST bus (256 bytes)


[1355] 8. len.sz=size of uint32 (4 bytes)


[1356] An EV_TEST event is received on UDFX's in terminal.


[1357] UDFX extracts the string from the strp field of the event and invokes the bind and set operations through the dat output in order to update the specified data item. The length of the string is retrieved from the len field in the event.


[1358] The event is forwarded through the out terminal.


[1359] 5. Notes


[1360] UDFX's access through the dat terminal is non-atomic. Therefore, an assembly using this part may need to use external guarding.



DPC—I_DAT to I_PROP Converter

[1361]
FIG. 32 illustrates the boundary of part, I_DAT to I_PROP Converter (DPC)


[1362] 1. Functional Overview


[1363] DPC is an adapter that converts incoming I_DAT operation requests to I_PROP operation requests for a specific set of data items. The set of data items supported by DPC is specified via properties, as are the property names and types for each data item. DPC provides the ability for data manipulation parts to be connected to parts that implement an I_PROP interface such as property exposers and containers.


[1364] DPC, when connected to a property exposer or array, allows data values to be set as properties on other parts. Property values that were set on those parts through Parameterization or other means are made available to other data manipulation parts.


[1365] 2. Boundary
712.1 TerminalsNameDirTypeNotesinInI_DATI_DAT requests are received on this terminal. Requests notprocessed by DPC are converted into I_PROP requests and sentout the out terminal.outOutI_PROPConverted I_DAT operations are sent out this terminal.


[1366]

72











2.2 Properties









Property name
Type
Notes





item [0 . . .
asciz
Specifies the name of a data item supported by DPC.


15].name

The default value is “”.


prop [0 . . .
asciz
Specifies the property name to be used in the I_PROP


15].name

request for the corresponding data item.




If this property is empty, the value of item [n]. name is




used.




The default value is “”


item [0 . . .
uint32
Specifies the data type of the data item specified by


15].type

item [n].name [DAT_T_XXX].




The default is DAT_T_NONE.


prop [0 . . .
uint32
Specifies the property type of the property specified by


15].type

prop [n].name [ZPRP_T_XXX].




DPC does not verify the validity of this property compared




to its item [n].type counterpart.




The default is ZPRP_T_NONE.


base
uint32
Specifies the item handle base from which data item




handles are calculated.




This property may not have a value of 0.




The default value is 1.










[1367] 3. Events and Notifications


[1368] None.


[1369] 3.1 Special Events, Frames, Commands or Verbs


[1370] None.


[1371] 3.2 Encapsulated Interactions


[1372] None.


[1373] 4. Specification


[1374] 41 Responsibilities


[1375] Process I_DAT.bind and I_DAT.get_info requests.


[1376] Convert all other incoming data item requests to property requests and forward out the out terminal.


[1377] 4.2 Theory of Operation


[1378] 4.2.1 State Machine


[1379] None.


[1380] 4.2.2 Mechanisms



Calculating Data Item Handles

[1381] The handle for a specific data item is calculated by adding the value of the base property to the index of the data item property.


[1382] The opposite holds true when DPC resolves the index of a data item based on a handle (i.e., index=handle=base).



Converting I_DAT.set Requests

[1383] When DPC is invoked on one of its I_DAT. set operation, it performs the following operations:


[1384] Resolve the data item index from the handle.


[1385] Verify data type


[1386] Initialize a B_A_PROP bus in the following manner


[1387] namep→prop [index] name or item [index].name if empty.


[1388] type→prop [index].type


[1389] bufp→address of B_DAT.val if integral type or B_DAT.p


[1390] If the data type is an integral type, DPC sets val_len to the size of B_DAT.val. If B_DAT. sz is 0 and the data item is a string, DPC sets val_len to the string length of the value plus the size of the null-terminating zero. Otherwise, DPC initializes val_len to B_DAT.sz.


[1391] DPC forwards the operation out its out terminal and returns the status from the call.



Converting I_DAT.get requests

[1392] When DPC is invoked on one of its I_DAT. get operation, it performs the following operations:


[1393] Resolve the data item index from the handle.


[1394] Verify data type


[1395] Initialize a B_A_PROP bus in the following manner


[1396] namep→prop [index].name or item [index] .name if empty.


[1397] type→prop [index].type


[1398] bufp→address of B_DAT.val if integral type or B_DAT.p


[1399] If the data type is an integral type, DPC initializes buf_sz to size of B_DAT.val. Otherwise, DPC initializes buf_sz to B_DAT.sz. DPC forwards the operation to its out terminal. If the operation is successful DPC stores the value of B_A_PROP. val_len into B_DAT. sz. DPC returns the status from the call.


[1400] 4.3 Use Cases


[1401] 4.3.1 Use of DPC with Property Exposer


[1402]
FIG. 33 illustrates an advantageous use of part DPC with Property Exposer (PEX)


[1403] The function of the PART1 assembly is to extract two fields from the event bus passing through it and exposes those fields as properties on its boundary.


[1404] The two IDFS parts each extract a field from the event bus passing through them and generate I_DAT.set requests containing the extracted value. DPC receives the requests and converts them to I_PROP.set requests, which are processed by PEX and results in the properties being set on the PART1 boundary.


[1405] 4.3.2 Use of DPC with cascaded Fast Data Containers


[1406]
FIG. 34 illustrates an advantageous use of part DPC at end of cascaded Fast Data Containers (FDC)


[1407] The figure illustrates how DPC can be used at the end of a cascaded fast data container (FDC) chain. PART2 represents a data container that provides fast data storage for a set of data items using the FDC parts and exposes another set of properties on its part boundary using the DPC and PEX parts.


[1408] If it is desired to have PART2 expose all of the data values as properties on its boundary, then the FDC parts can be removed, leaving only DPC and PEX.



SYS—Hardware Access


SYSIRQ—System Interrupt Service Provider

[1409]
FIG. 35 illustrates the boundary of part, SYSIRQ


[1410] 1. Functional Overview


[1411] SYSIRQ is an event source. It implements the basic “interrupt source” service for the standard SYS_IRQ part.


[1412] SYSIRQ is the instance name of a registered “singleton” part, it is included in assemblies “by reference”, using the part_extern( ) directive instead of the part( ) directive and does not take any properties. Other than that, it behaves as if it were a separate part instance in each assembly it is included in; i.e., in each such assembly instance “sees” its own “virtual” interrupt through the ‘irq’ terminal of SYSIRQ. This mechanism is used so that SYSIRQ can manage the interrupt vector table and the interrupt acknowledge mechanism and allow these resources to be shared among multiple clients connected to SYSIRQ.


[1413] Since SYSIRQ is accessed using the part_extern( ) directive, the actual part instance to which the name “SYSIRQ” refers must be created before any assembly that includes SYSIRQ is created. The SYSIRQ instance is created by the SYS_IRQ_SRV part. SYS_IRQ_SRV should be created and enabled before any parts that refer to SYSIRQ are created. As in Dragon all parts in a multi-level assembly are created at the same time, the only way to achieve this is to use a structure that has a “static” outer scope and a “dynamic” inner scope, which is created after the “static” scope is already in operation. See the Typical Usage section below for a working example.


[1414] The ‘tmr’ terminal can be called in interrupt context and in most cases it will call back its clients in interrupt context. The actual conditions under which the part invokes the ‘tmr’ terminal depends on the embedded ‘time base’, which is usually the system's interval timer.


[1415] The ‘irq’ input may not be invoked at interrupt time. The part will call its clients in interrupt time.


[1416] 2. Boundary
732.1 Terminals (SYSIRQ)NameDirInterfaceNotesirqi/I_IRQInterrupt control terminal. This is a multiple-cardinalityoterminal. Each connection to this terminal is associated withone “interrupt connection” object. The input side of eachconnection is used to attach and detach the “interruptconnection” object to a hardware interrupt line. SYSIRQ callsthe output when the hardware interrupt occurs. If there aremultiple “connection” objects associated with the sameinterrupt, SYSIRQ executes a call for each of them.The input may not be called at interrupt time, in particular itshould not be called from within the context of an outgoingcall coming from this same terminal.This terminal can be connected only after the part has beenactivated. SYSIRQ can only be used by including it “byreference” in another assembly, which is NOT created at thetime when SYSIRQ is created. In practice this means that theinstances of SYS_IRQ or other parts that use SYSIRQ shouldbe inside an assembly that is created by the part array (ARR -see the XDL Language Reference or a similar part that candynamically create and destroy parts.


[1417]

74











2.2 Terminals (SYS_IRQ_SRV)










Name
Dir
Interface
Notes





Lfc
i/
I_DRAIN
Life-cycle control terminal. This terminal is used to provide



o

initialization/cleanup events to the SYSTMR_SRV part. An





EV_REQ_ENABLE request should be sent to this terminal





before any assembly that contains SYSIRQ can be used.





EV_REQ_DISABLE should be sent to this terminal before





destroying SYS_IRQ_SRV.





SYS_IRQ_SRV completes the EV_REQ_ENABLE/





DISABLE requests synchronously. The output direction of





the ‘lfc’ terminal is not used.










[1418] 2.3 Properties


[1419] None.


[1420] 3. Events and Notifications


[1421] None.


[1422] 4. Environmental Dependencies


[1423] 4.1 Encapsulated Interactions


[1424] SYSIRQ modifies the interrupt vector table, either directly or using OS services. SYSIRQ uses direct hardware access and/or OS services to acknowledge the hardware interrupt to the hardware and to the OS (as needed).


[1425] SYSIRQ uses direct hardware access and/or OS service to enable and disable specific hardware interrupts.


[1426] SYSIRQ may disable the CPU interrupts for short periods of time to guard access to the system hardware and to its own structures. Unless required by the OS, SYSIRQ will not disable the CPU interrupts when invoking the ‘irq’ terminal. The interrupt handler parts connected to this terminal should not make any assumptions about the state of the CPU interrupt mask.


[1427] 4.2 Other Environmental Dependencies


[1428] None


[1429] 5. Specification


[1430] 5.1 Responsibilities


[1431] Implement an infinite-cardinality terminal; create an ‘interrupt connection’ object for each connection to the terminal, thus making the part appear as an independent instance from the viewpoint of any client connected to it.


[1432] Implement ‘connect’ and ‘disconnect’ operations on the ‘irq’ terminal. The ‘connect’ operation connects the “interrupt connection” object to a hardware interrupt and makes it active, the ‘disconnect’ operation makes the object inactive.


[1433] Accept hardware interrupts and call the ‘irq’ terminal for each “interrupt connection” object associated with the hardware interrupt that occurred.


[1434] Use low-overhead and interrupt-friendly structures to maintain the list of active “interrupt connection” objects.


[1435] 5.2 External States


[1436] Each “interrupt connection” object created by SYSIRQ has state that is independent of the state of other objects. An “interrupt connection” object can be in one of the following states:


[1437] Disconnected—this is the initial state of a new object created when a connection is made to the ‘irq’ terminal.


[1438] Connected—object is active and will generate a call to the ‘irq’ terminal wherein the associated hardware interrupt occurs.


[1439] 5.3 Use Cases


[1440] None.


[1441] 6. Typical Usage


[1442] This part is intended primarily as the main building block for implementing the SYS_IRQ part. See the SYS_IRQ implementation design.


[1443] 6.1 Document References


[1444] None.


[1445] 6.2 Unresolved Issues


[1446] None.



SYS—System Configuration


SYS_EVPRM—Event Pool Parameterizer

[1447]
FIG. 36 illustrates the boundary of part, SYS_EVPRM


[1448] 1.1 Functional Overview


[1449] The event pool parameterizer requests that the system pre-allocate a specified number of buffers in the event pool so that they are available for creating events at interrupt time. The buffer sizes and the number of buffers for each size are specified as properties. Multiple instances of this part can be used and their effect is cumulative.


[1450] Typically, SYS_EVPRM should be placed in the outermost assembly of a system. Since the pre-allocation is cumulative and cannot be undone, SYS_EVPRM should never be used in an assembly that is created and destroyed dynamically as part of the system's operation.


[1451] 1.2 Boundary


[1452] 1.2.1 Terminals


[1453] None.


[1454] 1.2.2 Properties
75Property nameTypeNotessz1, sz2, sz3, sz4uint32Event payload sizes. Any of these properties that isset to a non-O value specifies an event payload sizethat is expected to be used at interrupt time. Thecorresponding nx property specifies the number ofevents of the specified size that are expected to beallocated at the same time.See the usage note and the typical usage examplesbelow.Default value: 0n1, n2, n3, n4uint32Number of buffers to pre-allocate. The nx propertieshave effect only if the corresponding S zx propertyis set to a non-zero value.Default value: 1attruint32Attributes of the events to be pre-allocated. Only theattributes related to the event buffer allocation aremeaningful (ZEVT_A_SHARED andZEVT_A_SAFE).The value of this property affects all buffers that arepre-allocated by the part, as specified by the S zxand nx properties. Note that if pre-allocation isneeded for different types of allocation (e.g. both forshared and for normal memory), separate instancesof SYS_EVPRM have to be used for each type.Default value: 0


[1455] 1.2.3 Events and Notifications


[1456] None


[1457] 1.3 Environmental Dependencies


[1458] 1.3.1 Encapsulated Interactions


[1459] This part re-configures the event manager upon activation. Note that destroying the part does not reverse the changes made.


[1460] 1.3.2 Other Environmental Dependencies


[1461] None.


[1462] 1.3.3 Usage Note


[1463] The event manager maintains a set of buffer pools for allocating event buffers. Each pool contains buffers of a fixed size. Whenever a new event is needed, the event manager picks a buffer from the pool with the smallest buffer size that is greater or equal to the requested size, which means that events of different sizes may be allocated from the same pool. This should be taken into account when configuring the event manager with the help of SYS_EVPRM.


[1464] In the case when it is known in advance what event sizes will be used, one or more instances of SYS_EVPRM should be parameterized with all of these sizes and the corresponding number of events for each size.


[1465] In the case when it is not known in advance what the event sizes would be, some heuristics need to be applied. The following rules always apply:


[1466] The event manager will not be able to allocate an event at interrupt time if there is no pre-allocated pool for the given event size. Always pre-allocate at least one event of the maximum size that is expected to be needed at interrupt time.


[1467] If pre-allocation is specified for sizes X and Y (X<Y), all requests to create an event of size less than or equal to Y, but greater than X will be satisfied from the pool reserved for size Y.


[1468] By default, the event manager pre-allocates at least 100 buffers for events of sizes 0 to 32 bytes. To pre-allocate additional buffers for small-size events, extend this pool by setting one of the szx properties to 32 and set the corresponding nx to the desired number of buffers. It is not recommended to force the creation of a new buffer pool, say of size 16 because the overhead of the pool control blocks is likely to be larger than the space saved compared to extending the 32-byte pool.


[1469] 2. Specification


[1470] 2.1 Responsibilities


[1471] Re-configure the event manager to guarantee that the specified number of events of the specified sizes (configured through properties) is available for allocation at interrupt time.


[1472] 2.2 External States


[1473] None.


[1474] 2.3 Use Cases


[1475] None; this part has no inputs and performs no operations.


[1476] 3. Typical Usage


[1477] All examples below assume that one instance of SYS_EVPRM is placed in the outermost system assembly.


[1478] 3.1 Configuration for an Image-processing Application


[1479] This example assumes that the system will use events of one size only—the size needed to store one video frame (besides the control events, which will be drawn from the default pool for small events).


[1480] sz1=304128 (352*288*3=1 CIF frame in 8-bit RGB format)


[1481] n1=5 (pick this number depending on the length of the image processing pipeline, counting each de-synchronization point, e.g.: 2 for data pickup from input device, 1 for hardware color space conversion, 2 for output file buffers)


[1482] sz2=0 (default value, not used)


[1483] sz3=0 (default value, not used)


[1484] sz4=0 (default value, not used)


[1485] 3.2 Configuration for a Networking Application


[1486] Assuming that events' payload buffers are used as the receive and transmit frame buffers, a networking application will use events of varying sizes—from the smallest ones that carry only network headers up to the largest frame that can be carried by the network protocol(s).


[1487] Considering that the network speed is constant, regardless of the frame size, one would expect higher frame rates for smaller frame sizes and lower frame rates for larger frame sizes.


[1488] The simplest solution of course will be to pre-allocate enough buffers of the largest possible size, but there may not be enough system memory for that. The table below shows a possible compromise assuming a random spread of the frame sizes:
76sznsz1 = 100000n1 = 3sz2 = 30000n2 = 10sz3 = 10000n3 = 30


[1489] For the same average number of buffered frames, the total amount of pre-allocated memory is about 10 times less than what would be needed if all the buffers were allocated with the largest size (100K).


[1490] 4. Document References


[1491] None


[1492] 5. Unresolved Issues


[1493] None



SYS—Debugging and Instrumentation


SYS_LOG—Log File Output

[1494]
FIG. 37 illustrates the boundary of part, Log File Output (SYS_LOG)


[1495] 1. Functional Overview


[1496] SYS_LOG writes time-stamped data into a file. The data is provided in events received on the d a t terminal. SYS_LOG can treat the incoming data as either binary or string data. This functionality is parameterizable via a property.


[1497] SYS_LOG may statically be enabled/disabled via property before activation or dynamically during run-time via events received on its ctl terminal. The event IDs used to enable/disable SYS_LOG are provided as properties.


[1498] SYS_LOG is useful for creating log files with fixed or variable record size.


[1499] 2. Boundary
772.1 TerminalsNameDirInterfaceNotesdatinI_DRAINThis tenninal is used to send data to be written into the logfile. SYS_LOG accepts any event on this input.If the data is binary, all data in the event bus starting from theoffset specified by the offs property up to the size of the bus(specified by the sz field) is written into the log file.Otherwise, data is written to the file starting at offs up to theterminating zero.ct1inI_DRAINThis terminal may be used to enable and disable the writingof entries in the log file. Depending on the part'sparameterization, the “enable” and “disable” events can alsocontrol the opening and closing of the event log file (see thenext section). The events that SYS_LOG accepts as “enable”and “disable” are programmable as properties.This terminal may be left unconnected.


[1500]

78











2.2 Properties









Name
Type
Notes





file_name
asciz
The log file name. SYS_LOG provides no less than 260




(MAX_PATH) characters of storage for this property. See the




note (*) below on using this property.




This property is mandatory.


append
byte
Setting this property to TRUE makes SYS_LOG append new




entries to the log file (if it already exists). Setting it to FALSE




causes SYS_LOG to erase the file each time the log is enabled.




Default value: 1 (append enabled).


max_log_sz
uint32
Specifies the maximum log file size (in units of 1024 bytes). If




the log file reaches the specified size, SYS_LOG stops adding




entries to it. Setting this property to 0 disables the log file size




limit.




Default value: 0 (no file size limit)


safe_mode
uint32
This property defines whether SYS_LOG should flush the log




file every time new data is written into it. This property can




take the following values:




0 - unsafe mode (fastest). SYS_LOG keeps the log file open




whenever it is enabled and does not flush the file buffers until




it is disabled (or deactivated).




1 - safe mode (slower). SYS_LOG flushes the file buffers




every time new data is written into the log. It may keep the log




file open.




2 - safest mode (slowest). SYS_LOG keeps the file closed and




opens it only to write new data into it, then closes it again




before returning to the caller.




Default value: 0.


offs
uint32
Defines the offset into the event bus from which to start taking




data to be written into the log file.




Default value: 0


string_data
uint32
Boolean. If TRUE, the data at offs is treated as a zero-




terminated ASCII string. Only the data up to the terminating




zero is written to the log file.




Default value: FALSE.


start_enabled
uint32
If this property is set to a non-zero value, SYS_LOG will




enable the log file upon activation. Note that if the use of




control events is disabled setting this property to FALSE




completely disables SYS_LOG.




Default value: FALSE.


enable_id
uint32
Specifies the event to be used as the “log enable” event.




Setting this property to EV_NULL (0) disables the use of




control events to enable and disable the log; the only way to




enable the log in this case is to set the start_enabled property




to TRUE.




Default value: EV_REQ_ENABLE.


disable_id
uint32
Specifies the event to be used as the “log disable” event. If




enable_id is set to EV_NULL this property is ignored (no




events are accepted on the ct1 input in this case).




Default value: EV_REQ_DISABLE.


timestamp
uint32
This property defines the format of the time stamp written with




each data block written (one variable-size data block is written




with each call to the dat terminal).




Possible values:




0 - no time stamp




‘B’ - long binary format. SYS_LOG writes the current system




time in the Win32 FILETIME format (an 8-byte integer




representing the number of 0.1 us units since Jan 01, 1601).




‘X] - long hex time stamp. Same as above, but written as a 16-




digit hexadecimal number.




Default value: 0 (no time stamp).






(*) Notes on the file_name property usage.








[1501] The file_name property must contain the full path to the file.


[1502] 3. Events and Notifications
793.1 Terminal: datEventDirBusNotes*invoidAny event on the dat terminal is treated as variablesize binary data to be stored in the log file. If the logfile is disabled, SYS_LOG will accept this messageand return ST_OK without taking any action.


[1503]

80











3.2 Terminal: ctl










Event
Dir
Bus
Notes





(enable_id)
in
void
The event ID programmed into the enable_id





property, when sent to the ctl terminal, enables





the writing of entries in the log file. The event





may have any bus-SYS_LOG ignores the data





carried by the event.


(disable_id)
in
void
The event ID programmed into the disable_id





property, when sent to the ctl terminal, disables





the writing of entries in the log file. The event





may have any bus-SYS_LOG ignores the data





carried by the event.










[1504] 3.3 Special Events, Frames, Commands or Verbs


[1505] None.


[1506] 3.4 Encapsulated Interactions


[1507] SYS_LOG uses operating system services to perform file operations and to read the system time.


[1508] 4. Specification


[1509] 4.1 Responsibilities


[1510] Create and maintain the log file specified by the flle_name property.


[1511] Write data into the file specified by the file_name property, along with a formatted time stamp.


[1512] 4.2 Theory of Operation


[1513] 4.2.1 Mechanisms


[1514] None.



UTL—Concurrency


UTL_E2AR—Event to Asynchronous Request Converter

[1515]
FIG. 38 illustrates the boundary of part, Event to asynchronous request converter (UTL_E2AR)


[1516] 1. Functional Overview


[1517] UTL_E2AR is a plumbing part that converts an incoming notification received on the in terminal to an asynchronous request and converts a request completion received on the out terminal into a notification.


[1518] UTL_E2AR generates an asynchronous request out the out terminal when a specific event is received on the in terminal. The generated request's data bus is zero-initialized.


[1519] When a generated request completes, UTL_E2AR generates a “completed” notification and sends it back to the in terminal. The ID of the notification depends on whether the request completed successfully. The notification is always self-owned and event bus contains all the data returned in the request completion.


[1520] The incoming and outgoing request IDs and the request bus size are specified through properties.


[1521] This part can be used whenever it is necessary to generate a simple asynchronous request upon a notification or another similar event.


[1522] UTL_E2AR's terminals are unguarded and may be invoked at interrupt time.


[1523] 2. Boundary
812.1 TerminalsNameDirInterfaceNotesinbiI_DRAINWhen the specified trigger event is received here,UTL_E2AR generates an asynchronous requestthrough the out terminal.outBiI_DRAINUTL_E2AR sends generated asynchronousrequests through this terminal.The completion of the generated request isreceived through the back channel of thisterminal.


[1524]

82











2.2 Properties









Property name
Type
Notes





in_req_ev_id
uint32
ID of the trigger event received through




the in terminal.




When this event is received,




UTL_E2AR generates an asynchronous




request through the out terminal.




Default value is EV_NULL (a request




is generated on any event received




through the in terminal).


in_cplt_ok_ev_id
uint32
ID of the event UTL_E2AR generates




through the in terminal when the




asynchronous request completes




successfully.




Default value is EV_NULL.


in_cplt_fail_ev_id
uint32
ID of the event UTL_E2AR generates




through the in terminal when the




asynchronous request fails (completion




status ! = ST_OK).




Default value is EV_NULL.


out_ev_id
uint32
ID of the asynchronous request sent




through the out terminal.




This property should always be set to




the proper event ID.


out_ev_sz
uint32
Size (specified in bytes) of the




asynchronous request generated through




the out terminal.




Default is 0.


out_or_attr
uint32
Attribute mask that is ORed with the




asynchronous request attributes before it




is forwarded through the out terminal.




These attributes should include only




application-specific attributes and no




attributes defined by Dragon.




Default is 0 (none).










[1525] 2.3 Events and Notifications


[1526] UTL_E2AR accepts events on its in or out terminals, as specified by its properties.


[1527] 2.4 Environmental Dependencies


[1528] 2.5 Encapsulated Interactions


[1529] None.


[1530] 3. Specification


[1531] 3.1 Responsibilities


[1532] For the specified event received on the in terminal, generate an asynchronously completable request through the out terminal.


[1533] When the asynchronous request completes (by receiving the completion event through the out terminal), depending on the completion status, generate either an in_cplt_ok_ev_id (success) or in_cplt_fail_ev_id (failure) event through the in terminal.


[1534] Fail events received on the out terminal with ST_NOT_SUPPORTED if the ZEVT_A_COMPLETED attribute is not set or the event ID is not out_ev_id.


[1535] Consume events received on in whose event ID is not in_req_ev_id and return ST_OK.


[1536] 3.2 Use Cases


[1537] None.


[1538] 3.3 Typical Usage


[1539] None



UTL—Property Space Support


UTL_PCOPY—Property Copier

[1540]
FIG. 39 illustrates the boundary of part, Property Copier part (UTL_PCOPY)


[1541] 1. Functional Overview


[1542] UTL_PCOPY is a parameterization part that copies property values from a source property container to a destination property container when a trigger event is received.


[1543] When a trigger event is received, UTL_PCOPY enumerates the properties through its enm terminal and for each property found, retrieves the value through the src terminal and sets the value through the dst terminal.


[1544] UTL_PCOPY is typically used to store property values from a dynamic part container to persistent storage such as a file or database and restore property values from persistent storage.


[1545] UTL_PCOPY cannot be used in an interrupt context because memory is allocated dynamically.


[1546] 2. Boundary
832.1 TerminalsNameDirInterfaceNotesctlinI_DRAINInput for control (trigger) event that initiates theenumeration and copying of properties.enmoutI_PROPUTL_PCOPY enumerates properties through thisterminal.srcoutI_PROPUTL_PCOPY retrieves the enumerated propertyvalues through this terminal.dstoutI_PROPUTL_PCOPY sets the enumerated propertyvalues through this terminal.


[1547]

84











2.2 Properties









Property




name
Type
Notes





trigger_ev
uint32
Specifies the ID of the event received through




the ctl terminal that results in UTL_PCOPY




enumerating properties through its enum




terminal retrieving the property values from the




src terminal and setting the property values




through the dst terminal.




The default value is EV_PULSE.


buf_sz
uint32
Specifies the intial size in bytes of the data




buffer that is used when retrieving property




values.




The default value is 32.


resize
uint32
Boolean. When TRUE, UTL_PCOPY resizes




the data buffer it uses to retrieve property value




if the property value overflows the buffer.




When FALSE and the property value overflows




the data buffer, UTL_PCOPY fails the event




with ST_OVERFLOW.




The default value is TRUE.


qry_string
asciz
Query string to use when enumerating




properties.




The default value is “*” (enumerate all




properties.)


qry_attr
uint32
Attributes to use when enumerating properties.




The default value is ZPRP_A_PERSIST.


qry_attr_mask
uint32
Attribute mask to use when enumerating




properties.




The default value is 0xFFFFFFFF.


enm_id
uint32
Modifiable part instance ID to store in the ID




field of the property bus when enumerating




properties through the enm terminal.




The default value is 0 (any part.)


src_id
uint32
Modifiable part instance ID to store in the ID




field of the property bus when retrieving




property values through the src terminal.




The default value is 0 (any part.)


dst_id
uint32
Modifiable part instance ID to store in the ID




field of the property bus when retrieving




property values through the dst terminal.




The default value is 0 (any part.)










[1548] 3. Events and Notifications
853.1 Terminal: ctlEventDirBusNotes(trigger_ev)inanyWhen this event is received, UTL_PCOPYenumerates properties through its enm terminal,retrieving the property values from the srcterminal and setting the property values throughthe dst terminal.


[1549] 4. Environmental Dependencies


[1550] None.


[1551] 5. Specification


[1552] 5.1 Responsibilities


[1553] When the trigger_ev event is received through the ctl terminal, enumerate the properties through the enm terminal and for each property found, retrieve the property value through the src terminal and set the property value through the dst terminal.


[1554] If the event received through the ctl terminal is not the trigger event, fail the event with ST_NOT_SUPPORTED.


[1555] If ST_NOT_FOUND is returned for any request that is sent through the src or dst terminals, the debug version of UTL_PCOPY will display debug output and continue with the next property.


[1556] If the property value retrieved from the src exceeds the size of initially allocated buffer, and resizing is allowed, reallocate the buffer size to fit the property value.


[1557] Otherwise, fail the event with ST_OVERFLOW.


[1558] 5.2 External States


[1559] None


[1560] 5.3 Use Cases


[1561] 5.3.1 Serialization of Part Instance Properties to Registry


[1562]
FIG. 40 illustrates an advantageous use of part, UTL_PCOPY


[1563] This use case demonstrates how to serialize properties of a part instance using UTL_PCOPY. This example has the UTL_PCOPY part connected to PRCREG and the part array ARR.


[1564] UTL_PCOPY is parameterized with the part instance ID for the part instance whose state needs to be serialized to the registry (enm_id and src_id). Next, UTL_PCOPY is parameterized with the trigger event ID used to serialize the part's state to the registry.


[1565] At some point, the trigger event is sent to UTL_PCOPY to serialize the part's properties.


[1566] UTL_PCOPY receives the trigger event and begins to enumerate the part's properties through its enm terminal.


[1567] For each enumerated property, UTL_PCOPY retrieves the value of the property through the src terminal and then sets the property through the dst terminal.


[1568] Each property that is set through the dst terminal is updated in the system's registry by PRCREG.


[1569] UTL_PCOPY continues to enumerate and copy the property values from the src to the dst terminal until all the properties are enumerated.


[1570] The properties can be deserialized from the registry to the part instance by swapping the PRCREG part with the part array ARR (PRCREG connected to the src terminal and ARR connected to the dst terminal).


[1571] 6. Typical Usage


[1572] See Serialization of part instance state to registry above under Use Cases.


[1573] 7. Document References


[1574] None


[1575] 8. Unresolved Issues


[1576] None



UTL_PRPQRY—Property Query Processor

[1577]
FIG. 41 illustrates the boundary of part, Property Query Processor (UTL_PRPQRY)


[1578] 1. Functional Overview


[1579] UTL_PRPQRY is a parameterization part that limits the enumeration of properties to those whose name matches a specified query string, which may contain wildcard characters. This enables groups of properties that contain a specific character pattern to be enumerated.


[1580] UTL_PRPQRY processes only property enumeration requests (i.e., qry_open, qry_close, qry_first, qry_next, etc.); all other I_PROP operations are forwarded to the out terminal without modification.


[1581] UTL_PRPQRY supports only one query session at a time. A query session is the period between the opening and closing of a query. An attempt to open more than one query session will return an error status.


[1582] UTL_PRPQRY is typically used where two or more components, requiring serialization and de-serialization services, need to share a property container. UTL_PRPQRY allows each component to differentiate its own properties from others by accessing only properties with a unique string pattern in their names.


[1583] UTL_PRPQRY must be guarded.


[1584] While either the qry_first or qry_next operation is executing, UTL_PRPQRY does not allow other qry_frst or qry_next calls. Any calls received to either qry_first and qry next while either is executing will be rejected. UTL_PRPQRY will be guarded intermittently during query operations. The part cannot be used in an interrupt context when query operations are invoked. However, the part can be used in an interrupt context during get, set, chk and get_info operations.


[1585] 2. Boundary
862.1 TerminalsNameDirInterfaceNotesininI_PROPUTL_PRPQRY receives I_PROP operationsthrough this terminal. Operations not related toenumeration are forwarded through to the outterminal. Operations relating to enumerationtrigger internal procedures used to enumerateproperties through the out terminal based on aquery string.outoutI_PROPUTL_PRPQRY invokes I_PROP operationsthrough this terminal that have been passed fromthe in terminal and operations that are used toenumerate properties that will be compared to aquery string.


[1586]

87











2.2 Properties









Property




name
Type
Notes





wildcard1
uchar
Specifies the character to be used as the universal




wildcard character. As characters in the query string




and property name are sequentially examined for a




match, the universal wildcard character found in the




query string will match all remaining characters in




the property name




The default value is “*”.


wildcard2
uchar
Specifies the character to be used as a limited




wildcard character. As characters in the query string




and enumerated property's name are sequentially




examined for a match, the limited wildcard character




found in the query string will match the remaining




characters in the property name up to the delimiter




character.




The default value is “?”.


delimiter
uchar
Specifies the character used to delimit hierarchical




levels in the property name.




The default value is “.”










[1587] 3. Events and Notifications


[1588] None.


[1589] 4. Environmental Dependencies


[1590] 4.1 Encapsulated Interactions


[1591] None.


[1592] 4.2 Other Environmental Dependencies


[1593] None.


[1594] 5. Specification


[1595] 5.1 Responsibilities


[1596] Pass the get, set, chk, get_info calls on the in terminal through the out terminal.


[1597] Extract and save the query string from an incoming qry_open operation. Open the same query on the out terminal except with qry_string set to ‘*’.


[1598] Respond to a qry_first and qry_next calls on the in terminal by making repeated queries through the out terminal until a match with the stored query string received on the in terminal is found.


[1599] 5.2 External States


[1600] None


[1601] 5.3 Use Cases


[1602] 5.4 Specifying Wildcards in the Query String


[1603] The query string can contain two different wildcard characters, universal (“*” by default) and limited (“?” by default.)


[1604] The universal wildcard character applies to the entire property name. For example, using the “*” as the universal wildcard character, a query string value of “Pr*” matches “Property1,” “Property.2.3”, “Proposition/a/b” or “Predictor23; 4”


[1605] The limited wildcard character applies only to characters up to a delimiter ( “.”by default.) For example, using “?” as the limited wildcard character, a query string of “property.c?.hello” matches “property.cat.hello” or “property.cello.hello” This limited wildcard mechanism allows properties to be accessed in a hierarchical fashion similar to folders and sub-folders on a personal computer hard-drive. For example, properties of different parts stored in a single property container, using names like “part1.property1”, “part1.property2”, “part2.property1” etc., can be accessed in groups of like names. A search string value of“?.property1” would enumerate all properties with “property1” after the delimiter“.”


[1606] 5.5 Enumerating properties


[1607] UTL_PRPQRY receives a qry_open request on its in terminal and forwards the request to its out terminal.


[1608] UTL_PRPQRY receives a qry_first request on its in terminal.


[1609] UTL_PRPQRY invokes qry_first and one or more qry_next requests out its out terminal until a property is returned that matches the query string.


[1610] UTL_PRPQRY receives a qry_next request on its in terminal.


[1611] UTL_PRPQRY invokes one or more qry_next requests out its out terminal until a property is returned that matches the query string.


[1612] UTL_PRPQRY receives a qry_close request on its in terminal and forwards the request to its out terminal.


[1613] 6. Typical Usage


[1614] 6.1 De-serialization of Properties from a Property Paramaterizer to a Registry Based Property Container


[1615]
FIG. 42 illustrates an advantageous use of part, UTL_PRPQRY


[1616] This use case demonstrates how to serialize properties of multiple part instances using UTL_PRPQRY. This example has the UTL_PRPQRY part connected to APP_PARAM used to parameterize part array ARRY and PRCREG used to store serialized properties.


[1617] When APP_PARAM recognizes its triggering persistent property name on its i_prop terminal, it initiates a query through its stg terminal. The query string contains the persistent property name for example “my_part ” followed by a dot then a wildcard character such as “?” forming “my_part1.?”. As APP_PARAM continues its property enumeration, UTL_PRPQRY queries the registry through PRCREG passing back only those properties that match the “my_part1.?” query string. As each property is enumerated, APP_PARAM can get property values through UTL PRPQRY from PRCREG thereby parameterizing my_part1 within the part array ARR with only my_part1's own parameters.


[1618] 7. Document References


[1619] None


[1620] 8. Unresolved Issues


[1621] None.



UTL_PRCBA—Virtual Property Container on Byte Array

[1622]
FIG. 43 illustrates the boundary of part, UTL_PRCBA


[1623] 1. Functional Overview


[1624] UTL_PRCBA is a property container part that provides standard property services for virtual, dynamic properties. The properties in the container are stored in a byte array accessed through the arr terminal.


[1625] UTL_PRCBA implements all of the operations specified in the I_PROP interface and supports multiple property queries at a time. UTL_PRCBA supports all of the standard Dragon property types and has no self-imposed restriction as to the size of the property value, provided there is enough storage in the byte array.


[1626] UTL_PRCBA is typically used in assemblies to store persistent system parameters over some type of persistent storage (e.g., hard disk).


[1627] UTL_PRCBA's terminals are guarded in order to prevent data corruption in the property container. Therefore, UTL_PRCBA cannot be used in interrupt contexts.


[1628] 2. Boundary
882.1 TerminalsNameDirInterfaceNotesfacinI_PRPFACThis terminal is used to create, destroy andre-initialize properties in the container.prpinI_PROPThis terminal is used to get, set, check andenumerate properties in the container.arroutI_BYTEARRThis terminal is used to access the byte arraythat is used to store information about theproperties in the container.


[1629]

89











2.2 Properties









Property name
Type
Notes





initial_prp_stg_offs
uint32
Specifies the initial offset in the byte




array where the property container




should store the property information.




The default value is 0 (beginning of




the byte array).


total_prp_stg_sz
uint32
Specifies the maximum amount of byte




array storage that UTL_PRCBA is




allowed to use to store property




information (specified in bytes). On a




property create or set operation, if the




maximum storage size is reached,




UTL_PRCBA fails the operation




with ST_NO_ROOM.




If this property is set to zero, the




maximum amount of storage depends




on the available amount of storage in




the byte array.




The default value is 0.


max_props
uint32
Specifies the maximum number of




properties to store in the container.




If this property is set to zero, the




maximum number of properties only




depends on the available amount of




storage in the byte array (accessed




through the arr terminal).




The default value is 64.










[1630] 3. Events and Notifications


[1631] None.


[1632] 4. Environmental Dependencies


[1633] None.


[1634] 4.1 Encapsulated Interactions


[1635] None.


[1636] 4.2 Other Environmental Dependencies


[1637] None.


[1638] 5. Specification


[1639] 5.1 Responsibilities


[1640] Implement all property factory operations as defined by the I_PRPFAC interface (create,destroy,clear,get_first and get_next).


[1641] Implement all property access operations as defined by the I_PROP interface (get,set,chk, get_info,qry open,qry close,qry first, qry_next and qry_curr).


[1642] Support all Dragon property types.


[1643] Ignore all property attributes.


[1644] Support multiple property queries and querying for only all of the properties in the container (query string=“*”). PRCQRY may be used in front of UTL_PRCBA in order to support more complex property queries.


[1645] Maintain the property container over a byte array using the arr terminal. The structure of the property information is an array of records stored in the byte array.


[1646] Each record has the following structure:


<total_record_length>, <name>, <type>, <attr>, <value_length>, <value>


[1647]  total_record_length: The total number of bytes in the record. This is used to enumerate the records in the array. This field is in MSB byte order. The first bit is used to determine how much storage is used for this field (either 1 byte or 4 bytes). If this bit is set, the record length field is 1 byte long. If this bit is clear, the field is 4 bytes long. This mechanism minimizes the size of each record in the byte array.


[1648] name: Name of the property, this is a zero-terminated ASCII string.


[1649] type: Property type (uint16).


[1650] attr: Property attributes (uint32).


[1651] value_length: Length of the property value (length of this field uses the same mechanism as the total_record_length field described above).


[1652] value: Property value (value_length bytes).


[1653] In addition to the property records, the first two DWORDs before the first property record contains the following information:


[1654] Number of property records in storage (first DWORD)


[1655] Total amount of storage (specified in bytes) used by property records (second DWORD)


[1656] Ignore the id field in the bus of incoming prp operation calls.


[1657] 5.2 External States


[1658] None.


[1659] 5.3 Use Cases


[1660] 5.4 Property Creation and Access


[1661] This use case describes the basic property creation and access operation:


[1662] A part creates a new property by invoking the create operation through the fac terminal. If the number of properties in the container is equal to the max_props property, UTL_PRCBA fails the operation with ST_NO_ROOM.


[1663] UTL_PRCBA creates the new property and initializes its value to empty. The location of the property information storage depends on the initial_prp_stg_offs property.


[1664] A part sets the value of the property by invoking the set operation through the prp terminal.


[1665] UTL_PRCBA updates the value of the property in the byte array and returns.


[1666] At a later time, a part retrieves the value of the property by invoking the get operation through the prp terminal.


[1667] UTL_PRCBA retrieves the value from the byte array and returns it through the operation bus.


[1668] When the property is not needed anymore, a part invokes the destroy operation through the fac terminal.


[1669] UTL_PRCBA removes the property from the byte array.


[1670] 5.5 Property Queries


[1671] This use case describes the query operation of UTL_PRCBA:


[1672] Several properties are created and set in the property container.


[1673] A part opens a query on the properties by invoking the qry_open operation through the prp terminal. Many property queries can be opened.


[1674] A part gets the first property in the query by invoking the qry_first operation through the prp terminal.


[1675] Subsequent properties in the query are retrieved by invoking the qry_next operation through the prp terminal.


[1676] The current property query is retrieved by invoking the qry_curr operation through the prp terminal.


[1677] When the property query is not needed anymore, the query is closed by invoking the qry_close operation through the prp terminal.


[1678] Property queries can also be handled through the fac terminal using the get_first and get_next operations.


[1679] 6. Typical Usage


[1680] 6.1 Using UTL_PRCBA for storage of persistent system parameters


[1681]
FIG. 44 illustrates an advantageous use of part, UTL_PRCBA


[1682] This use case demonstrates how to serialize properties of multiple part instances to persistent storage. The mechanism described here can be used to save the entire state of a system.


[1683] Part instances are created by using the fact terminal of ARR. When the state of the parts in the part array need to be saved to persistent storage, a begin transaction notification is first sent to APP_BAFILE. This notification opens a transaction on the byte array for the properties that need to be stored. Next a trigger event is sent to UTL_PCOPY through its ctl terminal (used to trigger serialization).


[1684] Upon receiving the trigger event (usually on system shutdown), UTL_PCOPY enumerates all the persistent properties of the parts in the array and sets them through its dst terminal.


[1685] UTL_VPCEXT receives the set operation call and attempts to set the specified property in the property container (UTL_PRCBA). If the property does not exist, UTL_VPCEXT creates the property in the container and then updates its value.


[1686] The property container UTL_PRCBA uses the byte array on file (APP_BAFILE) to store the property information.


[1687] After the serialization of the parts persistent properties is complete, an end transaction notification is sent to APP_BAFILE. APP_BAFILE saves the state of the byte array to a file on the user's hard-drive. Later when the system is brought back up, UTL_PRCBA can be enumerated and the state of the parts in the array can be restored.


[1688] 7. Document References


[1689] None.


[1690] 8. Unresolved Issues


[1691] None.





[1692] UTL_VPCEXT—Virtual Property Container Extender


[1693]
FIG. 45 illustrates the boundary of part, Virtual Property Container Extender (UTL_VPCEXT)


[1694] 1. Functional Overview


[1695] UTL_VPCEXT extends the virtual property container (UTL_VPC) by enabling properties to be operated on without first having to be explicitly created. When a get/set operation is received for a property that does not exist, UTL_VPCEXT first creates the property and then submits the property request.


[1696] When a property ‘get info’ operation is received on i_prp terminal, UTL_VPCEXT returns a predefined property type and attributes for a non-existing property if it is in the range of supported properties.


[1697] Upon a ‘reset’ request received on its control terminal (ctl), UTL_VPCEXT destroys all properties through its fac terminal.


[1698] The range of non-existing properties, for which UTL_VPCEXT is responsible, the predefined property type, property attributes and ‘reset’ request ID are specified through properties. Only one range of properties can be specified. Multiple instances of UTL_VPCEXT can be cascaded to provide multiple property ranges. 2. Boundary
902.1 TerminalsNameDirInterfaceNotesi_prpinI_PROPv-table, infinite cardinalityInput property interface. All operations arepassed transparently to o_prp.o_prpoutI_PROPv-table, cardinality 1All property operations on the i_prp inputare passed transparently to this output.clrinI_DRAINv-table, infinite cardinalityThe requests for destroying all propertiesare received on this terminal.facoutI_PRPFACv-table, cardinality 1This terminal is used to create and destroyproperties.


[1699]

91











2.2 Properties









Property




name
Type
Notes





reset_ev_id
uint32
Specifies the event ID of the reset request.




Default is EV_RESET.


path
asciz
Specifies a property range for which to provide




auto creation and default property type and




attributes. The property range is specified




through a wildcard type property. The wildcard




characters are asterisk (‘*’ - must be the last




character. It replaces zero or more characters in




the property name.) and question mark




(‘?’ - represents exactly one character from the




property name).




Default is “*” - all properties.


type
uint32
Default property type for the range of properties




specified in path.




Default is ZPRP_T_NONE


attr
uint32
Default property attributes for the range of




properties specified in path.




Default is ZPRP_A_NONE.


force_free
uint32
Set to TRUE to free self-owned events without




regard of what the returned status is.




Default is FALSE.










[1700] Events and Notifications
922.4 Terminal: ctlEventDirBusNotes(reset_ev_id)invoidRequest to destroy all properties through facterminal.


[1701] 2.5 Special Events, Frames, Commands or Verbs


[1702] None.


[1703] 3. Encapsulated Interactions


[1704] None.


[1705] 4. Specification


[1706] 4.1 Responsibilities


[1707] Forward all operations coming on i_prp terminal out through o_prp terminal without modification.


[1708] Recognize range of properties by using a ‘wildcard’ comparison between the property name and path property.


[1709] Provide auto-creation for a range of recognized properties, when property ‘set’ operation fails because the specified property does not exist. Use the values specified in type and attr properties as default property in the creation when creates the properties through fac terminal.


[1710] When get property ‘info’ operation fails and the property name is in the range recognized by UTL_VPCEXT, provide default property type and attributes as they are specified in type and attr properties respectively.


[1711] Destroy all properties in the virtual property container upon receiving the specified ‘reset’ event (reset_ev_id).


[1712] 4.2 Theory of Operation


[1713] 4.2.1 State Machine


[1714] None.


[1715] 4.2.2 Main Data Structures


[1716] None.


[1717] 4.2.3 Mechanisms



Set Property Operation

[1718] All property ‘set’ operations received on i_prp terminal, are forwarded through the opposite (o_prp) terminal. If the operation completes with status different from ST_NOT_FOUND, UTL_VPCEXT propagates the returned status to the caller.


[1719] If property ‘set’ operation fails with status ST_NOT_FOUND and the property name is in the specified by the path range, UTL_VPCEXT creates a property using the name specified in the property ‘set’ operation bus. For property type and property attributes are used the values specified in type and attr respectively. After a successful property creation, UTL_VPCEXT resubmits the property ‘set’ request and propagates the returned status to the caller.



Get Property Info Operation

[1720] UTL_VPCEXT forwards get property ‘info’ operation received on its i_prp terminal through the opposite (o_prp) terminal. UTL_VPCEXT returns the status returned, if the operation completes with a status different from ST_NOT_FOUND.


[1721] If the property name is part of the range specified by the path, UTL_VPCEXT copies the default property type (type) and attributes (attr) into the request bus and completes the request with status ST_OK.


[1722] 5. Use Cases


[1723] 5.1 UTL_VPCEXT Parameterization


[1724] UTL_VPCEXT, in the following example is used to provide auto-creation for all uint32 properties whose names begin with “baud.” (Note the dot at the end of the string):
93part (vpcext, UTL_VPCEXT)param (path, “baud.*”)param (type, ZPRP_T_UINT32)param (attr, ZPRP_A_NONE)


[1725] UTL_VPCEXT, in the following example is used to provide auto-creation for all string properties whose names begins with “device” and have two other characters at the end:
94part (vpcext, UTL_VPCEXT)param (path, “device??”)param (type, ZPRP_T_ASCIZ)param (attr, ZPRP_A_NONE)


[1726] 5.2 Cascading Multiple UTL_VPCEXT


[1727] Cascading several instances of UTL_VPCEXT provides the full UTL_VPCEXT functionality over multiple ranges of properties.


[1728] The example below demonstrates how to provide type, attributes and auto creation for different range of properties. Each property range is recognized by a key word embedded in the property name. All property names have four letters prefix, followed by the property type identifier and are suffixed with zero or more characters. The recognized key words are: “string” for ASCIIZ properties, “DWORD” for unsigned 32-bit properties and “byte” for unsigned 8-bit properties.


[1729]
FIG. 46 illustrates Chaining Multiple Virtual Property Container Extenders


[1730] The part definition and default parameterization follows:
95part(vpcext1, UTL_VPCEXT)param (path, “????string*”)param (type, ZPRP_T_ASCIZ)param (attr, ZPRP_A_NONE)part(vpcext2, UTL_VPCEXT)param (path, “????dword*”)param (type, ZPRP_T_UINT32)param (attr, ZPRP_A_NONE)part(vpcext3, UTL_VPCEXT)param (path, “????byte*”)param (type, ZPRP_T_UCHAR)param (attr, ZPRP_A_NONE)



UTL—Event Manipulation


UTL_ST2ES—Return Status to Event Status Converter

[1731]
FIG. 47 illustrates the boundary of part, Return Status to Event Status Converter (UTL_ST2ES)


[1732] 1. Functional Overview


[1733] UTL_ST2ES is a plumbing part that stamps the return status from an outgoing operation into the status field of the event and returns a predefined status.


[1734] All events received on in terminal are sent out through out terminal. The ‘self-owned’ and ‘asynchronously completable’ events are converted to normal events (ZEVT_A_SELF_OWNED, ZEVT_A_ASYNC_CPLT and ZEVT_A_COMPLETED attributes are cleared) before sending them out of the out terminal.


[1735] Note that if the event is constant (ZEVT_A_CONSTANT attribute is set) the UTL_ST2ES fails and returns status ST_REFUSE.


[1736] When the event sent through the out terminal completes, UTL_ST2ES stamps the returned status in the event. The modified event attributes are restored to their original value before completing the event with status specified through a property.


[1737] UTL_ST2ES is typically used in situations where it is necessary to have the actual return status stamped into the event and a predefined status be returned.


[1738] UTL_ST2ES's input terminal is unguarded and therefore may be invoked at interrupt time.


[1739] 2. Boundary
962.1 TerminalsNameDirInterfaceNotesininI_DRAINAll events coming on this terminal areconverted to normal events (attributesZEVT_A_SELF_OWNED,ZEVT_A_ASYNC_CPLT andZEVT_A_COMPLETED are cleared) andsent out of the out terminal.When the out call returns, the completion statusis placed in the event bus and the event attributesmodified by UTL_ST2ES are restored.outoutI_DRAINEvents received from the in terminal areremapped (if needed) and are passed outthis terminal.


[1740]

97











2.2 Properties









Property name
Type
Notes





ret_s
uint32
Status to return on raise operation invoked on




in terminal. Default is ST_OK.










[1741] 2.3 Events and Notifications


[1742] UTL_ST2ES forwards all events received on its in terminal to the out terminal.


[1743] 2.4 Environmental Dependencies


[1744] 2.5 Encapsulated Interactions


[1745] None.


[1746] 3. Specification


[1747] 3.1 Responsibilities


[1748] Convert all events received on the in terminal to be normal synchronous events and send modified event out the out terminal.


[1749] Store completion status of the call to the out terminal in the evt_stat field of the event and restore the original attributes.


[1750] Return the status specified by the ret_s property.


[1751] 3.2 External States


[1752] None.


[1753] 3.3 Use Cases


[1754] None.


[1755] 3.4 Typical Usage


[1756] None.



UTL—Data Manipulation


UTL_EDC—Error Detection Coder and Verifier

[1757]
FIG. 48 illustrates the boundary of part, Error Detection Coder and Verifier (UTL_EDC)


[1758] 1. Functional Overview


[1759] UTL_EDC calculates and verifies error detection codes in event data.


[1760] UTL_EDC supports two types of error detection codes (EDC): 8-bit LRC (Longitudinal Redundancy Check) and 16-bit CRC (Cyclic Redundancy Check).


[1761] UTL_EDC is parameterized with the range of event fields that are included in the EDC calculation and where the EDC value is stored in the event.


[1762] If UTL_EDC is parameterized for encoding EDCs, UTL_EDC calculates the EDC and depending on how UTL_EDC is parameterized, it either inserts the EDC into the event or uses the provided storage.


[1763] If UTL_EDC is parameterized for EDC verification and it detects an EDC error in an event received from the in terminal (i.e., by calculating the EDC of the event and comparing it to the value stored in the event), it sets a flag in the attributes field of the event and forwards it through the out terminal. The error flag value is parameterized via a property.


[1764] All events received from the in terminal are forwarded through the out terminal after EDC calculation or verification.


[1765] 2. Boundary
982.1 TerminalsNameDirInterfaceNotesininI_DRAINFor events received through this terminal,UTL_EDC either calculates the proper EDC forthe event or verifies the EDC stored in the event.outoutI_DRAINUTL_EDC forwards the event received throughthe in terminal (either the original event or areplica) through this terminal.


[1766]

99











2.2 Properties









Property name
Type
Notes





verify_edc
uint32
Boolean. If TRUE, UTL_EDC verifies




the EDC of the events received on the in




terminal. Otherwise, UTL_EDC




calculates the EDC and stores it in the




event according to its properties.




Default is FALSE.


edc_type
ASCIZ
Type of the error detection code (EDC)




that UTL_EDC calculates and verifies for




events received on its in terminal.




Can be one of the following values:




“LRC” - 8-bit LRC (Longitudinal




Redundancy Check)




“CRC” - 16-bit CRC (Cyclic




Redundancy Check)




The default value is “CRC”.


edc_begin_offs
uint32
Offset to the first byte that is included in




the calculation of the error detection code




(EDC) for the event data (specified in




bytes).




The default value is 0.


begin_offs_neg
uint32
Boolean. If TRUE, the offset is event




size - the value of the edc_begin_offs




property; otherwise, the offset is




calculated from the beginning of the event.




The default is FALSE.


edc_end_offs
uint32
Offset to the last byte that is included in




the calculation of the error detection code




(EDC) for the event data (specified in




bytes).




The default value is 1.


end_offs_neg
uint32
Boolean. If TRUE, the offset is event




size - the value of the edc_end_offs




property; otherwise, the offset is




calculated from the beginning of the event.




The default is TRUE (up to and including




the last byte in the event)


edc_stg_offs
uint32
Offset to the storage for the error detection




code (EDC) for the event data (specified




in bytes). Depending on the EDC type, the




size of the storage varies (1 byte for LRC




and 2 bytes for CRC)




The default value is 1.


stg_offs_neg
uint32
Boolean. If TRUE, the offset is event




size - the value of the edc_stg_offs




property: otherwise, the offset is




calculated from the beginning of the event.




The default is TRUE (following the last




byte in the event)


edc_byte_order
sint32
Specifies the byte order of the EDC




field in the incoming event.




Can be one of the following values:




0 Native machine format




1 MSB (Motorola) - Most-significant byte




first




−1 LSB (Intel) - Least- significant byte




first




Default is 0 (Native machine format).


edc_stg_provided
uint32
Boolean. If TRUE, the events sent to and




from UTL_EDC contain storage for the




EDC value. If FALSE, UTL_EDC




inserts/removes the error detection code at




the specified offset (edc_stg_offs)




in the event.




The default value is FALSE.


err_flag
uint32
EDC error flag value. This flag is set




(using bit-wise OR) in the event attributes




to indicate that an EDC error was




detected.




If no EDC error was detected, this bit flag




is cleared.




The default value is 0x01.










[1767] 3. Events and Notifications


[1768] UTL_EDC accepts any Dragon event.


[1769] 3.1 Special Events, Frames, Commands or Verbs


[1770] None.


[1771] 3.2 Encapsulated Interactions


[1772] None.


[1773] 4. Specification


[1774] 4.1 Responsibilities


[1775] If verify_edc is TRUE, verify the EDC for events received on the in terminal (according to the property values). If the verification fails set the appropriate flag in the event. If needed, shrink the event to remove the EDC value at the specified offset (edc_stg_provided=FALSE). Forward the event through the out terminal.


[1776] If verify_edc is FALSE, calculate and store the EDC for events received on the in terminal (according to the property values) and send them through the out terminal. If needed, re-allocate the event received on in to store the EDC at the specified offset (edc_stg_provided=FALSE).


[1777] If the EDC storage is not provided with the incoming event, allocate a new event bus and copy the data. Allocate such new events as self-owned.


[1778] Process synchronously all events received on the in terminal. Return the status received from the out terminal.


[1779] For multi-byte EDC (such as CRC) stored or retrieved from the event data, use the byte order specified in the edc_byte_order property.


[1780] 4.2 Theory of Operation


[1781] 4.2.1 State Machine


[1782] None.


[1783] 4.2.2 Main Data Structures


[1784] None.


[1785] 4.2.3 Mechanisms



Calculating the Error Detection Code (EDC)

[1786] If verify_edc is FALSE, UTL_EDC calculates the EDC for all events received on the in terminal. The following types of EDCs are supported:


[1787] LRC (Longitudinal Redundancy Check)—8-bit, exclusive-OR sum of all bytes defined by the offset properties


[1788] CRC (Cyclic Redundancy Check)—16-bit, calculated as defined by standard ISO/IEC 3309


[1789] The range of bytes in the event that are used in the EDC calculation is defined by the edc_begin_offs and edc_end_offs properties. The calculation of this range depends on whether the offsets are from the beginning or the end of the event (xxx_offs_neg is FALSE or TRUE). If the calculated range is empty, the error detection code is zero.


offset=xxx_offs_neg? evt_sz(bp)−edc_xxx_offs:edc_xxx_offs


[1790] After the range of bytes for the EDC calculation are known, UTL_EDC calculates the appropriate EDC and stores or verifies the value in the event as described below.



Storing the Error Detection Code (EDC) in the Event

[1791] After the error detection code is calculated (as described above), it must be stored in the event and sent through the out terminal.


[1792] The storage for the EDC is calculated using the edc_stg_offs and edc_stg_provided properties.


offset=stg_offs_neg? evt_sz(bp)−edc_stg_offs:edc_stg_offs


[1793] The event may either provide storage for the EDC or UTL_EDC can insert the EDC in the event (at the specified location).


[1794] If the EDC value should be inserted into the event (edc_stg_provided=FALSE), UTL_EDC allocates a new event (using z_evt_create) that contains storage for the EDC. UTL_EDC copies the original event (received on the in terminal), updates the new event with the EDC value and consumes the original event (if needed). The newly allocated event is then passed through the out terminal.


[1795] Note: The event that is sent through the out terminal contains the same attributes as the incoming event did except for the following modifications:


[1796] ZEVT_A_SELF_OWNED attribute is added.


[1797] ZEVT_A_SELF_CONTAINED attribute is added.


[1798] ZEVT_A_SYNC_ANY attribute is added.


[1799] ZEVT_A_ASYNC_CPLT and ZEVT_A_COMPLETED attributes are removed (UTL_EDC does not support asynchronous completion).



Error Detection Code (EDC) Verification

[1800] If verify_edc is TRUE, UTL_EDC verifies the EDC for all events received on the in terminal.


[1801] According to the EDC type, UTL_EDC calculates the EDC for the event and compares it to the EDC contained within the event.


[1802] If the EDC values do not match, there is a data error in the event. UTL_EDC sets a flag in the event to indicate this error. To set the flag, UTL_EDC does the following:


[1803] Bit-wise OR the err_flag to the event attributes value (attr field)


[1804] If the EDC values match, UTL_EDC clears the error flag.


[1805] Note that before the event is passed through the out terminal, if the EDC was added to the event by UTL_EDC (edc_stg_provided=FALSE), UTL_EDC allocates a new event (equivalent to the size of the event without the storage for the EDC value) and copies the event data. The new event contains the attributes of the old event plus the ZEVT_A_SELF_OWNED attribute.


[1806] 5. Use Cases


[1807] To illustrate the usage of UTL_EDC, the use cases below use the following frame definition for an imaginary network protocol.
100DASAFTLENHEDCDATAEDC


[1808] The fields labeled DA through LEN comprise the frame header where the HEDC is the frame header EDC. The data field contains the frame's data. All fields except the DATA field are fixed size.


[1809] The fields are defined as follows:


[1810] DA—destination address, 1 byte long


[1811] SA—source address, 1 byte long


[1812] FT—frametype, 1 byte long


[1813] LEN—length of the data field in bytes, 2 bytes long


[1814] HEDC—frame header EDC, 1 byte long


[1815] DATA—the frames data, variable length


[1816] EDC—whole frame EDC, 1-2 bytes long depending on EDC type


[1817] 5.1 Computing the LRC for a frame header (EDC storage provided)


[1818] The event sent to UTL_EDC in this case contains the standard event header (CMEVENT_HDR) plus the frame fields DA through DATA. UTL_EDC is created and parameterized with the following:


[1819] verify_edc=FALSE


[1820] edc_type=“LRC”


[1821] edc_begin_offs=0


[1822] edc_end_offs=offset of LEN field (3 bytes)


[1823] edc_stg_offs=offset of HEDC field (4 bytes)


[1824] edc_stg provided=TRUE


[1825] err_flag=MY_ERROR_FLAG


[1826] Below illustrates what happens when such an event is sent through the in terminal:


[1827] The event containing the frame fields is sent through UTL_EDC's in terminal.


[1828] UTL_EDC calculates the LRC for the fields DA through LEN.


[1829] UTL_EDC stores the EDC value in the HEDC field as described by the properties.


[1830] UTL_EDC passes the event through the out terminal.


[1831] To validate the header EDC of the frame, another UTL_EDC part is used. This instance is parameterized exactly the same way as above except that the verify_edc property is TRUE. Below illustrates what happens when the event is sent through the in terminal:


[1832] UTL_EDC calculates the LRC for the fields DA through LEN and compares it with the EDC stored in the HEDC field.


[1833] If the EDCs match, the event is forwarded through the out terminal.


[1834] There is an error in the frame header. UTL_EDC sets the error flag in the event attributes and forwards the event through the out terminal.


[1835] 5.2 Computing the CRC for frame data (EDC appended to end)


[1836] The event sent to UTL_EDC is the same as the one in the previous use case. UTL_EDC is created and parameterized with the following:


[1837] verify_edc=FALSE


[1838] edc_type=“CRC”


[1839] edc_begin_offs=0


[1840] edc_end_offs=1 (include all fields in frame)


[1841] end_offs_neg=TRUE


[1842] edc_stg_offs=1 (insert EDC at the end of the frame)


[1843] stg_offs_neg=TRUE


[1844] edc_stg_provided=FALSE


[1845] err flag=MY_ERROR_FLAG


[1846] Below illustrates what happens when such an event is sent through the in terminal:


[1847] The event containing the frame fields is sent through UTL_EDC's in terminal.


[1848] UTL_EDC calculates the CRC for the entire frame (DA through DATA).


[1849] UTL_EDC allocates a new event with two more bytes for the EDC field and stores the EDC value at the last two bytes of the event.


[1850] UTL_EDC passes the event through the out terminal.


[1851] To validate the entire frame EDC, another UTL_EDC part is used. This instance is parameterized exactly the same way as above except that the verify_edc property is TRUE. Below illustrates what happens when the event is sent through the in terminal:


[1852] UTL_EDC allocates a new event that does not contain storage for the EDC value.


[1853] UTL_EDC calculates the CRC for the fields DA through DATA and compares it with the EDC stored at the end of the event.


[1854] If the EDCs match, the event is forwarded through the out terminal.


[1855] There is an error in the frame header. UTL_EDC sets the error flag in the event attributes and forwards the event through the out terminal.



UTL_EDLAT—Event Data Latch

[1856]
FIG. 49 illustrates the boundary of part, Event Data Latch (UTL_EDLAT)


[1857] 1. Functional Overview


[1858] UTL_EDLAT latches or queues either part or all of the data from the incoming events. Upon receiving a trigger event it emits a single event through out containing the latched/queued data. When used in the “latch” mode, only the data from the last event received before the trigger event is remembered and emitted; in the “queue” mode, the data from all events is concatenated (in the order it was received) and emitted upon the trigger event.


[1859] The offset and size of the data to latch from the incoming events are specified as either fixed values or taken from the event data itself (for variable sized events). If programmed to use variable offset/size (that is, retrieved from the event data itself), UTL_EDLAT can take this information from the data in any byte order—either the CPU's natural order or fixed MSB-first or LSB-first order. This feature can be used in processing network packets or other data with a fixed byte order that may or may not match the host CPU's natural byte order.


[1860] UTL_EDLAT can optionally reserve zero-initialized space in the events sent through out either before and/or after the latched data in the event.


[1861] UTL_EDLAT emits an event containing the latched data only when it receives the emit event on the in terminal. The IDs of the events used by UTL_EDLAT are controlled through properties.


[1862] 2. Boundary
1012.1 TerminalsNameDirInterfaceNotesininI_DRAINUTL_EDLAT latches the event data fromthe events received on this terminal. It alsoexpects the trigger event on this terminal.outoutI_DRAINWhen the specified trigger event is receivedthrough in, UTL_EDLAT emits an eventthrough this terminal containing the latched datacollected from the event(s) received through in.


[1863]

102











2.2 Properties


These properties control the behavior of UTL_EDLAT:









Property name
Type
Notes





latch_ev_id
uint32
ID of the incoming event on which to




latch data from. EV_NULL may be




specified to latch data from all incoming




events except for those specified as




emit_ev_id and clear_ev_id.




Default value is EV_NULL.


emit_ev_id
uint32
ID of the incoming event on which




UTL_EDLAT emits the latched data




event through the out terminal.




This property is mandatory.


clear_ev_id
uint32
ID of the incoming event on which




UTL_EDLAT clears the contents of




the data latch.




If EV_NULL, no event is recognized by




UTL_EDLAT to clear the data latch.




In this case, clear_on_emit should be




TRUE so UTL_EDLAT clears the latch




automatically.




Default value is EV_NULL.


out_ev_id
uint32
ID of the event sent through the out




terminal that contains the latched data.




This property is mandatory.


out_ev_attr
uint32
Attributes of the event containing the




latched data sent through the out terminal.




Default value is ZEVT_A_ASYNC.


out_prefix_sz
uint32
Number of bytes UTL_EDLAT inserts




before the latched data on events sent




through out. UTL_EDLAT zero initializes




the space added to the event.




Default is 0.


out_suffix_sz
uint32
Number of bytes UTL_EDLAT inserts




after the latched data on events sent




through out. UTL_EDLAT zero initializes




the space added to the event.




Default is 0.


clear_on_emit
uint32
Boolean. If TRUE, UTL_EDLAT clears




the contents of the data latch before




emitting the out_ev_id event through the




out terminal.




If FALSE, the data latch is cleared only




upon receiving a clear_ev_id event




through the in terminal.




Default value is TRUE.


send_empties
uint32
Boolean. If TRUE, UTL_EDLAT emits




an out_ev_id event even if no data has




been latched (an event with data size of




0 is emitted in this case).




If FALSE, UTL_EDLAT emits an




out_ev_id event only if data has been




latched from event(s) received through the




in terminal, otherwise the trigger event is




ignored.




Default value is FALSE.


append
uint32
Boolean. If TRUE, UTL_EDLAT appends




the latched data from the incoming events




to the current contents of the data latch




(“queue” mode).




If FALSE, UTL_EDLAT replaces the




latched data with the data from the




incoming event (“latch last” mode).




Default value is FALSE.










[1864] The following properties are used to specify the location of the data to be latched from the incoming events:
103Property nameTypeNoteslatch_offs.valuint32Data offset.Specifies the offset into the incoming event's datato take the data from (in bytes).Default is 0.latch_offs.val_neguint32Boolean. If TRUE, the offset is event size − thevalue of the latch_offs.val_neg property;otherwise, the offset is calculated from thebeginning of the event.The default is TRUE (up to and including the lastbyte in the event)latch_offs.use_flduint32TRUE to use a field value in the incoming event tocompute the data offset. If TRUE, UTL_EDLATadds the latch_offs.val property value to theoffset extracted from the event to calculate the dataoffset9.If this property is set to FALSE, UTL_EDLAT usesonly the latch_offs.val property to determinethe data latch location.Default is FALSE.latch_offs.fld_offsuint32Offset to the field in the incoming event used fordetermining the data offset (specified in bytes).The value in this field is not sign extended.This property is used only if latch_offs.use_fldis TRUE.Default is 0.latch_offs.fld_szuint32Specifies the size of the offset value field in theincoming event (specified in bytes).The size can be one of the following: 1, 2, 3, or 4.This property is used only if latch_offs.use_fldis TRUE.Default is 4 (size of uint32)latch_offs.fld_ordersint32Specifies the byte order in the offset field in theincoming event.Can be one of the following values: 0 Native machine format 1 MSB—Most-significant byte first(Motorola)−1 LSB—Least-significant byte first (Intel)This property is used only if latch_offs.use_fldis TRUE.Default is 0 (Native machine format).9This allows compensating any fixed offset that should be added to the value extracted from the event bus.


[1865] The following properties are used to specify the size of the data to be latched from the incoming events:
104Property nameTypeNoteslatch_sz.valuint32Data latch location size.Specifics the number of bytes which UTL_EDLATlatches from the incoming event.Depending on the latch_sz.from_end property, thesize is considered to be either the number of bytesfrom the data latch offset (latch_offs.xxx) or thenumber of bytes from the end of the event.If zero, no data is latched from the incoming events.Default value is 0.latch_sz.from_enduint32Boolean. If TRUE, the number of bytes latched fromthe event is calculated from the end of the event.If FALSE, the number of bytes latched from the eventis calculated from the specified offset(latch_offs.xxx).If latch_sz.val is 0 and latch_sz.from_end isTRUE, all the bytes from the specified offset(latch_offs.xxx) to the end of the event are latchedby UTL_EDLAT.Default value is FALSE.latch_sz.use_flduint32TRUE to use a field value in the incoming event for thelatch location size. Otherwise UTL_EDLAT usesonly the latch_sz.val property to determine thedata latch size.If TRUE, UTL_EDLAT also adds the latch_sz.valproperty value to the offset extracted from the eventto calculate the data latch size.Default is FALSE.latch_sz.fld_offsuint32Offset to the field in the incoming event used fordetermining the data latch size (specified in bytes).The value in this field is not sign extended.This property is used only if latch_sz.use_fld isTRUE.Default is 0latch_sz.fld_szuint32Specifies the size of the offset value field in theincoming event (specified in bytes).The size can be one of the following: 1, 2, 3, or 4.This property is used only if latch_sz.use_fld isTRUE.Default is 4 (size of DWORN)latch_sz.fld_ordersint32Specifies the byte order in the offset field in theincoming event.Can be one of the following values:Specifies the byte order in the offset field in theincoming event.Can be one of the following values: 0 Native machine format 1 MSB—Most-significant byte first (Motorola)−1 LSB—Least-significant byte first (Intel)This property is used only if latch_sz.use_fld isTRUE.Default is 0 (Native machine format).


[1866] 3. Events and Notifications


[1867] All event IDs recognized and emitted by UTL_EDLAT are specified as properties. In the table below, the names specified in parentheses correspond to the property name that defines a given event ID.
105EventDirBusNotes3.1 Terminal: in(latch_ev_id)in(any)Event on which UTL_EDLAT extractsthe specified data and saves it in the datalatch.(emit_ev_id)invoidEvent on which UTL_EDLAT emitsthe latched data through the out terminal.Event data is ignored.(clear_ev_id)invoidEvent on which UTL_EDLAT clears thedata saved in the data latch. Event data isignored.3.2 Terminal: out(out_ev_id)out(any)Event sent through the out terminal thatcontains the latched data saved byUTL_EDLAT.


[1868] 3.3 Special Events, Frames, Commands or Verbs


[1869] None.


[1870] 3.4 Encapsulated Interactions


[1871] None.


[1872] 4. Specification


[1873] 4.1 Responsibilities


[1874] Latch data from the incoming events and store it until the specified emit event is received. Send the latched data through the out terminal as an out_ev_id event with the proper attributes.


[1875] Calculate the event data latch location and size according to the parameterization; either use fixed values or the values specified in the event.


[1876] When determining the event data latch location and size by field value, convert the value using the proper byte order (as specified through properties).


[1877] If needed, insert space after the event header and/or after the latched data in the out_ev_id events sent through the out terminal.


[1878] Fail emit events (emit_ev_id) with ST_NO_ACTION if the data latch is empty and send_empties is FALSE.


[1879] Allocate and free the outgoing events according to the outgoing event attributes (ZEVT_A_SELF_OWNED).


[1880] 4.2 Theory of Operation


[1881] 4.2.1 State Machine


[1882] None.


[1883] 4.2.2 Main Data Structures


[1884] None.


[1885] 4.2.3. Mechanism



Latching Data from the Incoming Events

[1886] Upon receiving an event from the in terminal (latch_ev_id), UTL_EDLAT latches the data from event according to the latch location and size (as specified through properties).


[1887] The data latch location and size are calculated as follows and is summarized in the table below:
106val_neguse_fidFormaula00offset = latch_offs.val01offset = *latch_offs.fld_offs + latch_offs.val10offset = evt_sz(bp) − latch_offs.val11offset = *latch_offs.fld_offs − latch_offs.val


[1888] If latch_offs.val neg_is FALSE and latch offs.use_fld is FALSE, offset specified by latch_offs .val is calculated from the beginning of the event.


[1889] If latch_offs.val_neg is FALSE and latch_offs_use_fld is TRUE, the data latch offset is calculated by adding the value specified by latch_offs.val to the value specified in latch_offs.fld_offs


[1890] If latch_offs.val_neg is TRUE and latch_offs.use_field is FALSE, the offset specified by latch_offs .val is calculated from the end of the event.


[1891] If latch_offs. val_neg is TRUE and latch_offs. use_field is TRUE, the data latch offset is calculated by subtracting the value specified by latch_offs .val from the value specified in latch_offs. fld_offs.


[1892] If needed, UTL_EDLAT converts the value to use the native machine byte order.


[1893] If the calculated data latch size is larger than the size of the incoming event, all the data up until of the event is latched.


[1894] If the calculated data latch offset is larger than the size of the incoming event, UTL_EDLAT fails the event with ST_INVALID.


[1895] After determining the data to latch from the incoming event, UTL_EDLAT either appends the data to the current contents of the latch or replaces it (controlled through the append property). Note that initially the data latch is empty.


[1896] Note that the data is latched only from latch_ev_id events. If latch_ev_id is EV_NULL, data is latched from all the events received through in except for emit_ev_id and clear_ev_id.



Emitting the Latched Data Maintained by UTL_EDLAT

[1897] When UTL_EDLAT receives an emit_ev_id event through the in terminal, it sends an out_ev_id event through the out terminal, which contains the latched data. The attributes of the outgoing events are controlled through the out ev attr property.


[1898] Before sending the event with the latched data, if clear_on_emit is TRUE, UTL_EDLAT clears the contents of the data latch. If clear_on_emit is FALSE, the contents of the data latch remains and its up to the client of UTL_EDLAT to clear the latch by sending a clear_ev_id event to UTL_EDLAT.


[1899] If needed, UTL_EDLAT inserts space in the outgoing event after the event header and/or after the latched data (according to the out_prefix_sz and out_suffix_sz properties).


[1900] Note that if the send_empties property is FALSE and the latch is empty, UTL_EDLAT fails the emit event with ST_NO_ACTION.


[1901] UTL_EDLAT always returns ST_OK for the processing of the emit event except in the empty data latch case described above.


[1902] 5. Use Cases


[1903] The first use case uses UTL_EDLAT to concatenate strings of different lengths into one. The following latch event is used:
107EVENT (B_EV_STRING)char *strp; // pointer to a stringEND_EVENT


[1904] UTL_EDLAT is parameterized as follows:


[1905] a. latch_ev_id=EV_STRING


[1906] b. emit_ev_id=EV_EMIT


[1907] C. clear_on_emit=TRUE


[1908] d. append=TRUE


[1909] e. out_ev_id=EV_STRING


[1910] f. out_ev_attr=ZEVT_A_SELF_CONTAINED|ZEVT_A_SYNC


[1911] g. latch_offs.val=offsetof (B_EV_STRING, strp)


[1912] h. latch_sz.val=0


[1913] i. latch_sz.from_end=TRUE (latch string at end of the event)


[1914] The client of UTL_EDLAT sends an EV_STRING event through the in terminal containing the string “abc”.


[1915] UTL_EDLAT copies the data starting from strp to the end of the event into the data latch (the string “abc”).


[1916] The client of UTL_EDLAT sends another EV_STRING event through the in terminal containing the string “123”.


[1917] UTL_EDLAT appends the data starting from strp to the end of the event to the data latch (the string “123”).


[1918] The client of UTL_EDLAT sends an EV_EMIT event through the in terminal.


[1919] UTL_EDLAT allocates a new event (EV_STRING) and copies the latched data into it.


[1920] UTL_EDLAT clears the data latch and forwards the event through the out terminal.


[1921] The EV_STRING event sent through the out terminal contains the string “abc123”.


[1922] The second use case uses UTL_EDLAT to concatenate fragments of a message into one (i.e., chained messages in a network protocol). The length of each message is stored in the event in a separate field. The following latch event is used:
108typedef struct B_EV_MSG{dwordlen;// message lengthchar*msgp;// pointer to a message fragmentdwordedc;// error detection code for message}B_EV_MSG;


[1923] UTL_EDLAT is parameterized as follows:


[1924] a. latch_ev_id=EV_MSG


[1925] b. emit_ev_id=EV_EMIT


[1926] C. clear_on_emit=TRUE


[1927] d. append=TRUE


[1928] e. out_ev_id=EV_MSG


[1929] f. out_ev_attr=ZEVT_A_SELF_CONTAINED|ZEVT_A_SYNC


[1930] g. latch_offs.val=offsetof (B_EV_MSG, msgp)


[1931] h. latch_sz.val=0


[1932] i. latch_sz.from_end=FALSE


[1933] j. latch_sz.use_fld=TRUE


[1934] k. latch_sz.fld_offs=offsetof (B_EV_MSG, len)


[1935] l. latch_sz.fld_sz=szof (B_EV_MSG, len)


[1936] m. latch_sz..fld_order=1 (MSB format)


[1937] The client of UTL_EDLAT sends an EV_MSG event through the in terminal containing the first message fragment.


[1938] UTL_EDLAT copies the data starting from msgp. The length of the data is retrieved from the len field in the event. Before copying the data, UTL_EDLAT converts the len field to the native machine format. The data is stored in the data latch.


[1939] The client of UTL_EDLAT sends another EV_MSG event through the in terminal containing the second fragment of the message.


[1940] UTL_EDLAT appends the data starting from msgp to the data latch.


[1941] The client may send more message fragments until a complete message is constructed.


[1942] The client then sends an EV_EMIT event through the in terminal.


[1943] UTL_EDLAT allocates a new event (Ev_MSG) and copies the latched data into it.


[1944] UTL_EDLAT clears the data latch and forwards the event through the out terminal.


[1945] The EV_MSG event sent through the out terminal contains a complete message made up of all the message fragments that the client sent to UTL_EDLAT (the message data is in the same order as received from the client).



UTL_EDMRG—Event Data Merger

[1946]
FIG. 50 illustrates the boundary of part, Event Data Merger (UTL_EDMRG)


[1947] 1. Functional Overview


[1948] UTL_EDMRG caches one event received on the src terminal and pastes some or all of its data into the data buffer of the next event that comes on the in terminal, before forwarding the latter event to out. The “source” data is not re-used, once it is pasted into an event it is discarded and any new events coming on in pass to out undisturbed—therefore UTL_EDMRG should receive a new “source” event for each event on in that needs to have data pasted into it.


[1949] Depending on the attributes stored in the event received on the src terminal and UTL_EDMRG's parameterization, UTL_EDMRG may simply retain the pointer to the entire event bus (i.e., the event is self-owned) or copy the contents of the event into a private buffer. It must be noted here that if the event is self-owned, UTL_EDMRG performs a single memory copy in order to merge the data; otherwise two copies are performed. This may have a bearing on the efficiency of the system using this part if the amount of data being merged is quite large.


[1950] One or more instances of UTL_EDMRG can be used to add data to an un-initialized event generated by another part. NFY2, UTL_EDLAT and UTL_E2AR are examples of parts that can generate such events. In combination with other parts, it can also be used to break up the data carried by an event and re-assemble it in a different order.


[1951] 2. Boundary
1092.1 TerminalsNameDirInterfaceNotesininI_DRAINInput for events into which cached data is to bemerged with. The data is merged with the eventbefore the event is forwarded to the out terminal.outoutI_DRAINEvents received on the in terminal are forwardedto this terminal after data has been mergedinto them. If UTL_EDMRG does not have anycached data, events that are received on the interminal are forwarded out this terminalunmodified.srcinI_DRAINInput for events containing data that is tobe merged with the next event passing fromin to out.


[1952]

110











2.2 Properties









Property




name
Type
Notes





src_offs
uint32
Offset of data in source event received on the




src terminal to merge.




The default is sizeof (CMEVENT_HDR).


dest_offs
uint32
Offset in event bus received on the in terminal




where cached data is to be merged.




The default is sizeof (CMEVENT_HDR).


max_sz
uint32
Specifies the maximum amount of data to merge




in bytes. Note: the amount of data that




UTL_EDMRG merges is the minimum of




max_sz and the size of the event bus.




If 0 × ffffffff, merge all data from offset to end of




event bus. The default is 0 × ffffffff.


size_delta
sint32
Value that is added to max_sz in order




to alter the amount of data that is merged.




The default is 0.


cache_data
uint32
Boolean. If FALSE UTL_EDMRG will




only accept self-owned events on its src terminal.




It retains the pointer to the event received on its




src terminal and frees the event after merging




its data with an event received on the in terminal




or has received another event on its src terminal.




If TRUE, UTL_EDMRG copies the data of




all events received into a buffer of size max_sz +




size_delta regardless of the incoming event




attributes. When this property is TRUE,




the max_sz property should be set to a valid




value. Default is FALSE.










[1953] 3. Events and Notifications


[1954] UTL_EDMRG merges data from events received on its src terminal with events it receives on its in terminal regardless of the event ID.


[1955] 3.1 Special Events, Frames, Commands or Verbs


[1956] None.


[1957] 3.2 Encapsulated Interactions


[1958] None.


[1959] 4. Specification


[1960] 4.1 Responsibilities


[1961] If cache_data is TRUE, allocate a buffer of size max_sz+size_delta to be used to cache data that is to be merged.


[1962] Refuse to accept non-self-owned events on the src terminal when cache_data is FALSE.


[1963] Copy data from events received on src into private buffer when cache_data is TRUE; otherwise store pointer to event bus.


[1964] Copy cached data (if any) into the next event received on the in terminal and forward the modified event out the out terminal.


[1965] Discard cached data after it has been merged.


[1966] 4.2 Theory of Operation


[1967] 4.2.1 State Machine


[1968] UTL_EDMRG keeps state as to whether or not it currently has cached data.


[1969] 4.2.2 Mechanisms



Caching Data with no Currently Cached Data

[1970] When UTL_EDMRG receives an event on its src terminal and it does not currently have any cached data, it performs the following actions based on the event type:


[1971] If cache_data is FALSE and the event is self-owned, UTL_EDMRG stores the pointer to the event bus and returns ST_OK. If the event is not self-owned, UTL_EDMRG returns ST_REFUSE.


[1972] If cache_data is TRUE, UTL_EDMRG copies the data from the event into its private buffer, frees the event if it is self-owned, and returns ST_OK.



Caching Data with Currently Cached Data

[1973] When UTL_EDMRG receives an event on its src terminal and it currently has cached data that has not yet been merged, it performs the following actions:


[1974] If cache_data is FALSE and the event is self-owned, UTL_EDMRG frees the event bus that it had previously received and stores the pointer to the just received event bus and returns ST_OK. If the event is not self-owned, UTL_EDMRG returns ST_REFUSE.


[1975] If cache_data is TRUE, UTL_EDMRG copies the data from the event into its private buffer (overwriting any data that was previously stored), frees the event if it is self-owned, and returns ST_OK.



Merging Data

[1976] When UTL_EDMRG receives an event on its in terminal and does not currently have any cached data, it forwards the event out its out terminal unmodified.


[1977] If UTL_EDMRG has cached data, UTL_EDMRG copies the data to the event and forwards the modified event out the out terminal. If the data had been copied from a self-owned event, UTL_EDMRG frees the event bus.


[1978] 5. Use Cases


[1979] 5.1 Merging Data from Notification to Another Event


[1980] The most elementary use of UTL_EDMRG is when it is used to copy one or more contiguous fields from a notification it receives on its src terminal into another event.


[1981] 5.2 Merging Non-contiguous Data


[1982]
FIG. 51 illustrates an advantageous use of part, UTL_EDMRG


[1983] UTL_EDMRG can also be used with the Event Data Splitter to copy non-contiguous chunks of data into an event passing through UTL_EDMRG.



UTL_EDSPL—Event Data Splitter

[1984]
FIG. 52 illustrates the boundary of part, Event Data Splitter (UTL_EDSPL)


[1985] 1. Functional Overview


[1986] UTL_EDSPL splits the data received with each event that comes on in, generates two events out of the two pieces of data and sends them to the out1 and out2 terminals respectively.


[1987] The offset at which the incoming data is split is specified as either a fixed offset or is computed by adding a fixed offset to a value taken from the event data itself. If programmed to use variable offset, UTL_EDSPL can take this information from the data in any byte order—either the CPU's natural order or fixed MSB-first or LSB-first order. This feature can be used in processing network packets or other data with a fixed byte order that may or may not match the host CPU's natural byte order.


[1988] UTL_EDSPL can optionally reserve space in the events sent through out1 or out2 at the beginning and/or at the end of the event data.


[1989] 2. Boundary
1112.1 TerminalsNameDirInterfaceNotesininI_DRAINEach event received on this terminal is splitinto two events according to the specified offsetin the event.out1outI_DRAINv-table, cardinality 1The first event from the event split is sent throughthis terminal.out2outI_DRAINv-table, cardinality 1The second event from the event split is sentthrough this terminal.


[1990]

112











2.2 Properties









Property name
Type
Notes





offs
uint32
Split location offset.




Specifies the location where UTL_EDSPL




should split the incoming events (in bytes).




The first event from the split contains all




the bytes up to the specified offset.




Usually, the offset contains the size of the




desired event to be sent through




the out1 terminal.




Default is 0.


offsneg
uint32
Boolean. If TRUE, the offset is event




size − the value of the




offs property; otherwise,




the offset is calculated from




the beginning of the event.




The default is FALSE


attr_and_mask
uint32
Attributes that UTL_EDSPL should keep




in the events sent through the out1 and out2




terminals. After UTL_EDSPL splits




the event, the attributes for the two events




are determined by taking the




original attributes,




ANDing them with attr_and_mask




and ORing them with attr_or_mask.




Default is ˜ (ZEVT_A_ASYNC_CPLT |




ZEVT_A_COMPLETED).


attr_or_mask
uint32
Attributes that UTL_EDSPL should add to




the events sent through the out1 and out2




terminals. After UTL_EDSPL splits the




event, the attributes for the two




events are determined by taking




the original attributes, ANDing them




with attr_and_mask and ORing them with




attr_or_mask.




Default is ZEVT_A_SELF_OWNED.


out1_ev_id
uint32
Event lD of the event sent through the out1




terminal. If EV_NULL the event ID




is the same as the incoming event.




Default is EV_NULL.


out1_prefix_sz
uint32
Number of bytes UTL_EDSPL inserts




after the event header on events sent




through out 1.




UTL_EDSPL zero initializes




the space added to the event.




Default is 0.


out1_suffix_sz
uint32
Number of bytes UTL_EDSPL inserts




at the end of the event sent through out 1.




UTL_EDSPL zero initializes




the space added to the event.




Default is 0.


out2_ev_id
uint32
Event ID of the event sent through




the out2 terminal. If EV_NULL,




the event ID is the same as




the incoming event.




Default is EV_NULL.


out2_prefix_sz
uint32
Number of bytes UTL_EDSPL inserts




after the event header on events




sent through out2. UTL_EDSPL zero




initializes the space added to the event.




Default is 0.


out2_suffix_sz
uint32
Number of bytes UTL_EDSPL




inserts at the end of the event




sent through out2. UTL_EDSPL zero




initializes the space added to the event.




Default is 0.


send_empties
uint32
If FALSE, UTL_EDSPL discards




empty events (events with data size of 0)




from the event split. It does not send




them through the respective output.




UTL_EDSPL does not take the prefix




or suffix sizes into consideration




for empty events. Default is TRUE.







The following properties are used only if the split offset is taken


from the event data.









use_fld
uint32
TRUE to use a field value in the incoming




event for the split location offset.




Otherwise, UTL_EDSPL uses only the offs




property to determine the split location.




If TRUE, UTL_EDSPL also adds the offs




property value to the offset extracted




from the event to calculate the split




location10.




Default is FALSE.


fld_offs
uint32
Offset to the field in the incoming




event used for determining the split location




(in bytes). The value in this field is




not sign extended. This property is used




only if use_fld is TRUE.




Default is 0.


fld_sz
uint32
Specifies the size of the offset value field




in the incoming event (in bytes).




The size can be one of the following:




1, 2, 3, or 4. This property is used




only if use_fld is TRUE.




Default is 4 (size of uint32)


fld_order
sint32
Specifies the byte order in the offset




field in the incoming event.




Can be one of the following values:




0 Native machine format




1 MSB - Most-significant byte first




(Motorola)




−1 LSB - Least-significant byte first (Intel)




This property is used only if use_fld is




TRUE.




Default is 0 (Native machine format).








10
This allows compensating for any fixed offset that should be added to the value extracted from the event bus.









[1991] 3. Events and Notifications


[1992] UTL_EDSPL accepts any event on its input. The generated output events have the same ID as the input event.


[1993] 3.1 Special Events, Frames, Commands or Verbs


[1994] None.


[1995] 3.2 Encapsulated Interactions


[1996] None.


[1997] 4. Specification


[1998] 4.1 Responsibilities


[1999] Split the incoming event into two events. Send the first event through out1 and the second event through out2.


[2000] Calculate the event split location according to parameterization; either use a fixed offset or the offset specified in the event.


[2001] When determining where to split the event by field value, convert the offset value using the proper byte order (as specified through properties).


[2002] If needed, insert space after the event header and at the end of the events sent through the output terminals.


[2003] Modify the outgoing event's ID and attributes as parameterized.


[2004] Discard empty events if needed.


[2005] Allocate and free the outgoing events according to the outgoing event attributes (ZEVT_A_SELF_OWNED).


[2006] 4.2 Theory of Operation


[2007] 4.2.1 State Machine


[2008] None.


[2009] 4.2.2 Main Data Structures


[2010] None.


[2011] 4.2.3 Mechanisms



Splitting the Incoming Event

[2012] Upon receiving an event from the in terminal, UTL_EDSPL splits the event into two events according to split location.


[2013] The split location is calculated as follows:


[2014] If use_fld is FALSE, the offset is calculated using only the offs property. The offset is calculated from the beginning or the end of the event depending on whether the value is positive or negative.


Split=offs_neg? evt_sz(bp)−offs:offs


[2015] If use_fld is TRUE, UTL_EDSPL calculates the offset by retrieving the value of the specified field in the event and adding the offs property to that value. The location of the offset value in the event is controlled through the fld_offs and fld_sz properties. If needed, UTL_EDSPL converts the value to use the native machine byte order.


Split=offs_neg? *fld_offs−offs:*fld_offs+offs)


[2016] If the calculated split offset is larger than the size of the incoming event, the event is not split. In this case, UTL_EDSPL replicates the incoming events and only updates the event IDs and attributes as specified by its properties (the event is sent through the out1 terminal, an empty event is sent through out2).


[2017] After determining where to split the incoming event, UTL_EDSPL allocates two new events and copies the data from the original event (according to the split location). If the split location is 0, UTL_EDSPL generates an empty event through the out1 terminal and a replica of the incoming event through the out2 terminal.


[2018] If needed, UTL_EDSPL inserts space in the new events after the event header and at the end of the events (according to the out1_prefix_sz, out1_suffix_sz, out2_prefix_sz, and out2_suffix_sz properties).


[2019] Generating new events from the incoming event


[2020] After UTL_EDSPL splits the incoming event into two (as described above), it initializes the event IDs and attributes of the new events.


[2021] The event IDs are set according to the out1_ev_id and out2_ev_id properties. If these properties are EV_NULL, the IDs of both events are set to the ID of the incoming event that was split. Otherwise, the IDs are set according to the properties.


[2022] The attributes of the new events are initially set to the attributes specified in the incoming event. UTL_EDSPL then does a bit-wise AND between the attributes and the attr_and_mask. This removes unwanted attributes from the event. Next, UTL_EDSPL does a bit-wise OR between the attributes and the attr_or_mask; this adds new attributes to the event.


[2023] After the event IDs and the attributes are set in the two events, UTL_EDSPL sends the first event through out1 and the second event through out2. The second event may eventually be fed back into UTL_EDSPL to repeat the process (i.e., split an event into multiple events).


[2024] If UTL_EDSPL fails to send the first event through out 1, it returns the status (returned from the call) without sending the second event. The return status from the second event is propagated back to the caller.


[2025] Note that if the send_empties property is FALSE, and the size of the data to be transferred into an output event is 0, UTL_EDSPL will not send that event (note that the size of data copied into the event is what counts, not the actual size of the event—the latter may depend on the prefix_sz and suffix_sz properties).


[2026] 5. Use Cases


[2027] To illustrate the usage of UTL_EDSPL, the first two use cases below use the following structure definition used for defining a frame.
113STXDATAETX


[2028] The fields are defined as follows:


[2029] STX—Start of frame, fixed size, 2 bytes


[2030] DATA—frame data, variable size


[2031] ETX—End of frame, fixed size, 2 bytes


[2032] The use cases described below use UTL_EDSPL to separate the starting and ending sections of the frame from the rest of the frame.


[2033] 5.1 Split Incoming Event by Fixed Offset From the Beginning of Event


[2034] This use case splits the incoming event into two: one containing the start of the frame and the other containing the rest of the frame (data plus the end of the frame).


[2035] UTL_EDSPL is parameterized as follows:


[2036] a. off=size of STX field (2 bytes)


[2037] A frame is received (as an event) and is passed to UTL_EDSPL's in terminal. The event contains the structure described above.


[2038] UTL_EDSPL splits the event at offset 14 (after the STX field)—the boundary between STX and the rest of the frame.


[2039] The first event containing only the STX field is sent through the out1 terminal and is processed.


[2040] The second event containing the rest of the frame (DATA and ETX fields) is sent through the out2 terminal and is processed.


[2041] 5.2 Split Incoming Event by Fixed Offset From the End of Event


[2042] This use case splits the incoming event into two: one containing the start of the frame and the frame's data, the other containing only the end of the frame. For this use case, assume that the size of the data field in the frame is 8 bytes.


[2043] UTL_EDSPL is parameterized as follows:


[2044] a. offs=−2 (beginning of the ETX field from the end of the event)


[2045] A frame is received (as an event) and is passed to UTL_EDSPL's in terminal. The event contains the structure described above.


[2046] UTL_EDSPL splits the event at offset 22 (after the DATA field, 2 bytes from the end of the event)—the boundary between DATA and the end of the frame (ETX).


[2047] The first event containing the STX and DATA fields is sent through the out1 terminal and is processed.


[2048] The second event containing only the end of the frame (ETX field) is sent through the out 2 terminal and is processed.


[2049] 5.3 Split Incoming Event by Specified Offset in Event Field


[2050] This use case uses the following structure definition used for modifying and retrieving property values.
114LENNAMEDATA


[2051] The fields are defined as follows:


[2052] LEN—length of property name in bytes, 1 byte long, MSB


[2053] NAME—property name, LEN bytes long


[2054] DATA—the property value to be set or the retrieved value, variable length depending on property type


[2055] This use case splits the property name from its data using the LEN field in the event:


[2056] UTL_EDSPL is parameterized as follows:


[2057] a. offs=size of LEN field (1 byte)


[2058] b. use_fld=TRUE


[2059] c. fld_offs=0


[2060] d. fld_sz=1 byte


[2061] An event is received containing the above structure and is passed to UTL_EDSPL's in terminal.


[2062] UTL_EDSPL retrieves the value of the LEN field at offset 12 from the beginning of the event. The value is converted from MSB to LSB (assuming implementation is on an Intel-based machine).


[2063] UTL_EDSPL splits the event at the boundary between the NAME and DATA fields (by taking the value of the LEN field and adding it to the offs property value)


[2064] The first event containing the LEN and NAME fields is sent through the out1 terminal and is processed.


[2065] The second event containing only the DATA field is sent through the out2 terminal and is processed.



UTL—State Machines


UTL_ECNT—Event Counter

[2066]
FIG. 53 illustrates the boundary of part, Event Counter (UTL_ECNT)


[2067] 1. Functional Overview


[2068] UTL_ECNT is a state machine part used to count and consume events received on the in terminal until a predetermined number of events are reached—the next event is passed through. The number of events to be consumed is specified through a property. The number of the events consumed can be adjusted (in positive and/or negative direction) by modifying the value of an active time property.


[2069] UTL_ECNT recognizes the events to be counted by comparing the event ID with a value specified through a property. Unrecognized events can be forwarded out through the opposite terminal or completed with the status specified in the unknown_ret_s property. UTL_ECNT frees the self-owned event if the returned status (specified in ret_s or unknown_ret_s properties) is ST_OK. For compatibility reasons, UTL_ECNT exposes a property, which can force freeing the event memory regardless of the return status.


[2070] 2. Boundary
1152.1 TerminalsNameDirInterfaceNotesininI_DRAINv-table, infinite cardinality, floatingUTL_ECNT counts the events received on thisterminal and depending on the current count,either consumes the event or forwardsit through the out terminal.outoutI_DRAINv-table, cardinality 1UTL_ECNT forwards events received on inthrough this terminal if the eventcounter reaches a specific valueresetinI_DRAINv-table, infinite cardinality, floatingThe event received through this terminal isused to reset the current event counterto zero.


[2071]

116











2.2 Properties









Property Name
Type
Notes





count_ev_id
uint32
Event ID of the events to be counted.




EV_NULL - count all events ignoring the




event ID. Default is EV_NULL.


reset_ev_id
uint32
Reset Event ID.




Upon receiving of this event on the reset




terminal, the event counter (cur_count)




will be set to zero.




EV_NULL - any event can reset the




event counter.




Default is EV_NULL.


auto_reset
uint32
Boolean. When set to TRUE, the event




counter will be automatically




reset when the event counter




reaches its threshold specified in




max_count and count_offset.




When FALSE, the counter will continue to




increment after reaching its threshold.


Default is TRUE.


roll_over
uint32
Boolean. TRUE - specifies whether to




reset the event counter when it




goes above 0 × FFFFFFFF.




Default is FALSE.


curr_count
uint32
Read-only. Current value of the event




counter. Default is 0.


count_offset
int32
Active time. The value of this property is




added to the current counter




(curr_count) in order to calculate the




number of the events consumed by the




UTL_ECNT.


The default is 0.


max_count
uint32
Specifies the number of the events to be




consumed by UTL_ECNT: All events




for which the curr_count plus




count_offset is greater than max_count




will be forwarded through out terminal.




The default is 0 (all events will be




forwarded).


ret_s
uint32
The completion status (ST_xxx) for all




counted events that are consumed by




UTL_ECNT. Default is




ST_NO_ACTION.


pass_unknown
uint32
Boolean. When TRUE, all unrecognized




events (the event id does not match the




value specified in count_ev_id)are




forwarded through the out terminal.




Default is FALSE.


unknown_ret_s
uint32
The completion status (ST_xxx) for the




events which ID does not match the




count_ev_id.




Default is ST_NOT_SUPPORTED.


force_free
uint32
Boolean. Set to TRUE to free self-owned




events without regard of what ret_s value is.




Default: FALSE.










[2072] 3. Events and Notifications


[2073] UTL_ECNT accepts any Dragon event.


[2074] 3.1 Special Events, Frames, Commands or Verbs


[2075] None.


[2076] 3.2 Encapsulated Interactions


[2077] None.


[2078] 4. Specification


[2079] 4.1 Responsibilities


[2080] Count all recognized events coming on its in terminal.


[2081] Complete with status ret_s all events for which the cur_count plus count_offset is smaller than the max_count.


[2082] Reset the event counter cur_counter upon receiving of an reset_ev_id on its reset terminal.


[2083] When pass_unknown is set, forward all unrecognized events through out terminal.


[2084] When pass_unknown is clear, complete all unrecognized events with the status specified in unknown_ret_s.


[2085] For all consumed events, if necessary, free the memory allocated for self-owned events.


[2086] 4.2 Theory of Operation


[2087] 4.2.1 State Machine


[2088] None.


[2089] 4.2.2 Main Data Structures


[2090] None.


[2091] 4.2.3 Mechanisms



Passing the Events Out Through the ‘out’ Terminal.

[2092] When an event comes on in terminal, UTL_ECNT increments the event counter cur_count with one. If the event counter is equal to zero and roll over is not allowed (e.g., roll_over is FALSE), the previous value of cur_count is restored.


[2093] If cur_count plus count_offset11 is greater or equal to the max_count, the event is passed out through the out terminal.


[2094] If auto-reset is enabled (auto_reset is not FALSE) the current count (curr_count) is set to zero.


[2095] 4.3 Use Cases


[2096] None.


[2097]

11
Note that count_offset could have positive and negative values.



APP—Distributors


APP_LFS—Life-Cycle Sequencer

[2098]
FIG. 54 illustrates the boundary of part, Life-Cycle Sequencer (APP_LFS)


[2099] 1. Functional Overview


[2100] The primary function of APP_LFS is to distribute incoming life-cycle events received on in to the parts connected to the out1 and out2 terminals.


[2101] APP_LFS is identical to SEQ in regards to the event distribution functionality. APP_LFS distributes the EV_LFC_REQ_START and EV_LFC_REQ_STOP life cycle events. Additional events may be distributed by setting properties on APP_LFS. For more information about the event distribution, see the SEQ documentation.


[2102] 2. Boundary
1172.1 TerminalsNameDirInterfaceNotesinbiI_DRAINv-table, synchronous, cardinality 1Incoming events for distribution are receivedhere. All recognized events are distributedaccording to their discipline. All unrecognizedevents are passed though Unrecognized events(received from aux) are sent out thisterminal.out1biI_DRAINv-table, synchronous, cardinality 1Event distribution terminal.The distribution depends upon the disciplineof the event received on in.out2biI_DRAINv-table, synchronous, cardinality 1Event distribution terminal.The distribution depends upon thediscipline of the eventreceived on in.auxbiI13 DRAINv-table, synchronous, cardinality 1,floating Unrecognized events receivedfrom this terminal are passed out in.Unrecognized events received from inare passed out this terminal.


[2103]

118











2.2 Properties









Property name
Type
Notes





unsup_ok
uint32
If TRUE, a return status of ST_NOT_SUPPORTED




from the event distribution terminals out1 or out2 is




remapped to ST_OK.




Default is TRUE.


ev[0].ev_id-
uint32
Event IDs that APP_LFS distributes to out1 and


ev[8].ev_id

out2 when received on the in terminal.




The default values are EV_NULL.


ev[0].disc-
asciz
Distribution disciplines for ev[0].ev_id-


ev[8].disc

ev[8].ev_id, can be one of the following:









fwd_ignore



bwd_ignore



fwd_cleanup



bwd_cleanup











See the SEQ documentation for descriptions of the




disciplines.




The default values are fwd_ignore.


ev[0].cleanup_id-
uint32
Event IDs used for cleanup if the event distribution


ev[8].cleanup_id

fails.




The cleanup event is not sent if it is EV_NULL.




Cleanup events are used only if the distribution




discipline is fwd_cleanup or bwd_cleanup.




The default values are EV_NULL.










[2104] 2.4 Special Events, Frames, Commands or Verbs


[2105] None.
1192.3 Events and notificationsEventDirBusDescription2.3.1 Terminal: inEV_LFC_REQ_STARTInvoidThis event is sequenced with fwd_cleanupdiscipline. The cleanup event is EV_LFC_REQ_STOPEV_LFC_REQ_STOPInvoidThis event is sequenced with bwd_ignorediscipline.2.3.2 Terminal: outEV_LFC_REQ_STARToutvoidStart normal operationEV_LFC_REQ_STOPoutvoidStop normal operation


[2106] 2.5 Encapsulated Interactions


[2107] None.


[2108] 3. Specification


[2109] 3.1 Responsibilities


[2110] Sequence EV_LFC_REQ_START and EV_LFC_REQ_STOP life cycle events.


[2111] For all unrecognized events received from in, pass out aux without modification.


[2112] For all unrecognized events received from aux, pass out in without modification.


[2113] For all recognized events received from in, distribute them to out1 and out2 according to their corresponding discipline (parameterized through properties.


[2114] Allow both synchronous and asynchronous completion of the distributed events.


[2115] Fail the event distribution if a recognized synchronous event received on in is processed asynchronously by out1 or out2.


[2116] Track events and their sequences, ignoring events that come out-of-sequence (e.g., completion coming back through a terminal on which APP_LFS did not initiate an operation; or getting a new event through in while event distribution is in progress).


[2117] Do not process any new recognized events while event distribution is pending (return ST_BUSY).


[2118] If so configured, remap the status ST_NOT_SUPPORTED received from the event distribution to ST_OK.


[2119] 3.2 Theory of Operation


[2120] See the SEQ data sheet.



APP—Dynamic Structure


APP_ENUM—Instance Enumerator on Property Container

[2121]
FIG. 55 illustrates the boundary of part, Instance Enumerator on Property Container (APP_ENUM)


[2122] 1. Functional Overview


[2123] APP_ENUM is a dynamic structure part used to enumerate part instance information stored within an external property container or information source and generates ‘create’ and ‘destroy’ requests for each part instance upon receiving a ‘start’ and ‘stop’ trigger event respectively.


[2124] When a ‘start’ trigger event is received on its in terminal, APP_ENUM enumerates part instances, through the stg terminal, and for each instance found, it submits a ‘creation’ request out through the out terminal. The ‘creation’ request contains the class name of the part to be created and the part persistent name (a unique part instance identifier).


[2125] APP_ENUM saves the instance identifier that is returned on the ‘creation’ request. Upon receiving a ‘stop’ trigger event, APP_ENUM enumerates all created instances and for each of them, submits a ‘destroy’ request out through its out terminal.


[2126] APP_ENUM serializes the execution of ‘start’ and ‘stop’ events, i.e., any subsequent request to enumerate/de-enumerate part instances will be blocked until the previous request is completed.


[2127] The container used for instance enumeration can be an NVRAM, a file, a hardware bus or any instance information source.


[2128] APP_ENUM cannot be used at interrupt level due to the blocking mechanism used for serializing the events received on in terminal.


[2129] 2. Boundary
1202.1 TerminalsNameDirInterfaceNotesinInI_DRAINReceives life-cycle ‘start’ and ‘stop’ request upon whichAPP_ENUM submits requests for creation or destruction ofmultiple part instances.OutOutI_POLYSubmit requests to create or destroy part instances.stgOutI_PROPStorage container connection terminal. APP_ENUM calls thestorage container in order to enumerate or get part instanceinformation.


[2130]

121











2.2 Properties









Property name
Type
Notes





start_ev
uint32
Specifies the trigger event ID upon which the part




instances are enumerated and created.




The default value is EV_LFC_REQ_START.


stop_ev
uint32
Specifies the trigger event ID upon which all created




part instances are destroyed.




The default value is EV_LFC_REQ_STOP.


create_op
uint32
Specifies the operation number (one based) to be used




for part instance creation.




The allowed values are between 1 and 64.




Default value is 1. (first interface operation)


destroy_op
uint32
Specifies the operation number (one based) to be used




for part instance destruction.




The allowed values are between 1 and 64.




Default value is 2. (second interface operation)


save_id
uint32
Boolean. If TRUE. the part instance ID is saved in




‘<persistant name>.id‘ property in the property




container when the part instance is destroyed.




The default value is FALSE (do not save instance




IDs).


external_id
uint32
Boolean. If TRUE, the part instance IDs are generated




externally on create_op operation.




When FALSE, the part instance ID is extracted by




APP_ENUM form the property container and is




stamped in the create_op bus before sending the




operation out through out terminal.




The default value is TRUE (part instance ID is




provided externally).


bus_sz
uint32
Specifies the size of the operation bus used for part




instance creation or destruction.




This property is mandatory.


class_name.offs
uint32
Specifies the offset in the create_op bus, where the




part instance class name will be stored.




Default value is 0.


class_name.sz
uint32
Specifies the size of the class name field (in bytes).




Default value is 16.


persist_name.offs
uint32
Specifies the offset in the create_op bus where the




persistent name will be stored.




Default value is 0.


persist_name.sz
uint32
Specifies the size of the persistence name field (in




bytes).




Default value is 16.


id.offs
uint32
Offset of the part instance ID in the operation bus.




The size of the field specified by id.offs is specified




in id.sz property.




This property is mandatory.


id.sz
uint32
Specifies the size of the part instance ID (in bytes).




The allowed values are 1, 2, 3 and 4.




Default value is size of DWORD.


id.sgnext
uint32
Boolean. If TRUE, part instance IDs less than four




bytes are sign extended.




The default value is FALSE.


qry_string
asciz
Query string to use when enumerating part instances.




Default value is “*” (serialize all properties)










[2131]

122











3. Events and notifications


3.1 Terminal: in










Event
Dir
Bus
Notes





(start_ev)
in
any
Upon this event, APP_ENUM enumerates the part instances





through stg terminal and for each instance found, it submits





a ‘create’ operation out through out terminal.


(stop_ev)
in
any
Upon this event, APP_ENUM destroys instances for which





the ‘create’ operation was completed successfully.










[2132] 3.2 Special Events, Frames, Commands or Verbs


[2133] The part instance information stored in the property container, used by APP_ENUM for instance enumeration, have the following structure:
123FieldField Description<property name>Used as a persistent name for the newly created partinstance.Value of <property name>Used as a class name for the newly created part instance.Value ofUsed as an instance ID if gen_id is set to TRUE.<property name>.idThe part instance ID is stored in <property name>.id, ifsave_id is set to TRUE.Value ofNot used by APP_ENUM.<property name>.xxxNote: The type of the <property name> property is always ZPRP_T_ASCIZ. The type of the <property name>.id property is always ZPRP_T_UINT32.


[2134] 4. Environmental Dependencies


[2135] Due to the way APP_ENUM implements pointer arithmetic, APP_ENUM cannot be used in systems that a pointer cannot be represented as a single unsigned integer value with a size up to four bytes.


[2136] 4.1 Encapsulated Interactions


[2137] None.


[2138] 4.2 Other Environmental Dependencies


[2139] None.


[2140] 5. Specification


[2141] 5.1 Responsibilities


[2142] Enumerate all properties from the property container when ‘start’ event is received and generate a ‘create’ operation out the out terminal for each property returned.


[2143] For all successfully completed create_op operations, extract the part instance ID and store it in self.


[2144] Enumerate all part instance stored in self and generate a ‘destroy’ operation out the out terminal for each instance found.


[2145] Serialize the execution of ‘start’ and ‘stop’ events.


[2146] 5.2 External States


[2147] None


[2148] 5.3 Use Cases


[2149] 5.3.1 Processing of ‘start’ event


[2150] When a ‘start’ event is received on the in terminal, APP_ENUM performs the following actions:


[2151] Enumerate all properties form the property container attached to the stg terminal and for each property found:


[2152] Create an operation bus


[2153] Place the name of the property at persist_prop_offs within the operation bus


[2154] Place the value of the enumerated property at class_name_offs within the operation bus.


[2155] If external_id is FALSE, retrieve instance id from container and store in operation bus at id_offs.


[2156] Submit ‘create’ operation out through the out terminal


[2157] 5.3.2 Processing of ‘stop’ Event


[2158] When a ‘stop’ event is received on the in terminal, APP_ENUM performs the following actions:


[2159] Enumerate all created part instance and for each instance found


[2160] Submit a destroy_op operation out through the out terminal


[2161] If save_id is TRUE, save part instance ID in persistant_name.id property out the stg terminal.


[2162] 6. Typical Usage


[2163] 6.1 Dynamic Creation and Destruction of Multiple Part Instances


[2164] This example shows a simple way to create and destroy multiple instances upon one system event. All part instances are enumerated (discovered) from a property container and a part instance is created for each of the instances found.


[2165]
FIG. 56 illustrates Dynamic Creation and Destruction of a part Instance based on instance enumeration by property container


[2166] In this example, the instance enumeration is triggered by an event received on the control terminal (ctl). Upon that event, enum enumerates all properties in the property container (PRCREG). For each property found, it generates a ‘create’ request by putting the enumerated property name as part instance persistent name. The value of the enumerated property is placed at the position of the part instance class name. Finally, ‘create’ request is then sent out through enum's out terminal. This request is used by the part instance factory (fac) to create and activate the desired part instance. enum keeps the part instance ID for all successfully created instances until a ‘stop’ event is received on its in terminal.


[2167] When a ‘stop’ event is received on the control terminal, enum issues a ‘destroy’ request for each of the successfully created part instances. If necessary, the instance context information of the active instances can be stored back in the Property Container.


[2168] 7. Document References


[2169] None.


[2170] 8. Unresolved Issues


[2171] None.



APP_FAC—Part Instance Factory

[2172]
FIG. 57 illustrates the boundary of part, APP_FAC


[2173] 1. Functional Overview


[2174] APP_FAC is a dynamic structure part that can be used to dynamically create and destroy part instances based on an execution flow. APP_FAC generates and sequences part factory operations through the fact terminal when certain operations (e.g., ‘create’ and ‘destroy’) are invoked on its in terminal.


[2175] When a request to ‘create’ a part instance is received on its in input, APP_FAC creates and activates the part through its fact terminal. In addition, APP_FAC extracts the part unique identifier (persistent name) from the ‘create’ operations and sets it on the just-created part instance as properties through its prop terminal. The property ‘set’ operation is executed after successful ‘create’ operation but before the part instance is activated. Up to eight additional parameters can be extracted from the ‘create’ operation bus and set as properties to the newly created part instance. When the part instance is activated, APP FAC forwards the creation operation out through its out terminal.


[2176] When a request to ‘destroy’ a part instance is received on APP_FAC's input, APP_FAC forwards the request through its out terminal, deactivates and destroys the specified part. APP_FAC serializes the execution of ‘create’ and ‘destroy’ operations, i.e., any subsequent request for creation/destruction of a part instance will be blocked until the previous request is completed.


[2177] APP_FAC can be used at interrupt level as long as no part creation/destruction is invoked. Using part creation/destruction functionality at interrupt level may lead to unpredictable results.


[2178] Note that APP_FAC cannot be used with I_DRAIN interface or any other single operation interface.


[2179] 2. Boundary
1242.1 TerminalsNameDirInterfaceNotesinInI_POLYAll operations received on this terminal are forwarded throughthe out terminal. One or more part factory operations may begenerated through the fact and prop terminals either beforeor after the request is forwarded.outOutI_POLYOutput for the operations received on in terminal.factOutI_FACTOutput for part factory operations.propOutI_PROPOutput for property set or property get operations.


[2180]

125











2.2 Properties


This section identifies all public properties exposed on the APP_FAC boundaries.









Property name
Type
Notes





create_op
uint32
Specifies the operation number (one based) that




results in a part instance being created and




activated through the fact terminal.




The allowed values are between 1 and 64.




Default value is 1. (first interface operation)


destroy_op
uint32
Specifies the operation number (one based) that




results in a part instance being deactivated and




destroyed through the fact terminal.




The allowed values are between 1 and 64.




Default value is 2. (second interface operation)


bus_sz
uint32
Specifies the size of the operation bus received on




in terminal.




This property is mandatory.


class_name.dflt
asciz
The class name to use when creating




part instances in case the class name is not provided




with the ‘create’ event.




If the value of this property is not an empty string,




class_name.xxx properties are used in order to




extract the class name from the property bus.




The default value is “” (extract the class name




from the bus)


class_name.offs
uint32
If class_name.dflt is an empty string, specifies the




offset in the create_op bus (received on the in




terminal) of the class name to use when creating




part instances.




Default value is 0. (first field of the operation




bus)


class_name.by_ref
uint32
Boolean. Used only if class_name.dflt is an empty




string,




If TRUE, the data at class_name.offs contains a




pointer, to the part instance class name.




If FALSE, the part instance class name is




self-contained in the operation bus.




The default value is FALSE. (class name is




contained in the bus)


persist_name.prop
asciz
Specifies the property name, inside of the newly




created part instance, in which the persistence




name will be stored.




When empty string, no persistence name is




specified for the part.




The default value is “”


persist_name.sz
uint32
Specifies the size of the persistent name field in




the incoming create_op operation bus.




The default value is 0


persist_name.offs
uint32
If persist_name.by_ref is FALSE, specifies the




offset in the create_op bus of the persistent




name to be set on the newly created part instance.




Note that the persistent name is set as a property




to the newly created part.




Default value is 0 (persistent name and class




name of the part are the same12).


persist_name.ptr_offs
uint32
If persist_name.by_ref is TRUE, specifies the




location in the create_op bus of the pointer to




the persistent name.




Note that the persistent name is set as a property




to the newly created part.




Default value is 0.


persist_name.by_ref
uint32
Boolean.




If TRUE, the data at persist_name.ptr_offs




contains a pointer, to the persistent part name




string.




If FALSE, the persistent part name is contained in




the operation bus at persist_name.offs offset.




The default value is FALSE. (persistent name is




contained in the bus)


gen_id
uint32
Boolean. If TRUE, the part instance ID returned




is generated by the creator of the part. i.e., the




part instance ID is returned on factory create




operation sent out through APP_FAC's fact




output.




If FALSE, the incoming create_op operation




contains the ID to be used as an instance identifier




when creating the part.




The default value is TRUE.


id.sz
uint32
Size of the part instance ID.




The allowed values are 1, 2, 3 and 4.




Default value is sizeof (uint32).


id.sgnext
uint32
Boolean. If TRUE, part instance IDs less than




four bytes are sign extended.




The default value is FALSE.


id.offs
uint32
Offset of storage in operation bus for part




instance ID.




The default value is 0×0 (beginning of the event)








12
Note that persistence name can be equal to the class name only if ZP_FAC is used for creating one instance per part class. The persistence name for a part instance have to be unique for the set of part instances created by the ZP_FAC.









[2181] The following table describes the APP_FAC properties specifying how to extract the part instance parameters from the incoming create_op operation bus and set the extracted data as properties on newly created part.
126Property nameTypeNotesparam1.prop_nameascizProperty name in the newly created part instance,. . .which will receive the parameterization dataparam8.prop_namecontained within the create_op operation bus.When empty, no property is set.The default value is “”. (no property is set)param1.prop_typeuint32Type [ZPRP_T_xxx] of the part instance. . . property, which will be set with the value of theparam8.prop_typedata parameter extracted from the incomingcreate_op operation bus.The default value is ZPRP_T_NONE.param1.data_typeuint32Data type [DAT_T_xxx] of the data parameter to. . .be extracted from the incoming create_opparam8.data_typeoperation bus and set as a property on the newlycreated part.The default value is DAT_T_NONE.param1.var_szuint32Boolean.. . .If TRUE, the length of the value to extract fromparam8.var_szthe incoming operation has a variable sizespecified through the paramy.len.xxxproperties.If FALSE, the value has a constant size specifiedthrough val.sz property.The default value is FALSE (the length isconstant).param1.val.by_refuint32Boolean.If TRUE, the value to extract from the operationparam8.val.by_refis identified by a reference pointer containedwithin the operation bus. The offset of thereference pointer is specified byparamy.val.ptr_offs property.If FALSE, the value is contained within the event.The offset of the value is specified byparamy.val.offs property.The default value is FALSE (the value iscontained within the event).param1.val.ptr_offs13uint32When the paramy.val.by_ref property is. . .TRUE, this property specifies the location (in theparam8.val.ptr_offsincoming operation) of the pointer to the valuethat APP_FAC extracts from the operation.The default value is 0 (first field of the event).param1.val.offsuint32When the paramy.val.by_ref property is. . .FALSE, this property specifies the location (inparam8.val.offsthe incoming operation) of the pointer to thevalue that APP_FAC extracts from the operation.The default value is 0 (first field of the event).param1.val.szuint32When the paramy.var_sz property is FALSE,. . .this property specifies the length (specified inparam8.val.szbytes) of the value in the incoming operationidentified by paramy.val.offs.The default value is 4 (size of DWORD)param1.val.ordersint32Specifies the byte order of the value that is to be. . .extracted (identified by paramy.val.offs) fromparam8.val.orderthe incoming operation.Can be one of the following values:0 -Native machine format1 -MSB-Most-significant byte first(Motorola)−1 -LSB-Least-significant byte first (Intel)This property is valid for only integral values.The default value is 0 (Native machine format).param1.val.sgnextuint32Boolean.. . .If TRUE, integral values smaller than 4 bytes areparam8.val.sgnextsign extended before the extracted value isoperated on using the paramy.val.mask andparamy.val.shift properties.This property is valid for only integral values.The default value is FALSE. (no sign extension)param1.val.maskuint32Mask that is bit-wise ANDed with the extracted. . .value before sending it out through prop terminalparama8.val .maskas a property.This property is valid for only integral values.The default value is 0×FFFFFFFF (no valuechange).param1.val.shiftuint32Number of bits to shift the extracted value before. . .sending it out through prop terminal as aparam8.val.shiftproperty.If the value is positive (greater than 0), the valueis shifted to the right. If the value is negative(lesser than 0), the value is shifted to the left.This property is valid for only integral values.The default value is 0 (no change)13Note that the reference pointer is always stored in the processor native format. Its size may vary, depending on the system implementation.


[2182] The following properties are used to specify where the value length is stored in the incoming event. These properties are used only if the var_sz property is TRUE (variable size data values).
127PropertynameTypeNotesparam1.len.by_refuint32Boolean....If TRUE, the storage in the incomingparam8.len.by_refoperation for the length of the value toextract is identified by a referencepointer contained within the event.The offset of the length pointer (in theevent) is specified byparamy.len.ptr_offs property.If FALSE, the storage for the valuelength is contained within the event.The offset of the storage is specifiedby the paramy.len.offs property.The default value is FALSE (the storageis contained within the event).param1.len.ptr_offs14uint32When the paramy.len.by_ref property...is TRUE, paramy.len.ptr_offs specifiesparam8.len.ptr_offsthe location (in the incoming event) ofthe pointer to where the value length isstored.The default value is 0 (first field of theevent).param1.len.offsuint32When the paramy.len.by_ref property...is FALSE, paramy.len.offs specifiesparam8.len.offsthe location (in the incoming event) atwhich the value length is stored.The default value is 0 (first field of theevent).param1.len.szuint32Specifies the size of the field used to...store the value length. The length fieldparam8.len.szis specified through theparamy.len.ptr_offs or paramy.len.offsproperties.The size can be one of the following: 1,2, 3, or 4.The default value is 4 (size ofDWORD)param1.len.ordersint32Specifies the byte order of the value...length. The length field is specifiedparam8.len.orderthrough the paramy.len.ptr_offsor paramy.len.offs properties.Can be one of the following values:0 -Native machine format1 -MSB-Most-significant byte first(Motorola)−1 -LSB-Least-significant byte first(Intel)The default value is 0 (Native machineformat).param1.len.maskuint32Mask that is bit-wise ANDed with the...length value.param8.len.maskThe default value is OxFFFFFFFF (nolength change).param1.len.shiftsint32Number of bits to shift the value length....If the value is positive (greater than 0),param8.len.shiftthe value is shifted to the right. If thevalue is negative (lesser than 0), thevalue is shifted to the left.The default value is 0 (no change)14 Note that the reference pointer is always stored in the processor native format. Its size may vary, depending on the system implementation.


[2183] 3. Events and Notifications


[2184] None.


[2185] 4. Environmental Dependencies


[2186] None.


[2187] 4.1 Encapsulated Interactions


[2188] None.


[2189] 4.2 Other Environmental Dependencies


[2190] None.


[2191] 5. Specification


[2192] 5.1 Responsibilities


[2193] Pass all operation calls on the in terminal out through the out terminal.


[2194] Create, parameterize, and activate a part instance out the fact and prop terminals when create_op operation is received on the in terminal.


[2195] Deactivate and destroy a part instance out the fact terminal when destroy_op operation is received on the in terminal.


[2196] Serialize the creation and destruction of the part instances.


[2197] 5.2 External States


[2198] None


[2199] 5.3 Use Cases


[2200] 5.3.1 Create Part Instances


[2201] When a create_op operation is received on the in terminal, APP_FAC perform the following operations before forwarding it through the out terminal:


[2202] Extract the part instance class name from the operation bus;


[2203] Create an part instance of the specified class by submitting factory create request out through fact terminal;


[2204] Extract persistent instance name from the creation operation and set it as a property on the newly created part instance by submitting a property set request out through prop terminal;


[2205] Extract up to eight properties from the creation operation and set them as properties on the newly created part instance by submitting a property set request out through prop terminal;


[2206] Activate the part instance by submitting factory activate request out through fact terminal.


[2207] 5.3.2 Destroying Part Instances


[2208] When a destroy op_operation is received on the in terminal, APP_FAC performs the following operations after forwarding it through out terminal:


[2209] Deactivate the part instance by submitting factory deactivate request out through fact terminal;


[2210] Destroy the part instance by submitting factory destroy request out through fact terminal;


[2211] 6. Typical Usage


[2212] 6.1 Dynamic Creation and Destruction of a Part Instance


[2213] Part Instance factory (APP_FAC) provides the functionality to dynamically create and destroy part instances within the Instance Container in response to external events.


[2214]
FIG. 58 illustrates instance creation by a factory upon receiving of a creation request


[2215] When the creation request (e.g., create_op) is received on the i2 terminal, APP_FAC extracts from the request the data necessary to construct the instance class. Then it creates a part instance through ARR's fact terminal. Any additional parameterization arguments (paramy.xxx) in the request are set as properties on the newly created part instance through fact's prop terminal. After the part instance is activated, the original request and any subsequent requests are forwarded to the created instance through i2 terminal.


[2216] When a destroy instance request (destroy_op) is received, fac forwards the request to the specified instance and then it deactivates and destroys the instance through the ARR's fact terminal.


[2217] Note that when a request is distributed to any of the part instances it carries an identifier that uniquely specifies the actual recipient (part instance ID). The connection multiplexers (CDM/CDMB) extract the identifier from the incoming request and dispatch the request to the corresponding part instance.


[2218] 7. Document References


[2219] None.


[2220] 8. Unresolved Issues


[2221] None.



APP_LFCCTL—Life cycle Controller

[2222]
FIG. 59 illustrates the boundary of part, APP_LFCCTL


[2223] 1. Functional Overview


[2224] APP_LFCCTL is a dynamic structure part used to control and maintain the life cycle of a single part instance.


[2225] In response to receiving a life cycle event on the in terminal, APP_LFCCTL implements a sequence of operations out its fac, ctl, and lfc terminals necessary to control the life cycle of the part instance. The sequence of operations include:


[2226] Creation, destruction, activation, and deactivation of the part via the fac terminal


[2227] Generation of events out the ctl terminal to control the parameterization and persistent state of the part instance


[2228] Generation of life cycle events out the lfc terminal.


[2229] In addition to the life cycle start and stop events, APP_LFCCTL accepts a special “run” event and soft and hard reset events on the in terminal.


[2230] The “run” event is used to perform the normal operation of a system. APP_LFCCTL can be parameterized to block this event until a life cycle stop event is received or it can consume the event immediately and return.


[2231] The soft and hard reset events cause APP_LFCCTL to reset the part instance. The resetting of the part instance may include stopping, re-parameterizing, and restarting the part instance in the case of a soft reset or stopping and completely destroying the part instance in the case of a hard reset. The hard-reset request is also forwarded through the ctl terminal to trigger the hard reset (e.g., reboot) of the system. Note that the rebooting of the system is handled outside of APP_LFCCTL.


[2232] All event Ids and data necessary to create the part instance are specified through properties.


[2233] APP_LFCCTL is typically used to control and maintain the life cycle of the top-most assembly of a Dragon application or system. APP_LFCCTL is usually used in conjunction with APP_CFGM in order to maintain the persistent state of the application's assembly.


[2234] APP_LFCCTL's terminals are guarded and cannot be used in interrupt contexts.


[2235] 2. Boundary
1282.1 TerminalsNameDirInterfaceNotesininI_DRAINThis terminal is used to start and stop thesystem in which APP_LFCCTL is used.It is also used to perform soft and hard systemresets.lfcPlugI_DRAINAPP_LFCCTL generates life cyclestart and stop events through this terminal.facoutI_FACTAPP_LFCCTL uses this terminal to create,activate, deactivate and destroy theparameterized part.ctloutI_DRAINAPP_LFCCTL generates eventsthrough this terminal to serialize andde-serialize persistent configuration parametersof the system in which APP_LFCCTL is used.


[2236]

129











2.2 Properties









Property name
Type
Notes





part.class_nm
uint32
Pointer to the name of the part class




which APP_LFCCTL instantiates




through the fac terminal.




If the part class is “” (empty string),




the default class name is used. The




default class name is defined by the




part connected to APP_LFCCTL's




fac terminal.




APP_LFCCTL passes the value of




this property as a parameter on the




create operation invoked through the




fac terminal.




APP_LFCCTL can control the life




cycle of only one part instance at a




time.




The default value is “” (use the




default class name).


part.gen_id
uint32
Boolean. TRUE to generate a unique




ID for the part instance. FALSE to




use the specified ID (part.id) as the




instance identifier for the part




instantiated through the fac terminal.




APP_LFCCTL passes the value of




this property as a parameter on the




create operation invoked through the




fac terminal.




The default value is TRUE (generate




part ID).


part.id
uint32
Part instance identifier to use for the




part instantiated through the fac




terminal. This property is used only if




part.gen_id is FALSE.




APP_LFCCTL passes the value of




this property as a parameter on the




create operation invoked through the




fac terminal.




The default value is 0.


id_offs
uint32
Offset in the outgoing event bus




passed through the ctl terminal to




the field that contains the part




instance ID that identifies the part




instantiated by APP_LFCCTL




(specified in bytes).




If −1, outgoing events passed through




the ctl terminal do not contain




the part instance ID. APP_LFCCTL




remembers the part instance identifier




and stamps it into the outgoing events




at the specified offset.




The part ID is stamped only into




configuration related requests




(EV_CFG_REQ_xxx) sent




through the ctl terminal.




The default value is −1 (no part ID




field is used).


gen_save_lkg
uint32
Boolean. If TRUE, APP_LFCCTL




generates an




EV_CFG_REQ_SAVE_LKG




event through the ctl terminal if the




specified part is successfully




instantiated and parameterized with




its configuration settings.




If FALSE, APP_LFCCTL does not




generate the




EV_CFG_REQ_SAVE_LKG




event.




The default value is TRUE.


start_ev_id
uint32
ID of the life cycle start trigger event




received through the in terminal.




The default value is




EV_LFC_REQ_START.


stop_ev_id
uint32
ID of the life cycle stop trigger event




received through the in terminal.




The default value is




EV_LFC_REQ_STOP.


run_ev_id
uint32
ID of the “run” event received




through the in terminal.




If EV_NULL, no “run” event is




used.




The default value is EV_NULL.


block_run_ev
uint32
Boolean. TRUE to block the run




event until a life cycle stop or




hard-reset request is received. If




FALSE, the run event is completed




immediately with ST_OK.




The default value is FALSE.


req_hard_reset_ev_id
uint32
ID of the trigger event used to




perform a hard reset on the system




in which APP_LFCCTL is used.




If EV_NULL, hard resets are not




used.




The default value is EV_NULL (not




used).


req_soft_reset_ev_id
uint32
ID of the trigger event used to




perform a soft reset on the system




in which APP_LFCCTL is used.




If EV_NULL, soft resets are not




used.




The default value is EV_NULL (not




used).










[2237]

130











3.1 Terminal: in










Event
Dir.
Bus
Notes





(start_ev_id)
in
any
When this event is received, the specified





part is created, parameterized and activated.





After successful activation, APP_LFCCTL





generates an EV_LFC_REQ_START request





through the lfc terminal.





If the specified part started successfully and





the gen_save_lkg property is TRUE,





APP_LFCCTL generates an





EV_CFG_REQ_SAVE_LKG event through the





ctl terminal.





If any of the operations performed by





APP_LFCCTL fails, APP_LFCCTL fails





the start event.


(stop_ev_id)
in
any
When this event is received, APP_LFCCTL





stops the specified part by generating an





EV_LFC_REQ_STOP request through the lfc





terminal.





Next, APP_LFCCTL deactivates the part





and generates an EV_CFG_REQ_SERIALIZE





request that triggers the serialization of the





part's persistent state.





Lastly, APP_LFCCTL destroys the part





instance through the fac terminal.





If a run event is currently blocked,





APP_LFCCTL unblocks the event and





completes it with ST_OK.


(req_hard_reset_ev_id)
in
any
This event triggers a hard reset of the





system in which APP_LFCCTL is used.





When this event is received, APP_LFCCTL





performs all of the same operations as when





it receives a stop ev_id_event.





Afterwards, APP_LFCCTL passes the





event through the ctl terminal, which





triggers the hard reset of the system.





The hard reset event is desynchronized





inside of APP_LFCCTL to allow the thread





execution to return back to the generator of





the event before the hard reset actually





occurs. Care must be taken if the instance





maintained by APP_LFCCTL is the one





who sends this event. The instance should





not complete the life cycle stop request if a





hard reset request it generated has not





completed. This will guarantee that it is





safe to destroy the instance after stopping it





without crashing the system.


(req_soft_reset_ev_id)
in
any
This event triggers a soft reset of the system





in which APP_LFCCTL is used.





APP_LFCCTL stops and de-serializes the





persistent state of the part maintained





through the fac terminal. It then





deactivates the part. Next, APP_LFCCTL





re-parameterizes, activates and starts the





specified part.







3.2 Terminal: lfc










EV_LFC_REQ_START
out
any
This event is generated by APP_LFCCTL after the





specified part is created, parameterized and





activated successfully.


EV_LFC_REQ_STOP
out
any
This event is generated by APP_LFCCTL before





the specified part is deactivated and destroyed.







3.3 Terminal: ctl


The EV_CFG_XXX events are defined in e_cfg.h.










EV_CFG_REQ_SERIALIZE
out
any
This event is used to save the persistent





state of the specified part.





This event is generated by APP_LFCCTL





after the specified part is deactivated and





before it is destroyed on life cycle stop.


EV_CFG_REQ_DESERIALIZE
out
any
This event is used to restore the persistent





state of the specified part from the “last





saved” configuration.





This event is generated by APP_LFCCTL





after the specified part is created on life





cycle start.


EV_CFG_REQ_SAVE_LKG
out
any
This event is generated by APP_LFCCTL





in order to create a backup copy of the





serialized state of the part instantiated





through the fac terminal.





This event is generated when the life cycle





start event is successfully completed





through the lfc terminal and when the





gen_save_lkg property is TRUE.


EV_CFG_REQ_USE_LKG
out
any
This event is generated by APP_LFCCTL





in order to restore the persistent state of the





part created through the fac terminal using





the “last known good” configuration.





This event is generated when





APP_LFCCTL fails to restore the





persistent state using the “last saved”





configuration.


EV_CFG_REQ_USE_FAC_DFLT
out
any
This event is generated by APP_LFCCTL





in order to restore the persistent state of the





part created through the fac terminal using





the “factory defaults” configuration.





This event is generated when





APP_LFCCTL fails to restore the





persistent state using both the “last saved”





and “last known good” configurations.


(req_hard_reset_ev_id)
out
any
This event is generated by APP_LFCCTL





when it needs to issue a hard reset of the





system in which it is running.










[2238] 4. Environmental Dependencies


[2239] 4.1 Encapsulated Interactions


[2240] None.


[2241] 4.2 Other Environmental Dependencies


[2242] None.


[2243] 5. Specification


[2244] 5.1 Responsibilities


[2245] Upon receiving a start_ev_id request through the in terminal: execute the following operations in order:


[2246] 1 .Create the specified part through the fac terminal.


[2247] 2. Generate an EV_CFG_REQ_DESERIALIZE event through the cfg terminal to de-serialize the persistent state of the part instance.


[2248] 3. If the de-serialization fails, generate an EV_CFG_REQ_USE_LKG event through the cfg terminal. If the de-serialization from the “last known good” configuration fails, generate an EV_CFG_REQ_USE_FAC_DFLT event through the cfg terminal. If the de-serialization from the “factory defaults” configuration fails, fail the start request.


[2249] 4. Activate the part instance through the fac terminal.


[2250] 5. If the activation fails, re-parameterize the part instance by generating either EV_CFG_REQ_USE_LKG or EV_CFG_REQ_USE_FAC_DFLT depending on which configuration was used in step C. If no configuration works with the part instance, fail the start request.


[2251] 6. Generate an EV_LFC_REQ_START request through the lfc terminal.


[2252] 7. If the start request fails, re-parameterize the part instance by generating either EV_CFG_REQ_USE_LKG or EV_CFG_REQ_USE_FAC_DFLT depending on which configuration was used in step C and E. If no configuration works with the part instance, fail the start request.


[2253] 8. If gen_save_lkg is TRUE, generate an EV_CFG_REQ_SAVE_LKG request through the ctl terminal.


[2254] If any of the above operations fail, perform cleanup of previously executed operations and fail the start request.


[2255] Upon receiving a stop_ev_id request through the in terminal: execute the following operations in order:


[2256] 1. Generate an EV_LFC_REQ_STOP request through the lfc terminal.


[2257] 2. Deactivate the part instance through the fac terminal.


[2258] 3. Generate an EV_CFG_REQ_SERIALIZE event through the cfg terminal to serialize the persistent state of the part instance.


[2259] 4. Destroy the part instance through the fac terminal.


[2260] 5. If a run event is currently blocked, unblock the event and complete the event with ST_OK.


[2261] Ignore errors in all of the above operations.


[2262] If a run event is received through the ctl terminal, either block the event until a life cycle stop event is received or complete the event immediately with ST_OK.


[2263] Upon receiving a req_hard_reset_ev_id request through the in terminal, perform the same operations as in the second responsibility. Finally, pass the event through the ctl terminal. Ignore any incoming events after a hard reset is performed.


[2264] Upon receiving a req_soft_reset_ev_id request through the in terminal, perform the same operations as in the second and first responsibilities except do not destroy or re-create the part instance.


[2265] For all events and requests generated through the ctl terminal, stamp the part instance ID into the specified field in the event if parameterized to do so.


[2266] Complete incoming start and stop requests synchronously.


[2267] Desynchronize incoming hard reset requests.


[2268] Fail all unrecognized events received through the in terminal with ST_NOT_SUPPORTED.


[2269] 5.2 External States


[2270] None.


[2271] 6. Use Cases


[2272]
FIG. 60 illustrates an advantageous use of part, APP_LFCCTL


[2273] 6.1 Starting a System Using APP_LFCCTL


[2274] This use case describes how APP_LFCCTL is used to start a system.


[2275] The system is created, connected and activated.


[2276] Part A sends a life cycle start request to APP_LFCCTL.


[2277] APP_LFCCTL creates the parameterized part by invoking the create operation through the fac terminal. The part array ARR creates Part C and returns.


[2278] Depending on how APP_LFCCTL is parameterized, the part instance ID is either generated by ARR or it is specified as a constant.


[2279] APP_LFCCTL generates an EV_CFG_REQ_DESERIALIZE event through the cfg terminal to de-serialize the persistent state of the part instance. This event is received by Part B which parameterizes Part C using properties stored in some external storage (“last saved” configuration).


[2280] APP_LFCCTL activates the part instance by invoking the activate operation through the fac terminal. ARR activates Part C.


[2281] APP_LFCCTL generates an EV_LFC_REQ_START request through the lfc terminal. Part C receives this request and returns ST_OK.


[2282] If the gen_save_lkg property is TRUE, APP_LFCCTL generates an EV_CFG_REQ_SAVE_LKG through the ctl terminal. Part B receives the request and creates a back-up copy of the properties in which it parameterized Part B with earlier.


[2283] APP_LFCCTL completes the incoming life cycle start request with success.


[2284] 6.2 De-serialization Failure: Use “Last Known Good” Configuration


[2285] This use case describes how APP_LFCCTL handles situations where the de-serialization of the instance parameters from the “last saved” configuration fails.


[2286] The system is created, connected and activated.


[2287] Part A sends a life cycle start request to APP_LFCCTL.


[2288] APP_LFCCTL creates the parameterized part by invoking the create operation through the fac terminal. The part array ARR creates Part C and returns. Depending on how APP_LFCCTL is parameterized, the part instance ID is either generated by ARR or it is specified as a constant.


[2289] APP_LFCCTL generates an EV_CFG_REQ_DESERIALIZE event through the cfg terminal to de-serialize the persistent state of the part instance. This event is received by Part B which fails it with a bad status due to an error in retrieving the properties to parameterize on the part (“last saved” configuration).


[2290] APP_LFCCTL generates an EV_CFG_REQ_USE_LKG event through the cfg terminal to de-serialize the persistent state of the part instance from the “last known good” configuration.


[2291] This event is received by Part B, which parameterizes Part C using properties stored in some external storage in the “last known good” configuration.


[2292] APP_LFCCTL activates the part instance by invoking the activate operation through the fac terminal. ARR activates Part C.


[2293] APP_LFCCTL generates an EV_LFC_REQ_START request through the lfc terminal. Part C receives this request and returns ST_OK.


[2294] If the gen_save_lkg property is TRUE, APP_LFCCTL generates an EV_CFG_REQ_SAVE_LKG through the ctl terminal. Part B receives the request and creates a back-up copy of the properties in which it parameterized Part B with earlier.


[2295] APP_LFCCTL completes the incoming life cycle start request with success.


[2296] Note that this use case is valid also when either the activation or start request fails when using the “last saved” configuration.


[2297] 6.3 De-serialization Failure: Use “Factory Defaults” configuration


[2298] This use case describes how APP_LFCCTL handles situations where the de-serialization of the instance parameters from the “last saved” and the “last known good” configurations fail.


[2299] The system is created, connected and activated.


[2300] Part A sends a life cycle start request to APP_LFCCTL.


[2301] APP_LFCCTL creates the parameterized part by invoking the create operation through the fac terminal. The part array ARR creates Part C and returns.


[2302] Depending on how APP_LFCCTL is parameterized, the part instance ID is either generated by ARR or it is specified as a constant.


[2303] APP_LFCCTL generates an EV_CFG_REQ_DESERIALIZE event through the cfg terminal to de-serialize the persistent state of the part instance. This event is received by Part B which fails it with a bad status due to an error in retrieving the properties to parameterize on the part (“last saved” configuration).


[2304] APP_LFCCTL generates an EV_CFG_REQ_USE_LKG event through the cfg terminal to de-serialize the persistent state of the part instance from the “last known good” configuration. This event is received by Part B, which fails it with a bad status due to an error in retrieving the properties to parameterize on the part (“last known good” configuration).


[2305] APP_LFCCTL generates an EV_CFG_REQ_USE_FAC_DFLT event through the cfg terminal to de-serialize the persistent state of the part instance from the “factory default” configuration.


[2306] This event is received by Part B, which parameterizes Part C using properties stored in some external storage in the “factory default” configuration.


[2307] APP_LFCCTL activates the part instance by invoking the activate operation through the fac terminal. ARR activates Part C.


[2308] APP_LFCCTL generates an EV_LFC_REQ_START request through the lfc terminal. Part C receives this request and returns ST_OK.


[2309] If the gen_save_lkg property is TRUE, APP_LFCCTL generates an EV_CFG_REQ_SAVE_LKG through the ctl terminal. Part B receives the request and creates a back-up copy of the properties in which it parameterized Part B with earlier.


[2310] APP_LFCCTL completes the incoming life cycle start request with success.


[2311] Note that this use case is valid also when either the activation or start request fails when using the “last saved” configuration.


[2312] 6.4 Stopping a system using APP_LFCCTL


[2313] This use case describes how APP_LFCCTL is used to stop a system.


[2314] The system is created, connected and activated.


[2315] Part A sends a life cycle start request to APP_LFCCTL. The operations described in the previous use case are executed.


[2316] At some time later, Part A sends a life cycle stop request to APP_LFCCTL


[2317] APP_LFCCTL generates an EV_LFC_REQ_STOP request through the lfc terminal. Part C receives this request and returns ST_OK.


[2318] APP_LFCCTL deactivates the part instance by invoking the deactivate operation through the fac terminal. ARR deactivates Part C.


[2319] APP_LFCCTL generates an EV_CFG_REQ_SERIALIZE event through the cfg terminal to serialize the persistent state of the part instance. This event is received by Part B which retrieves all the persistent properties from Part C and stores the values in some external storage.


[2320] APP_LFCCTL destroys the part instance by invoking the destroy operation through the fac terminal. ARR destroys Part C.


[2321] If there is a blocked run event, APP_LFCCTL completes the event with ST_OK.


[2322] APP_LFCCTL completes the incoming life cycle stop request with success.


[2323] 6.5 Soft Reset


[2324] This use case describes how APP_LFCCTL handles a soft reset request.


[2325] The system is created, connected and activated.


[2326] Part A sends a life cycle start request to APP_LFCCTL. The operations described in the previous use case are executed.


[2327] At some time later, Part A sends a soft reset request to APP_LFCCTL.


[2328] APP_LFCCTL emulates a life cycle stop and start request by executing all the steps in the above two use cases except for destroying and creating the part.


[2329] 6.6 Hard Reset


[2330] This use case describes how APP_LFCCTL handles a hard reset request.


[2331] The system is created, connected and activated.


[2332] Part A sends a life cycle start request to APP_LFCCTL. The operations described in the previous use case are executed.


[2333] At some time later, Part A sends a hard reset request to APP_LFCCTL.


[2334] APP_LFCCTL emulates a life cycle stop request by executing all the steps in the above use cases.


[2335] APP_LFCCTL forwards the hard reset request through the ctl terminal.


[2336] The hard reset request is received by Part B which reboots the system.


[2337] 7. Typical Usage


[2338] This use case presents how APP_LFCCTL is typically used in Dragon applications. This example shows the internal structure of the MYAPP assembly discussed in this section. FIG. 61 illustrates an advantageous use of part, APP_LFCCTL


[2339] The MYAPP assembly is comprised of the following subordinates:


[2340] lfcctl is used to control the life cycle of the assembly. Its main function is to create and activate mysystem inside the part array ARR. It also generates events to cfgm in order to serialize and de-serialize the persistent state of the mysystem part.


[2341] cfgm is used to maintain the persistent state of the mysystem part.


[2342] c1, c2, & c3 (APP_BAFILE) are property containers used to store each type of configuration.


[2343] arr (ARR) is used to maintain the mysystem instances created and destroyed by lfcctl.


[2344] mysystem is an application-specific assembly that implements the functionality needed by the application.


[2345] ef (EFLT) is used to filter out hard reset events and forwards them to Part A which reboots the system in which MYAPP is running.


[2346] The MYAPP assembly is the top most assembly in the Dragon system. Dragon creates and activates this assembly and then feeds the assembly the EV_SYS_INIT event. After initialization is complete, the Dragon system sends an EV_SYS_RUN event. When the system is ready to be brought down, the Dragon system feeds the assembly the EV_SYS_CLEANUP event. The life cycle controller (APP_LFCCTL) is parameterized with these system events (start_ev_id=EV_SYS_INIT, stop_ev_id=EV_SYS_CLEANUP, and run_ev_id=EV_SYS_RUN).


[2347] The sections below describe what happens when the assembly receives the system events and how it operates.


[2348] 7.1 System Initialization


[2349] When MYAPP receives a EV_SYS_INIT event, it is forwarded to lfcctl. lfcctl first creates an instance of mysystem in the part array. After successful creation, lfcctl generates an EV_CFG_REQ_DESERIALIZE event to cfgm through cfgm's ctl terminal. The event bus contains the part instance ID of the mysystem part in the part array.


[2350] cfgm enumerates and retrieves all the “last saved” parameters from the specified file and sets each parameter on the mysystem instance in the part array (through the prp terminal). cfgm uses the part instance ID stored in the incoming event when setting properties through the prp terminal. When the parameterization is complete, control is returned back to lfcctl.


[2351] lfcctl activates the mysystem part and generates a life cycle start request through the lfc terminal. Upon success, lfcctl generates an EV_CFG_REQ_SAVE_LKG event to cfgm. cfgm creates a back-up copy of the “last saved” parameters as the “last known good” parameters and returns. In the future, in case the “last saved” configuration file becomes damaged or corrupt, the configuration may be restored from the “last known good” configuration.


[2352] The serialized state of mysystem is now restored. lfcctl completes the original EV_SYS_INIT event received through the in terminal.


[2353] Next, the Dragon system sends an EV_SYS_RUN event, which is forwarded to lfcctl. lfcctl blocks the run event until a cleanup or hard-reset event is received.


[2354] 7.2 System Cleanup


[2355] When MYAPP receives a EV_SYS_INIT event, it is forwarded to lfcctl. lfcctl first generates a life cycle stop request to mysystem. Next, it generates an EV_CFG_REQ_SERIALIZE event to cfgm through cfgm's ctl terminal. The event bus contains the part instance ID of the mysystem part in the part array.


[2356] cfgm enumerates and retrieves all the modifiable-persistent properties from the mysystem part and saves them as the “last saved” configuration parameters. cfgm uses the part instance ID stored in the incoming event when setting properties through the prp terminal. When the serialization is complete, control is returned back to lfcctl.


[2357] lfcctl deactivates and destroys mysystem and completes the original EV_SYS_INIT event received through the in terminal.


[2358] The state of mysystem is now serialized to a binary file on persistent storage.


[2359] Lastly, the run event is unblocked and completed with ST_OK.


[2360] 7.3 De-serialization Errors


[2361] If an attempt to de-serialize the parameters from the “last saved” configuration fails, lfcctl tries to restore the parameters from either the “last known good” or the “factory default” parameters.


[2362] In this case, lfcctl generates an EV_CFG_REQ_USE_LKG event to cfgm. cfgm attempts to parameterize mysystem with the “last known good” configuration. If an error occurs, lfcctl tries to restore the state of the system from the “factory defaults” configuration (using EV_CFG_REQ_USE_FAC_DFLT). If another error occurs, the state of the system can not be restored from persistent storage and lffcctl fails the incoming EV_SYS_INIT event.


[2363] Note that this also applies to cases when the activation or starting of the part instance fails. APP_LFCCTL will try all possible parameter sets until either the part instance successfully activates and starts or none of the parameter sets work with the part instance (in this case, the init event completes with failure).


[2364] 7.4 Soft System Reset


[2365] mysystem at some point needs to perform a soft-reset of the system. mysystem generates a soft system reset event through its lfc terminal which is forwarded through lfcctl's in terminal.


[2366] lfcctl executes the operations executed on EV SYS CLEANUP and also on EV SYS INIT in order to reset the mysystem assembly.


[2367] 7.5 Hard System Reset


[2368] mysystem at some point needs to reboot the system upon a user's request. mysystem generates a hard system reset event through its lfc terminal which is forwarded through lfcctl's in terminal. lfcctl de-synchronizes the event before processing.


[2369] lfcctl executes the operations executed on EV_SYS_CLEANUP. Afterwards, the hard reset event is forwarded through the ctl terminal.


[2370] ef filters the hard reset event and forwards the event to Part A. Part A then reboots the system in which the MYAPP assembly is running.


[2371] 8. Document References


[2372] None.


[2373] 9. Unresolved Issues


[2374] APP_LFCCTL does not support life cycle start and stop timeouts or delays between stopping and starting the part instance. This is due to a limitation in the Dragon engine. When the init event is received, the timer and interrupt services are not available. These features cannot be implemented until the Dragon engine is updated.



APP—Property Space Support


APP_CFGM—Configuration Manager

[2375]
FIG. 62 illustrates the boundary of part, APP_CFGM


[2376] 1. Functional Overview


[2377] APP_CFGM manages different sets of configuration parameters for a Dragon application or system. The configuration parameters are stored in external containers that are accessed through APP_CFGM's output terminals.


[2378] APP_CFGM manages the following four sets of configuration parameters for an application:


[2379] “current” configuration: current parameterization of an application, accessed through the prp terminal


[2380] “last saved” configuration: serialized persistent state of an application, accessed through the cfg_ls terminal


[2381] “last known good” configuration: backup copy of the “last saved” configuration, accessed through the cfg lkg terminal


[2382] “factory defaults” configuration: factory default parameterization of an application, accessed through the cfg_fd terminal


[2383] APP_CFGM is typically used for the serialization and de-serialization of an application's persistent state. APP_CFGM can copy parameters from one configuration to another.


[2384] APP_CFGM can perform any of the following operations (by sending the corresponding event through the ctl terminal): serialization/de-serialization of the “current” configuration to/from the “last saved” configuration, create a back-up copy of the “last saved” configuration, de-serialize the parameters from either the “last known good” or “factory defaults” configurations, and lastly, restore the “last saved” configuration from either the “last known good” or “factory defaults” configurations.


[2385] APP_CFGM also allows access of individual parameters in the “last saved”, “last known good” and “factory default” configurations through the dat terminal. Note that the “last known good” and “factory default” configurations are read-only.


[2386] APP_CFGM's terminals are unguarded and may be used in interrupt contexts.


[2387] 2. Boundary
1312.1 TerminalsNameDirInterfaceNotesctlInI_DRAINThis terminal is used to invoke operationsover the following sets of configurationparameters: “current”, “last saved”,“last known good” and “factory default”.datInI_PROPThis terminal is used to access individualconfiguration parameters of the “last saved”,“last known good” and “factory default”configuration parameter sets.Use the following values in the ID field ofthe property operation bus to identify whichset of parameters to access:1 - “last saved” configuration (read-writeaccess)2 - “last known good” configuration(read-only access)3 - “factory defaults” configuration(read-only access)prpOutI_PROPUsed to access the current configurationparameters maintained by a part connected tothis terminal.cfg_lsOutI_PROPUsed to access the “last saved” configurationparameters.The ID field of the property operation buspassed through this terminal is not used andis set to zero.cfg_lkgOutI_PROPUsed to access the “last known good”configuration parameters.The ID field of the property operation buspassed through this terminal is not used andis set to zero.cfg_fdOutI_PROPUsed to access the “factory default”configuration parameters.The ID field of the property operation buspassed through this terminal is not used andis set to zero.


[2388]

132











2.2 Properties









Property name
Type
Notes





Id_offs
uint32
Offset in the incoming event bus to the




field that contains the part instance ID that




identifies the part accessed through the prp




terminal (specified in bytes).




If −1, the ID field in the property




operation bus is not used and is set to




zero.




The default value is −1 (not used).


ser_qry_string
asciz
Query string to use when enumerating




properties through the prp terminal during




serialization.




The default value is “*” (all properties).


ser_qry_attr
uint32
Specifies the attributes to use when




enumerating properties through the prp




terminal during serialization.




The default value is ZPRP_A_PERSIST.


ser_qry_attr_mask
uint32
Specifies the attribute mask to use when




enumerating properties through the prp




terminal during serialization.




The default value is ZPRP_A_PERSIST.










[2389] 3. Events and Notifications
1333.1 Terminal: ctlThe following events are defined in e_cfgm.h.EventDirBusNotesEV_CFG_REQ_SERIALIZEinanyWhen this event is received,APP_CFGM enumerates theproperties through the prp terminaland sets their values through thecfg_ls terminal.This event is used to save thepersistent state of a part connected tothe prp terminal.EV_CFG_REQ_DESERIALIZEinanyWhen this event is received,APP_CFGM enumerates theproperties through the cfg_lsterminal and sets their values throughthe prp terminal.This event is used to restore thepersistent state of a part connected tothe prp terminal using the “last saved”configuration parameters.EV_CFG_REQ_SAVE_LKGinanyWhen this event is received,APP_CFGM enumerates theproperties through the cfg_lsterminal and sets their values throughthe cfg_lkg terminal.This event is used to save the “last saved” parameters as the “last knowngood” parameters; essentially creatinga backup copy of the “last saved”configuration parameters.EV_CFG_REQ_RESTORE_LKGinanyWhen this event is received,APP_CFGM enumerates theproperties through the cfg_lkgterminal and sets their values throughthe cfg_ls terminal.EV_CFG_REQ_RESTORE_FAC_DFLTinanyWhen this event is received,APP_CFGM enumerates theproperties through the cfg_fdterminal and sets their values throughthe cfg_ls terminal.EV_CFG_REQ_USE_LKGinanyWhen this event is received,APP_CFGM enumerates theproperties through the cfg_lkgterminal and sets their values throughthe prp terminal.This event is used to restore thepersistent state of a part connected tothe prp terminal using the “last knowngood” configuration parameters.EV_CFG_REQ_USE_FAC_DFLTinanyWhen this event is received,APP_CFGM enumerates theproperties through the cfg_fdterminal and sets their values throughthe prp terminal.This event is used to restore thepersistent state of a part connected tothe prp terminal using the “factorydefault” configuration parameters.(other)inanyThese events are completed withstatus ST_NOT_SUPPORTED.


[2390] 4. Environmental Dependencies


[2391] 4.1 Encapsulated Interactions


[2392] None.


[2393] 4.2 Other Environmental Dependencies


[2394] None.


[2395] 5. Specification


[2396] 5.1 Responsibilities


[2397] Upon receiving an EV_CFG_REQ_SERIALIZE event through the ctl terminal, enumerate and retrieve the specified properties through the prp terminal and set their values through the c fg_l s terminal.


[2398] Upon receiving an EV_CFG_REQ_DESERIALIZE event through the ctl terminal, enumerate and retrieve the specified properties through the cfg_ls terminal and set their values through the prp terminal.


[2399] Upon receiving an EV_CFG_REQ_SAVE_LKG event through the ctl terminal, enumerate and retrieve the specified properties through the cfg_ls terminal and set their values through the cfg_lkg terminal.


[2400] Upon receiving an EV_CFG_REQ_RESTORE_LKG event through the ctl terminal, enumerate and retrieve the specified properties through the cfg_lkg terminal and set their values through the cfg_ls terminal.


[2401] Upon receiving an EV_CFG_REQ_RESTORE_FAC_DFLT event through the ctl terminal, enumerate and retrieve the specified properties through the cfg_fd terminal and set their values through the cfg_is terminal.


[2402] Upon receiving an EV_CFG_REQ_USE_LKG event through the ctl terminal, enumerate and retrieve the specified properties through the cfg_lkg terminal and set their values through the prp terminal.


[2403] Upon receiving an EV_CFG_REQ_USE_FAC_DFLT event through the ctl terminal, enumerate and retrieve the specified properties through the cfg_fd terminal and set their values through the prp terminal.


[2404] When copying configuration parameters, ignore errors when setting property values through the prp terminal.


[2405] Fail all unrecognized events received through the ctl terminal with ST_NOT_SUPPORTED.


[2406] Allow access to individual properties in the “last saved”, “last known good” and “factory default” configuration parameters through the dat terminal. Enforce read-only access to the “last known good” and “factory default” parameters. Allow full access to the “last saved” parameters.


[2407] If id_offs is not equal to −1, use the part instance ID in the incoming event when invoking operations through the prp terminal. Otherwise, set the ID field in the outgoing property operation bus to zero.


[2408] Complete all incoming events and operations synchronously.


[2409] 5.2 External States


[2410] None.


[2411] 6. Use Cases


[2412]
FIG. 63 illustrates an advantageous use of part, APP_CFGM


[2413] Part A controls the life-cycle and parameterization of Part B. Part A emits events to APP_CFGM to control the parameterization of part B.


[2414] The APP_BAFILEs are parameterized to load the three sets of configuration parameters (“last saved”, “last known good” and “factory defaults”) from a binary file.


[2415] The UTL_PRCBA's are used to represent the configuration parameters as properties over the binary files. UTL_PRCBA implements a property container using the binary files as storage.


[2416] In all of the following use cases, APP_CFGM is used using its default parameterization.


[2417] 6.1 Saving and Restoring the Persistent State of Part B


[2418] This use case describes how APP_CFGM saves and restores the persistent state of a part connected to the prp terminal:


[2419] The system presented above is created, connected and activated. The property containers are initialized with the contents of the parameterized binary files.


[2420] After the system has been brought up, Part A sends an EV_CFG_REQ_DESERIALIZE event to APP_CFGM.


[2421] APP_CFGM enumerates all the properties through the cfg_ls terminal and for each one, retrieves the property value and sets the property through the prp terminal. The properties are set on Part B.


[2422] Next, Part A sends an EV_CFG_REQ_SAVE_LKG event to APP_CFGM (assuming the parameterization on Pat B was successful).


[2423] APP_CFGM enumerates all the properties through the cfg_ls terminal and for each one, retrieves the property value and sets the property through the cfg_lkg terminal. This operation creates a back-up copy of the “last saved” parameters.


[2424] At some later time after the system has been up and running for a while, Part A sends an EV_CFG_REQ_SERIALIZE event to APP_CFGM.


[2425] APP_CFGM enumerates all the persistent properties through the prp terminal and for each one, retrieves the property value and sets the property through the cfg_is terminal.


[2426] At some time later before all the parts are destroyed, the properties in the containers are saved back to the binary files.


[2427] 6.2 Failure When Restoring the Persistent State of Part B From the “Last Saved” Configuration


[2428] This use case describes a situation where the restoration of the persistent state from the “last saved” configuration fails. Part A attempts to restore the state of the system using the “last known good” configuration parameters:


[2429] The system presented above is created, connected and activated. The property containers are initialized with the contents of the parameterized binary files.


[2430] After the system has been brought up, Part A sends an EV_CFG_REQ_DESERIALIZE event to APP CFGM.


[2431] APP_CFGM fails the request because the “last saved” configuration file is corrupt and it fails to enumerate the properties.


[2432] Part A sends an EV_CFG_REQ_USE_LKG event to APP_CFGM.


[2433] APP_CFGM enumerates all the properties through the cfg_lkg terminal and for each one, retrieves the property value and sets the property through the prp terminal. The property is set on Part B.


[2434] At some later time after the system has been up and running for a while, Part A sends an EV_CFG_REQ_SERIALIZE event to APP_CFGM.


[2435] APP_CFGM enumerates all the persistent properties through the prp terminal and for each one, retrieves the property value and sets the property through the cfg_ls terminal. The “last saved” configuration file is now restored.


[2436] At some time later before all the parts are destroyed, the properties in the containers are saved back to the binary files.


[2437] 6.3 Failure When Restoring the Persistent State of Part B From the “Last Known Good” Configuration


[2438] This use case describes a situation where the restoration of the persistent state from the “last saved” and the “last known good” configuration fails. Part A attempts to restore the state of the system using the “factory default” configuration parameters:


[2439] The system presented above is created, connected and activated. The property containers are initialized with the contents of the parameterized binary files.


[2440] After the system has been brought up, Part A sends an EV_CFG_REQ_DESERIALIZE event to APP_CFGM.


[2441] APP_CFGM fails the request because the “last saved” configuration file is corrupt and it fails to enumerate the properties.


[2442] Part A sends an EV_CFG_REQ_USE_LKG event to APP_CFGM.


[2443] APP_CFGM fails the request because the “last known good” configuration file is corrupt and it fails to enumerate the properties.


[2444] Part A sends an EV_CFG_REQ_USE_FAC_DFLT event to APP_CFGM.


[2445] APP_CFGM enumerates all the properties through the cfg_fd terminal and for each one, retrieves the property value and sets the property through the prp terminal. The property is set on Part B.


[2446] At some later time after the system has been up and running for a while, Part A sends an EV_CFG_REQ_SERIALIZE event to APP_CFGM.


[2447] APP_CFGM enumerates all the persistent properties through the prp terminal and for each one, retrieves the property value and sets the property through the cfg_ls terminal.


[2448] At some time later before all the parts are destroyed, the properties in the containers are saved back to the binary files.


[2449] 6.4 Restoring the “Last Saved” Configuration From the “Last Known Good” Configuration


[2450] This use case describes a situation where the “last saved” configuration is corrupt and needs to be restored from the “last known good” configuration. This is typically done before the system is reset so it can re-start normally using the recovered “last saved” configuration.


[2451] The system presented above is created, connected and activated. The property containers are initialized with the contents of the parameterized binary files.


[2452] After the system has been brought up, Part A sends an EV_CFG_REQ_DESERIALIZE event to APP_CFGM.


[2453] APP_CFGM enumerates all the properties through the cfg_ls terminal and for each one, retrieves the property value and sets the property through the prp terminal. The properties are set on Part B.


[2454] Next, Part A sends an EV_CFG_REQ_SAVE_LKG event to APP_CFGM (assuming the parameterization on Pat B was successful).


[2455] APP_CFGM enumerates all the properties through the cfg_ls terminal and for each one, retrieves the property value and sets the property through the cfg_lkg terminal. This operation creates a back-up copy of the “last saved” parameters.


[2456] At some time later, the “last saved” configuration becomes corrupt and needs to be restored from the “last known good” configuration before the next system re-start.


[2457] Triggered upon a user request or some other event, Part A sends an EV_CFG_REQ_RESTORE_LKG event to APP_CFGM.


[2458] APP_CFGM enumerates all the properties through the cfg_lkg terminal and for each one, retrieves the property value and sets the property through the cfg_ls terminal. This operation restores the “last saved” parameters from the “last known good” parameters.


[2459] At some point later, the system is reset.


[2460] After the system has been brought up, Part A sends an EV_CFG_REQ_DESERIALIZE event to APP_CFGM. The parameters from the “last saved” configuration are enumerated and set on Part B.


[2461] The system is successfully started using the restored “last saved” configuration.


[2462] 6.5 Restoring the “Last Saved” Configuration From the “Factory Defaults” Configuration


[2463] This use case describes a situation where the “last saved” configuration is corrupt and needs to be restored from the “factory defaults” configuration. This is typically done before the system is reset so it can re-start normally using the recovered “last saved” configuration.


[2464] The system presented above is created, connected and activated. The property containers are initialized with the contents of the parameterized binary files.


[2465] After the system has been brought up, Part A sends an EV_CFG_REQ_DESERIALIZE event to APP_CFGM.


[2466] APP_CFGM enumerates all the properties through the cfg_ls terminal and for each one, retrieves the property value and sets the property through the prp terminal. The properties are set on Part B.


[2467] Next, Part A sends an EV_CFG_REQ_SAVE_LKG event to APP_CFGM (assuming the parameterization on Pat B was successful).


[2468] APP_CFGM enumerates all the properties through the cfg_ls terminal and for each one, retrieves the property value and sets the property through the cfg_lkg terminal. This operation creates a back-up copy of the “last saved” parameters.


[2469] At some time later, the “last saved” configuration becomes corn_pt and needs to be restored from the “factory defaults” configuration before the next system re-start.


[2470] Triggered upon a user request or some other event, Part A sends an EV_CFG_REQ_RESTORE_FAC_DFLT event to APP_CFGM.


[2471] APP_CFGM enumerates all the properties through the cfg_fd terminal and for each one, retrieves the property value and sets the property through the cfg_ls terminal. This operation restores the “last saved” parameters from the “factory defaults” parameters.


[2472] At some point later, the system is reset.


[2473] After the system has been brought up, Part A sends an EV_CFG_REQ_DESERIALIZE event to APP_CFGM. The parameters from the “last saved” configuration are enumerated and set on Part B.


[2474] The system is successfully started using the restored “last saved” configuration.


[2475] 6.6 Accessing Individual Parameters of the Configurations Through the “dat” Terminal


[2476] This use case describes how to access individual configuration parameters through APP_CFGM:


[2477] The system above is created, connected and activated.


[2478] Part A generates an EV_CFG_REQ_DESERIALIZE event to APP_CFGM.


[2479] APP_CFGM enumerates all the properties through the cfg_ls terminal and for each one, retrieves the property value and sets the property through the prp terminal. The properties are set on Part B.


[2480] Part A sets a property of the “last saved” configuration parameters through the dat terminal by specifying an ID of 1 in the property operation bus.


[2481] APP_CFGM updates the specified property in the “last saved” configuration and returns (the property operation is forwarded through the cfg_ls terminal).


[2482] Part A gets a property of the “last known good” configuration parameters through the dat terminal by specifying an ID of 2 in the property operation bus.


[2483] APP_CFGM retrieves the specified property in the “last known good” configuration and returns (the property operation is forwarded through the cfg_lkg terminal).


[2484] Part A gets a property of the “factory default” configuration parameters through the dat terminal by specifying an ID of 3 in the property operation bus.


[2485] APP_CFGM retrieves the specified property in the “factory default” configuration and returns (the property operation is forwarded through the cfg_fd terminal).


[2486] 7. Typical Usage


[2487] See the use cases described above.


[2488] 8. Document References


[2489] None.


[2490] 9. Unresolved Issues


[2491] None.



APP_PARAM—Parameterizer on Property Container

[2492]
FIG. 64 illustrates the boundary of part, APP_PARAM


[2493] 1. Functional Overview


[2494] APP_PARAM is a dynamic structure part that uses an external property container to deserialize and serialize properties to/from part instances contained within a part container such as ARR.


[2495] Deserialization of the properties from the property container connected to stg terminal is triggered when the property with a particular name is set through terminal i_prop.


[2496] Serialization of properties to the property container is triggered after the part instance has been successfully deactivated through the o_fact terminal.


[2497] All property operations received on the i_prop input are passed unchanged to o_prop. This allows APP_PARAM to be inserted between two parts connected through an I_PROP interface. APP_PARAM transparently passes all operations on its i_f act input to o_fact as well.


[2498] In order to provide instance specific parameterization, APP_PARAM uses the value set as a persistent property on the part instance assembly as a prefix to all operations sent out through stg terminal. All property requests are prefixed with the value of the persistent property name followed by a delimiter character.


[2499] The input terminals are guarded by a critical section. APP_PARAM does not leave the critical region when it calls out. It cannot be used at interrupt context.


[2500] 2. Boundary
1342.1 TerminalsNameDirInterfaceNotesi_propInI_PROPInput part property interface. All operationsare passed transparently to o_prop terminal.When the property specified bypersist_prop_name property is set,APP_PARAM enumerates all instanceproperties and sets them on the part instance.o_propOutI_PROPAll property operations received on i_propinput are passed transparently through thisoutput.i_factInI_FACTInput part-factory interface. All operationsare passed transparently through o_factoutput.o_factOutI_FACTCalls received to i_fact are passed to thisoutput. APP_PARAM assumes that theo_prop and o_fact terminals areconnected to the same part container.This output may remain unconnected ifi_fact input is not connected.stgOutI_PROPProperty storage container connectionterminal.APP_PARAM calls the storage container inorder to enumerate, get or set different partinstance properties.


[2501]

135











2.2 Properties









Property name
Type
Notes





persist_prop_name
asciz
Name of an asciz property to monitor on




i_prop::set operations.




When this property is set, APP_PARAM




starts part instance parameterization.




The value of this property, appended with




a dot, is used as a name prefix on all set,




get and qry_open operations sent out




through stg terminal.




The default value is “persist_prop_name”


enforce_out_prop
uint32
Boolean. If TRUE, property




deserialization is executed only when




o_prop::set operation on the property




specified by persist_prop_name is




successful.




Default value is TRUE.


serialize
uint32
Boolean. If TRUE, serialize properties




when o_fact::deactivate is successfully




completed.




Default value is TRUE.


qry_string
asciz
Query string to use when




serializing/deserializing instance




properties.




Default value is “*” (serialize all




properties)


qry_attr
uint32
Property attribute value to use when




performing query operation to




serialize/deserialize instance properties.




Default value is ZPRP_A_PERSIST.




(serialize persistent properties only)


qry_attr_mask
uint32
Property attribute mask to be used when




performing query operation to




serialize/deserialize instance properties.




Default value is ZPRP_A_PERSIST.




(serialize persistent properties only)










[2502] 3. Events and Notifications


[2503] None.


[2504] 3.1 Environmental Dependencies


[2505] None.


[2506] 3.2 Encapsulated Interactions


[2507] None.


[2508] 3.3 Other Environmental Dependencies


[2509] None.


[2510] 4. Specification


[2511] 4.1 Responsibilities


[2512] Pass all operation calls on the i_Prop terminal out through the o_prop terminal.


[2513] Pass all operation calls on the i_fact terminal out through the o_fact terminal.


[2514] When the trigger property is set, enumerate the specified container properties. For each property found, set the corresponding instance property.


[2515] When a property serialization is enabled and the part instance is deactivated, save the values of the specified instance properties in the property container.


[2516] Add an instance specific prefix (persistent name plus a dot) to all property get, property set and ‘query open’ operations set out through stg terminal.


[2517] 4.2 External States


[2518] None


[2519] 4.3 Use Cases


[2520] None.


[2521] 5. Typical Usage


[2522] 5.1 Property Parameterization and Serialization


[2523] When a part instance is created, it requires some parameterization in order to start its operation. Normally, the properties of the Dragon parts can be changed only when the part is not active, i.e., when the part is created but before it is activated. The following example demonstrates how APP_PARAM can be used to parameterize a part instance within Part Array container (ARR).


[2524]
FIG. 65 illustrates Property Parameterization and Serialization


[2525] The property parameterizer (APP_PARAM) monitors the requests passing through its i_fact and i_prop terminal for property set request. When the monitored property is modified, APP_PARAM extracts all instance properties through its stg terminal and sets them to the part instance within the instance container (ARR). APP_PARAM uses qry_string property as a specific key to obtain only the properties related to the part instance being parameterized.


[2526] When the part instance is deactivated, through i_fact, APP_PARAM extracts all properties and store them in a property storage that is attached to its stg terminal.


[2527] 6. Document References


[2528] None.


[2529] 7. Unresolved Issues


[2530] None.



APP—I/O Access


APP_BAFILE—Byte Array on File

[2531]
FIG. 66 illustrates the boundary of part, APP_BAFILE


[2532] 1. Functional Overview


[2533] APP_BAFILE is a peripheral access part that implements a dynamic byte array over a standard binary file. A byte array can be used to store any type of data. APP_BAFILE's arr terminal is used to read and write data to and from the byte array.


[2534] APP_BAFILE implements a transactional-based byte array. Transactions over the byte array can be started, ended and canceled by sending parameterized events through the xact terminal.


[2535] After a transaction on the byte array has started, APP_BAFILE executes all read and write operations over a byte array stored in memory (RAM). Once the transaction has ended, APP_BAFILE commits the cached byte array stored in memory to the parameterized binary file. This mechanism provides fast manipulation of the byte array and reduces the number of accesses to the file media.


[2536] APP_BAFILE is typically used in assemblies to store small amounts of persistent data to a binary file on the user's system.


[2537] APP_BAFILE's terminals are guarded in order to prevent data corruption in the byte array. Therefore, APP_BAFILE cannot be used in interrupt contexts.


[2538] 2. Boundary
1362.1 TerminalsNameDirInterfaceNotesarrinI_BYTEARRThis terminal is used to access the byte arrayover the parameterized file.xactinI_DRAINThis terminal is used to begin, end andcancel transactions over the byte array.


[2539]

137











2.2 Properties









Property name
Type
Notes





file_path
asciz
File name and path that APP_BAFILE uses to store the




byte array data.




This property is mandatory.


read_only
uint32
Boolean. TRUE to enforce that only read operations are




allowed over the byte array.




The default value is FALSE.


write_only
uint32
Boolean. TRUE to enforce that only write operations




are allowed over the byte array.




The default value is FALSE.


init_byte_array
uint32
Boolean. TRUE to initialize the byte array cache on




activation with the contents of the specified file.




Otherwise the contents of the byte array cache are




initialized with zeros.




The default value is TRUE.


ev_xact_begin_id
uint32
ID of the event used to begin transactions over the byte




array.




This property is mandatory.


ev_xact_end_id
uint32
ID of the event used to end transactions over the byte




array.




This property is mandatory.


ev_xact_cancel_id
uint32
ID of the event used to cancel transactions over the




byte array.




If EV_NULL, byte array transactions can not be




cancelled.




The default value is EV_NULL.










[2540] 3. Events and Notifications
1383.1 Terminal: xactEventDirBusNotes(ev_xact_begin_id)inanyBegins a transaction over the byte array.All subsequent read and write operations areexecuted over the byte array cache until thetransaction has ended.(ev_xact_end_id)inanyEnds a transaction over the byte array.APP_BAFILE updates the specified file with thecontents of the byte array cache.(ev_xact_cancel_id)inanyCancels all current byte array transactions.APP_BAFILE restores the contents of the bytearray cache to the point before the currenttransactions had started. APP_BAFILE also endsall current transactions.


[2541] 4. Environmental Dependencies


[2542] 4.1 Encapsulated Interactions


[2543] APP_BAFILE uses the ANSI standard file I/O functions for file access.


[2544] 4.2 Other Environmental Dependencies


[2545] None.


[2546] 5. Specification


[2547] 5.1 Responsibilities


[2548] On activation, if the init_byte_array property is TRUE, initialize the contents of the byte array cache with the contents of the specified file.


[2549] If APP_BAFILE is parameterized for read only, fail all write operations.


[2550] If APP_BAFILE is parameterized for write only, fail all read operations.


[2551] Fail all read and write operations if the execution of the operation exceeds the boundary of the byte array.


[2552] Fail all write operations if no transaction has been started.


[2553] Once a transaction has been started, execute all read and write operations over the byte array memory cache. Do not interpret the byte array data.


[2554] A byte array transaction may be cancelled at any time. When a transaction is cancelled, restore the byte array cache to the state before the transaction had begun and end the current transaction.


[2555] When a transaction has ended, commit the contents of the byte array cache to the specified file.


[2556] Allow multiple transactions to be started at any time and implement the transaction begin, end and cancel functionality cumulatively. Commit the contents of the byte array to the specified file only when the last transaction has ended.


[2557] 5.2 External States


[2558] None.


[2559] 6. Use Cases


[2560] 6.1 Transactional Operation


[2561] This use case describes the basic operation of APP_BAFILE:


[2562] 1. APP_BAFILE is created, parameterized and activated.


[2563] 2. Sending an ev_xact_begin_id event through the xact terminal starts a transaction.


[2564] 3. Read and write operations are invoked on the byte array. APP_BAFILE modifies the contents of the byte array cache (not the actual file).


[2565] 4. Sending an ev_xact_end_id event through the xact terminal ends the transaction.


[2566] 5. APP_BAFILE commits the contents of the byte array cache to the specified file.


[2567] 6. Steps 2-5 are executed many times until APP_BAFILE is deactivated and destroyed.


[2568] 6.2 Canceling a Single Transaction


[2569] This use case describes the canceling of a single transaction over the byte array:


[2570] 1. APP_BAFILE is created, parameterized and activated.


[2571] 2. Sending an ev_xact_begin_id event through the xact terminal starts a transaction.


[2572] 3. Read and write operations are invoked on the byte array. APP_BAFILE modifies the contents of the byte array cache (not the actual file).


[2573] 4. The transaction is canceled by sending an ev_xact_cancel_id event through the xact terminal.


[2574] 5. APP_BAFILE restores the contents of the byte array cache to the state before the transaction was started. The current transaction is ended.


[2575] 6.3 Canceling Nested Transactions


[2576] This use case describes the canceling of nested transactions over the byte array:


[2577] 1. APP_BAFILE is created, parameterized and activated.


[2578] 2. Sending an ev_xact_begin_id event through the xact terminal starts a transaction.


[2579] 3. Read and write operations are invoked on the byte array. APP_BAFILE modifies the contents of the byte array cache (not the actual file).


[2580] 4. Sending an ev_xact_begin_id event through the xact terminal starts a new transaction.


[2581] 5. Read and write operations are invoked on the byte array. APP_BAFILE modifies the contents of the byte array cache (not the actual file).


[2582] 6. The current transactions are canceled by sending an ev_xact_cancel_id event through the xact terminal.


[2583] 7. APP_BAFILE restores the contents of the byte array cache to the state before the first transaction was started. All current transactions are ended.


[2584] 6.4 Maintaining Persistent State


[2585] APP_BAFILE can be used to maintain persistent state for an assembly or a system.


[2586] 1. APP_BAFILE is created and parameterized. APP_BAFILE's init_byte_array property is set to TRUE. All other properties are parameterized as needed.


[2587] 2. On activation, APP_BAFILE opens the specified file and loads the file's entire contents into the byte array cache.


[2588] 3. A part connected to APP_BAFILE executes transactions over the byte array. When the last transaction has ended, APP_BAFILE updates the specified file with the contents of the byte array cache.


[2589] 4. Step 3 is executed many times until APP_BAFILE is deactivated and destroyed.


[2590] 6.5 Enforcing Byte Array Access


[2591] APP_BAFILE can be parameterized to prevent the execution of specific operations over the byte array.


[2592] 1. APP_BAFILE is created and parameterized. APP_BAFILE's read_only property is set to TRUE. All other properties are parameterized as needed.


[2593] 2. APP_BAFILE is activated.


[2594] 3. A part connected to APP_BAFILE begins a transaction on the byte array. The part executes read operations over the byte array. If the part tries to write data into the byte array, APP_BAFILE fails the operation with CMST_REFUSE.


[2595] 4. Step 3 is executed many times until APP_BAFILE is deactivated and destroyed.


[2596] 7. Typical Usage


[2597] None.


[2598] 7.1 Document References


[2599] None.


[2600] 7.2 Unresolved Issues


[2601] None.



APP—Debugging and Instrumentation


APP_EFD—Event Field Dumper

[2602]
FIG. 67 illustrates the boundary of part, APP_EFD


[2603] 1. Functional Overview


[2604] APP_EFD is a debugging and instrumentation part that can be used to dump the fields of a Dragon event. APP_EFD is used to trace the program execution through I_DRAIN part connections. It can be inserted between any two parts that have an I_DRAIN unidirectional connection.


[2605] When an operation is invoked on its in terminal, APP_EFD generates a printable output containing hexadecimal representations of the event ID, attributes, and completion status fields in the event. APP_EFD does not dump any other data contained in the event. APP_BSD can be used for this purpose.


[2606] The output is sent either to the debug console or to the con terminal as an EV_MESSAGE event (if the con terminal is connected). The operation is then forwarded to the out terminal. When the call returns, APP_EFD dumps the bus again. The dumping of the bus before and after the operation call can be selectively disabled through properties.


[2607] APP_EFD does not modify the operation bus.


[2608] The printable output has the following format:


<APP_EFD id>pre or post: id=<evt_id>, size=<evt_sz>, attr=<evt_attr>, stat=<evt_stat>


[2609] APP_EFD's output can be disabled through properties. When disabled, all operations are directly passed through out, allowing for selective tracing through a system.


[2610] Each APP_EFD instance is uniquely identified. The instance identification is included in the formatted output. This identification includes the APP_EFD unique instance id, recurse count of the operation invoked, and other useful information. This identification may also include the value of the name property (if specified).


[2611] APP_EFD is unguarded and may be used within interrupt context. APP_EFD does keep state as to how many times it has been reentered. If APP_EFD is used within an environment where it may be entered from multiple threads, an external guard should be provided.


[2612] 2. Boundary
1392.1 TerminalsNameDirInterfaceNotesininI_DRAINAll operations invoked through this terminal are passedthrough the out terminal.APP_EFD does not modify the bus passed with theoperation.outoutI_DRAINAll operations invoked on the in terminal are passedthrough this terminal. If this terminal is not connected,APP_EFD will return with ST_NOT_CONNECTED afterdumping the bus information.conoutI_DRAINIf connected, APP_EFD sends an EV_MESSAGE eventcontaining the bus dump through this terminal. In this caseno debug output is printed.


[2613]

140











2.2 Properties









Property




name
Type
Notes





name
asciz
This is the instance name of APP_EFD. It is the first field of




the formatted output. If the name is “”, the instance name




printed is “APP_EFD”.




Default is “”.


enabled
uint32
If TRUE APP_EFD will dump the call information to either




the debug console or as an EV_MESSAGE event sent through the




con terminal.




If FALSE, APP_EFD will not output anything. It passes the




operation call through the out terminal.




Default is TRUE.


dump_before
uint32
If TRUE, APP_EFD dumps the event fields before passing the




call through the out terminal.




Default is FALSE.


dump_after
uint32
If TRUE, APP_EFD dumps the event fields after passing the




call through the out terminal. Care should be taken when




using this option because the bus is typically not accessible




upon return (the event object may have been freed by the time




the call returns).




Default is FALSE.










[2614]

141











3.1 Terminal: con










Event
Dir
Bus
Notes





EV_MESSAGE
out
B_EV_MSG
This event contains APP_EFD's formatted output.





This allows the dump to be sent to mediums other





than the debug console.










[2615] 4. Environmental Dependencies


[2616] None.


[2617] 4.1 Encapsulated Interactions


[2618] None.


[2619] 4.2 Other Environmental Dependencies


[2620] None.


[2621] 5. Specification


[2622] 5.1 Responsibilities


[2623] Dump the values of the event header fields (evt_id, evt_attr, and evt_stat) to an output medium when enabled.


[2624] Pass all operation calls on the in terminal out through the out terminal.


[2625] 5.2 External States


[2626] None.


[2627] 6. Use Cases


[2628] 6.1 Behavior When Disabled


[2629] This use case describes APP_EFD's behavior when its enable property is FALSE.


[2630] APP_EFD is created and parameterized (enable property is FALSE)


[2631] APP_EFD receives a call on its in terminal.


[2632] APP_EFD forwards the call to its out terminal and returns the status from the call.


[2633] If the out terminal is not connected, APP_EFD returns ST_NOT_CONNECTED.


[2634] 6.2 Behavior When Enabled and Con Terminal is Not Connected This use case describes APP_EFD's behavior when it is enabled and its con terminal is not connected.


[2635] APP_EFD has been created and the con terminal remains unconnected and the enable property is set to TRUE.


[2636] APP_EFD receives a call on its in terminal.


[2637] If the dump_before property is TRUE, APP_EFD formats an output string containing the event header fields and dumps the output to the debug console.


[2638] APP_EFD forwards the call to the out terminal.


[2639] If the dump_after property is TRUE, APP_EFD formats an output string containing the event header fields and dumps the output to the debug console.


[2640] APP_EFD returns the status from the call to the out terminal.


[2641] 6.3 Behavior When Enabled and Con Terminal is Connected


[2642] This use case describes APP_EFD's behavior when it is enabled and its con terminal is connected.


[2643] APP_EFD has been created and the con terminal remains unconnected and the enable property is set to TRUE.


[2644] APP_EFD receives a call on its in terminal.


[2645] If the dump_before property is TRUE, APP_EFD formats an output string containing the event header fields, creates an EV_MESSAGE event containing the output string and sends the event out the con terminal.


[2646] APP_EFD forwards the call to the out terminal.


[2647] If the dump_after property is TRUE, APP_EFD formats an output string containing the event header fields, creates an EV_MESSAGE event containing the output string and sends the event out the con terminal.


[2648] APP_EFD returns the status from the call to the out terminal.


[2649] 7. Typical Usage


[2650] 7.1 Dumping Event Header Fields Only


[2651]
FIG. 68 illustrates an advantageous use of part, APP_EFD


[2652] This example illustrates the typical usage of APP_EFD to dump the event header fields on the debug console. PART1 creates an event and sends it to APP_EFD. APP_EFD displays the event header fields and then forwards the event to PART2. PART2 performs some processing and returns.


[2653] 7.2 Dumping Entire Event Using Output Medium


[2654]
FIG. 69 illustrates an advantageous use of part, APP_EFD


[2655] This example illustrates the usage of APP_EFD used in conjunction with APP_BSD to dump the entire contents of the event to a log file. SYS_LOG is parameterized to auto-enable itself. PART1 creates an event and sends it to APP_EFD. APP_EFD creates an EV_MESSAGE event containing the output string and sends it out its con terminal to SYS_LOG. SYS_LOG writes the output string to a file. APP_EFD then forwards the event to APP_BSD creates an output string containing the remaining fields of the event bus, creates an EV_MESSAGE event containing that output string and sends it out its con terminal to SYS_LOG to be written to the file. APP_BSD then sends the event to PART2.


[2656] 7.3 Document References


[2657] None.


[2658] 7.4 Unresolved Issues


[2659] None.



APP_HEX—Event Hex Dump

[2660]
FIG. 70 illustrates the boundary of part, Event Hex Dump (APP_HEX)


[2661] 1. Functional Overview


[2662] APP_HEX is a pass-through filter that generates a hex dump of part or all of the data in the events that pass through it. The hex dump is formatted as a printable string and placed in the data field of an event, which is sent to the dmp output.


[2663] The hex dump is formatted using programmable prefix and suffix strings.


[2664] The part has the option of allocating the events it sends to dmp as ‘self-owned’ so that the final recipient can free them.


[2665] 2. Boundary
1422.1 TerminalsNameDirInterfaceNotesininI_DRAINAll events coming to this terminal are forwarded to out. A hexdump of the event data is generated and sent to the dmpterminal.outoutI_DRAINEvents from in are forwarded to this output with nomodification.dmpoutI_DRAINFormatted hex dump is sent to this output in the form of events(the event ID is specified as a property).


[2666]

143











2.2 Properties









Property




name
Type
Notes





prefix
asciz
Prefix string to append to formatted data. APP_HEX provides




no less than 40 characters of storage for this property.




Default value: “” (empty).


suffix
asciz
Suffix string to add to formatted data.




APP_HEX provides no less than 40 characters of storage for




this property.




Default value: “\n” (new line)


offs
uint32
Byte offset into the event bus of the first byte to be dumped.




Default value: 0


len
uint32
Maximum number of bytes to dump. APP_HEX will output the




minimum of len and bp->sz-offs bytes. If this property is set to




zero, all bytes from offs to the end of the event data are output.




Default value: 0


enable
uint32
A non-zero value enables the generation of dump messages. A




zero value disables the dump messages, making APP_HEX a




no-functionality pass-through.




Default value: 1 (dump enabled).


dmp_first
uint32
A non-zero value specifies that the hex dump is generated




before the incoming event is forwarded to out.




A zero value makes APP_HEX generate the dump after the




event is sent to out. WARNING: care should be taken when




using this option because the recipient frequently frees event




buses before the call returns.




Default value: 1 (dump before forwarding).


dmp_delay
uint32
A non-zero value delays sending of the generated dump




message to after the incoming event is sent to out. Note that




this property has no effect when dmp_first is set to 0 (see




above).




dmp_delay does not change the data that would be output, just




the order of execution. This option can be used if it is




necessary to change the order in which events are recorded




when using multiple instances of APP_HEX or if it is




necessary to have the possible processing delay introduced by




parts connected to the dmp output to happen after the call




passes through APP_HEX.




Default value: 0.


dmp_id
uint32
Defines the event ID to put in the id field of the event sent to




the dmp terminal.




Default value: EV_PULSE.


dmp_offs
uint32
Offset into the event data where the hex dump is to be placed.




If the value of this property is greater than 0, APP_HEX fills




the space between the end of the event header and the




beginning of hex data with binary zeros.




Default value: 0


attr
uint32
Attributes to ‘or’ with the ‘attr’ field of the events sent to dmp.




APP_HEX does not interpret that value, except that if the value




of attr includes the SELF_OWNED bit, APP_HEX will not




free the bus that it allocates for the events if the call to dmp




returns ST_OK.




Default value: ZEVT_A_SELF_CONTAINED +




ZEVT_A_SELF_OWNED.










[2667] 3. Events and Notifications


[2668] APP_HEX sends events with formatted hex data to the dmp terminal. Depending on parameterization, it may expect the recipient to free the event bus (see Properties above).


[2669] 3.1 Special Events, Frames, Commands or Verbs


[2670] None.


[2671] 4. Encapsulated Interactions


[2672] None.


[2673] 5. Specification


[2674] 5.1 Responsibilities


[2675] Generate formatted hex dump of incoming or returned data and send it to dmp.


[2676] 6. Theory of Operation


[2677] 6.1 State Machine


[2678] APP_HEX has no state.


[2679] 6.2 Main Data Structures


[2680] None.


[2681] 6.3 Mechanisms


[2682] No special mechanisms are used in APP_HEX.


[2683] 7. Use Cases


[2684] APP_HEX can be inserted anywhere in the path of unidirectional I_DRAIN connections.


[2685] APP_HEX can be combined with the standard library parts BSP and EFLT to produce assemblies for monitoring data on bidirectional I_DRAIN connection. Examples:


[2686] A. Monitoring requests and request completions on an asynchronous “client-server” connection:


[2687]
FIG. 71 illustrates an advantageous use of part, APP_HEX


[2688] B. Monitoring requests only on a symmetrical bidirectional connection. (Both the EFLT parts are programmed to filter the events with the ZEVT_A_COMPLETED attribute set, so that they bypass the two APP_HEX parts.


[2689]
FIG. 72 illustrates an advantageous use of part, APP_HEX



APP_EXCF—Exception Formatter

[2690]
FIG. 73 illustrates the boundary of part, Exception Formatter (APP_EXCF)


[2691] 1. Functional Overview


[2692] APP_EXCF accepts exception events (EV_EXCEPTION) on its in input and formats an exception message using the received data and a C ‘printf’ style format string. The formatted message is contained within one or more EV_MESSAGE event(s) that APP_EXCF generates out its out terminal.


[2693] APP_EXCF is parameterized with a set of format ID and format string pairs that it uses to format exception messages.


[2694] The format strings are used to format only the binary data from the exception event (the data field), all other fields are formatted using a pre-programmed format (described later in this document). APP_EXCF does not verify the validity of its format string properties in relation to the data it receives with the exception event, so care must be taken to ensure that the data passed with the event matches the specific format string arguments.


[2695] 2. Boundary
1442.1 TerminalsNameDirInterfaceNotesininI_DRAINAPP_EXCF formats the data coming with the EV_EXCEPTIONevents on its input and generates one or more EV_MESSAGEevents out its out terminal.outotI_DRAINEV_MESSAGE events are sent out this terminal. Theycontain the formatted exception data.


[2696]

145











2.2 Properties









Property name
Type
Notes





fmt[0].id. . .
uint32
Exception IDs


fmt[15].id

The default value is 0.


fmt[0].string
asciz
Format string to be used to format exception message


. . .

with fmt[x].id.


fmt[15].string

The syntax of this property is similar to the format string




of the C printf function.




The following formats are supported: % [l]d, % [l]u, % [l]x,




% s, and % c.




The default value is “”.










[2697]

146














Event
Dir
Bus
Notes















3.1 Terminal: in










EV_EXCEPTION
in
B_EV_EXC
Exception event







3.2 Terminal: out










EV_MESSAGE
out
B_EV_MSG
This event contains a formatted exception





message. The event that is generated is self-





contained and is expected to be processed





synchronously.










[2698] 3.3 Special Events, Frames, Commands or Verbs


[2699] None.


[2700] 3.4 Encapsulated Interactions


[2701] None.


[2702] 4. Specification


[2703] 4.1 Responsibilities


[2704] Format data coming with EV_EXCEPTION events and generate EV_MESSAGE event(s) out the out terminal containing the formatted data.


[2705] 4.2 Theory of Operation


[2706] 4.2.1 State Machine


[2707] None.


[2708] 4.2.2 Mechanisms



Unpacking Exception Data

[2709] APP_EXCF unpacks the exception data in the following way:
147byte, word, char→ unpacked as wordsdword, integer, and unsigned→ unpacked as dwordsintegerasciz string→ pointer to first character in dataunicode string→ unpacked as an empty string (i.e., not supported)binary data→ unpacked as specified number of dwords



Formatting Exception Messages

[2710] APP_EXCF searches its fmt[x].id properties for the exception id specified in the exception event. If the ID is found, it unpacks the data contained in the event and uses the fmt[x].string property along with the unpacked data as arguments to the vsprintf( ) function.


[2711] The formatted exception message contained in the EV_MESSAGE event that is generated by APP_EXCF has the following format:


[2712] File: <file_name>, Line: <line #>


[2713] formatted string from fmt[x].string and data fields received with the exception event


[2714] Class: <class_name>, Terminal: <term_name>, Operation: <oper_name>


[2715] <blank line>


[2716] If any of the fields is not specified in the exception message, it is not included. For example, if all fields in the exception message are blank except for the data, then APP_EXCF includes the following in the EV_MESSAGE event:


[2717] formatted string from fmt[x].string and data fields received with the exception event.



<blank line>


APP_EXCG—Exception Generator

[2718]
FIG. 74 illustrates the boundary of part, Exception Generator (APP_EXCG)


[2719] 1. Functional Overview


[2720] APP_EXCG generates an exception event out its exc terminal when it receives a specific event on its in input. APP_EXCG is hard parameterized with the trigger event ID and exception event parameters.


[2721] APP_EXCG does not have the ability to validate the correctness of the exception ID or its data parameters.


[2722] 2. Boundary
1482.1 TerminalsNameDirInterfaceNotesininI_DRAINInput for events that when received, APP_EXCG generates theexception event specified by its properties.excoutI_DRAINOutput for generated exception events.


[2723]

149











2.2 Properties









Property name
Type
Notes





enable
uint32
Boolean. When non-zero, APP_EXCG generates




exception events. When zero, APP_EXCG simply




returns a successful status.




This property is modifiable and the default is TRUE




(1).


trigger_ev
uint32
Event ID on which to generate an exception. If this




property is NULL, APP_EXCG will generate an




exception on every event.




This property is modifiable and the default is EV_PULSE.


exc_id
uint32
Exception ID to generate. If this property is 0,




APP_EXCG does not generate an exception.




This property is modifiable and the default value is 0.


severity
uint32
Exception severity [ZERR_XXX] to be filled in exception




bus.




This property is modifiable and the default value is




ZERR_ERROR.


class_name
asciz
DriverMagic Class name of originator of exception.




This property is modifiable and the default value is




“APP_EXCG”.


file_name
asciz
Source file name of originator of exception.




This property is modifiable and the default value is




“APP_EXCG.C”


line
uint32
Line number in file where exception occurred.




This property is modifiable and the default value is 0.


oid
uint32
Object ID of part generating exception.




This property is modifiable and the default value is the




oid of APP_EXCG.


fmt_string
asciz
Format string to store in “format” field of B_EV_EXC




bus. The format string can contain up to 4 formats




where their data values are stored in APP_EXCG's




xxx_arg properties. APP_EXCG only supports one




value for each format. See E_STD.H for a description of




the different formats.




This property is modifiable and the default value is “”.


byte_arg
uchar
Data storage for the following types of formats: b, c.




This property is modifiable and the default value is 0.


word_arg
uint16
Data storage for the following types of formats: w.




This property is modifiable and the default value is 0.


uint_arg
uint32
Data storage for the following types of formats: d, i, u.




This property is modifiable and the default value is 0.


string_arg
asciz
Data storage for the following types of formats: s.




This property is modifiable and the default value is “”.


unicode_arg
unicodez
Data storage for the following types of formats: S.




This property is modifiable and the default value is “”.










[2724]

150











3.1 Events and notifications


3.1 Terminal: in










Event
Dir
Bus
Notes





(trigger_ev)
in
void
APP_EXCG receives this event on its in terminal. In





response, it generates an EV_EXCEPTION event out its exc





terminal.


EV_EXCEPTION
out
B_EV_EXC
APP_EXCG sends this event out its exc terminal in





response to receiving an event on its in terminal.










[2725] 3.3 Special Events, Frames, Commands or Verbs


[2726] None.


[2727] 3.4 Encapsulated Interactions


[2728] None.


[2729] 4.Specification


[2730] 4.1 Responsibilities


[2731] If enabled and exc_id property is non-zero, generate an EV_EXCEPTION event out exc when (trigger_ev) event is received on in.


[2732] 4.2 Theory of Operation


[2733] 4.2.1 State Machine


[2734] None.


[2735] 4.2.2 Mechanisms



Initializing B_EV_EXC Bus

[2736] When APP_EXCG receives the (trigger_ev) event on its in terminal, it is enabled, and its exc_id property is non-zero, it allocates and initializes a B_EV_EXC bus to zero.


[2737] APP_EXCG then fills out the bus in the following way:
151B_EV_EXC.exc_idexo_idB_EV_EXC.exc_severityserverityB_EV_EXC.class_nameclass_nameB_EV_EXC.file_namefile_nameB_EV_EXC.lineline if not 0 otherwise_LINE_B_EV_EXC.oidoidB_EV_EXC.oid2selfB_EV_EXC.formatfmt_stringB_EV_ESC.dataformatted exception data


[2738] The exception data is formatted in the following way: APP_EXCG uses the contents of the fmt_string properties and packs the data using the appropriate values of its xxx_arg properties.



APP_EXCGS—Exception Generator on Status

[2739]
FIG. 75 illustrates the boundary of part, Exception Generator on Status (APP_EXCGS)


[2740] 1. Functional Overview


[2741] APP_EXCGS is an exception generator that generates an exception when an outgoing operation completes with a specific status.


[2742] APP_EXCGS passes all events received on its input to its output. If the completion status for a monitored event (received on in terminal) is equal to a specific status, APP_EXCGS generates an exception event (EV_EXCEPTION) and sends it out its exc terminal. The monitored event may complete synchronously or asynchronously. The monitored event id(s) and completion status can be parameterized through properties.


[2743] APP_EXCGS provides the ability to generate detailed exception messages upon specific event completion. It can be used in any application that requires generation of different exception events depending on the event completion status.


[2744] Note: For asynchronously completed events, APP_EXCGS does not enforce the completion to correspond to any of the events passed through its out terminal.


[2745] 2. Boundary
1522.1 TerminalsNameDirInterfaceNotesinbiI_DRAINAll events received on this terminal are forwarded through outterminal. If a monitored event completes with the specifiedstatus, an exception event will be submitted out throughterminal.outbiI_DRAINAll events received on this terminal are forwarded through interminal.If the completion of the monitored event has the specifiedcompletion statue, an exception event will be submitted outthrough exc terminal.excoutI_DRAINDepending on the completion status of the monitored event(s),APP_EXCGS may generate an EV_MESSAGE event out throughthis terminal.


[2746]

153











2.2 Properties









Property name
Type
Notes





trigger_ev
uint32
ID of the monitored event. If EV_NULL, all events will




be monitored.




Default is EV_NULL.


trigger_stat
uint32
Completion status that determines if APP_EXCGS should




generate a notification through its exc terminal.




Default is ST_OK.


enable
uint32
Boolean. When non-zero APP_EXCGS generates




exception events. When zero, APP_EXCGS does not




generate any exceptions.




This property is modifiable and the default is TRUE (1).


exc_id
uint32
Exception ID to generate. If this property is 0,




APP_EXCGS does not generate an exception. This ID has




to correspond to an actual exception message event from




the application/device exception messages DLL.




This property is modifiable and the default value is 0.


severity
uint32
Exception severity [ZERR_XXX] to be filled in exception




bus.




This property is modifiable and the default value is




ZERR_ERROR.


class_name
asciz
Class name of originator of exception.




This property is modifiable and the default value is




“APP_EXCGS”.


file_name
asciz
Source file name of originator of exception.




This property is modifiable and the default value is




“APP_EXCGS.C”


line
uint32
Line number in file where exception occurred.




This property is modifiable and the default value is 0.


oid
uint32
Object ID of part generating exception.




This property is modifiable and the default value is the




oid of APP_EXCGS.


fmt_string
asciz
Format string to store in “format” field of B_EV_EXC bus.




The format string can contain up to 4 formats where their




data values are stored in APP_EXCGS's xxx_arg




properties. APP_EXCGS only supports one value for




each format. See CM_EVT.H for a description of the




different formats.




This property is modifiable and the default value is “”.


byte_arg
uchar
Data storage for the following types of formats: b, c.




This property is modifiable and the default value is 0.


word_arg
uint16
Data storage for the following types of formats: w.




This property is modifiable and the default value is 0.


uint_arg
uint32
Data storage for the following types of formats: d, i, u.




This property is modifiable and the default value is 0.


string_arg
asciz
Data storage for the following types of formats: s.




This property is modifiable and the default value is “”.


unicode_arg
unicodez
Data storage for the following types of fonnats: S.




This property is modifiable and the default value is L“”.










[2747]

154













3. Events and notifications


3.1 Terminal: in










Event
Dir
Bus
Notes





(trigger_ev)
in
void
APP_EXCGS receives this event(s) on its in terminal.





When the event completes with trigger_stat,





APP_EXCGS generates an exception event through its





exc terminal.










3.2 Terminal: exc










Event
Dir
Bus
Notes


EV_EXCEPTION
in
B_EV_EXCEPTION
This event is generated by APP_EXCGS when the





completion status of the monitored event submitted





through out is equal to trigger_stat.










[2748] 3.3 Special Events, Frames, Commands or Verbs


[2749] None.


[2750] 3.4 Encapsulated Interactions


[2751] None.


[2752] 4. Specification


[2753] 4.1 Responsibilities


[2754] Monitor the events the events coming on in terminal and their completions coming on out terminal.


[2755] For the events which event ID is equal to trigger_ev (or all events if trigger_ev is EV_NULL) and completion status is equal to trigger_stat generate an exception event (EV_MESSAGE) through exc terminal.


[2756] When enable is equal to zero do not submit any events through exc terminal.


[2757] 4.2 Theory of Operation


[2758] 4.2.1 State Machine


[2759] None.


[2760] 4.2.2 Mechanisms



Generating Exceptions

[2761] On its in terminal, APP_EXCGS monitors the events that have their events ID equal to trigger_ev. If trigger_ev is s equal to EV_NULL, all events are monitored. Monitored events are forwarded through out terminal. When a monitored event completes with status equal to trigger_stat and if the enable property is TRUE, APP_EXCGS generates an exception message based upon its parameterization and submits it out through the exc terminal.


[2762] All non-monitored events are forwarded through out terminal without modification.


[2763] On its out terminal, APP_EXCGS monitors the completions of the events with ID equal to trigger_ev. If trigger_ev is s equal to EV_NULL, all completions are monitored. Monitored completions are forwarded through in terminal. If the completion status is equal to trigger_stat and the enable property is TRUE, APP_EXCGS creates an exception message, based upon its parameterization, and submits it out through the exc terminal.


[2764] Non-monitored events and events that do not have their ZEVT_A_COMPLETED attribute set are forwarded through in terminal without modification.


[2765] 4.3 Use Cases


[2766] None.



Test Framework


TST_DCC—Daisy-chain Connector for Tests

[2767]
FIG. 76 illustrates the boundary of part, TST_DCC Component


[2768] 1. Functional Overview


[2769] TST_DCC is a connector part for creating extendible test assemblies. It works in conjunction with the Test Menu Dispatcher (TST_TMD) to create hierarchical test menus that can be extended or modified by simply adding or replacing tester parts in the test assembly (see use case in the TST_TMD data sheet).


[2770] 2. Boundary
1552.1 TerminalsNameDirInterfaceNotesininI_TSTChain input. When called on this input TST_DCC decrementsthe chn_cnt field in the bus and if it is 0, passes the call to tst,otherwise it passes the call to out. Exception: on I_TST.run, ifall=TRUE, call is passed to tst first, then to out, return status inthis case is the status from tst if it is not OK, otherwise thestatus from out;(ST_NOT_CONNECTED from out isconverted to ST_OK if all=TRUE).outoutI_TSTChain output. Calls from in are passed to out if chn_cnt wasnot 1 on input or if all=TRUE (see in description). This outputmay be left unconnected.tstoutI_TSTTester connection output. Calls from in are passed to tst ifchn_cnt was 1 on input or if all=TRUE.


[2771] 2.2 Properties


[2772] none.



TST_DTA—Dynamic Test Adapter

[2773]
FIG. 77 illustrates the boundary of part, TST_DTA—Dynamic Test Adapter


[2774] 1. Functional Overview


[2775] The dynamic test adapter (TST_DTA) can be used in place of a tester part in cases when the creation/destruction of the tester part is a part of the test or when the tester part should not be created until other tests have been executed.


[2776] TST_DTA has the boundary of a tester part and can be used as one in creating test assemblies with the test framework parts (see TST_DCC and TST_TMD).


[2777] 2. Boundary
1562.1 TerminalsNameDirInterfaceNotesininI_TSTCommand input. TST_DTA behaves like a tester part on thisinput (see the TST data sheet that describes a tester boundary).When called on I_TST.get_info it returns the data specifiedby its name and attr properties.When called on 'run', TST_DTA creates the tester partspecified by its tst_cls property, binds to its terminals andpasses the call on to that part. When the call returns it destroysthe tester part.conoutUCONConsole I/O connection. This output should be connected to apart that provides console I/O services.TST_DTA redirects calls from the tester part's console outputto this output.


[2778]

157











2.2 Properties









Property name
Type
Notes





name
asciz
Menu title. This string is returned by TST_TMD) when



(80
′get_info′ is invoked on the in terminal.



max)
Mandatory.


attr
uint32
Attributes to return on ′get_info′. This should be either 0 or




TST_A_IS_MANUAL if the tests connected to the out




terminal should be executed only in manual mode.




Default value: 0.


tst_cls
asciz
Class name of the tester part to create. This should specify



(128
the class name of a part that conforms to the boundary



max)
definition of a tester part (see TST data sheet). TST_DTA




will not provide any properties to the tester part. If the tester




part requires parameterization, create an assembly that




contains the tester part & parameterization for it, then




specify that assembly's name as the value of this property.




This property is mandatory.


tst_in
asciz
Terminal name of the tester part's command input.



(64
Default value: “in”



max)


tst_con
asciz
Terminal name of the tester part's console I/O output.



(64
Default value: “con”



max)


create_s
uint32
Expected return status from I_FACT.cm_create. If this is not




OK, TST_DTA will not attempt to activate or call the tester




part at all, instead it will expect the part creation to fail with




the specified status.




Default value: ST_OK


destroy_s
uint32
Expected return status from I_P_FACT.cm_destroy. The




test is considered as ′failed′ if the status does not match, even




if the tester part returned OK on the I_TST.run call.




Default value: ST_OK


activate_s
uint32
Expected return status from I_CTRL.cm_activate. If this is




not OK, TST_DTA will not attempt to call the tester part at




all, instead it will expect the activation to fail with the




specified status.




Default value: ST_OK


deactivate_s
uint32
Expected return status from I_CTRL.cm_deactivate. The test




is considered as ′failed′ if the status does not match, even if




the tester part returned OK on the I_TST.run call.




Default value: ST_OK










[2779] 3. Use Cases


[2780] Use the TST_DTA in place of a tester part by placing an instance of TST_DTA where the tester part should be and parameterizing TST DTA to create the tester part itself. This provides the following benefits as opposed to creating the tester as part of the test assembly:


[2781] the tester part creation failure is properly reported as a failure of the test itself


[2782] the failure to create the tester does not prevent other tests in the assembly from running


[2783] the failure of the tester is expected and is the normal conclusion of the test


[2784] status from tester's destructor is verified



TST_DTAM—Dynamic Test Adapter for Multiple Tests

[2785]
FIG. 78 illustrates the boundary of part, TST_DTAM—Dynamic Test Adapter for Multiple Tests


[2786] 1. Functional Overview


[2787] The dynamic test adapter for multiple tests (TST_DTAM) can be used in place of a tester part in cases when the creation/destruction of the tester part is a part of the test, when the tester part should not be created until other tests have been executed or when multiple tests of a tester part need to be executed. This allows the tester part to be tested in different configurations (the configurations are kept in a descriptor which is specified through a property on TST_DTAM).


[2788] TST_DTAM has the boundary of a tester part and can be used as one in creating test assemblies with the test framework parts (see TST_DCC and TST_TMD).


[2789] 2. Boundary
1582.1 TerminalsNameDirInterfaceNotesininI_TSTCommand input. TST_DTAM behaves like a tester part on thisinput (see the TST data sheet that describes a tester boundary).When called on I_TST.get_info, it returns the data specifiedby its name and attr properties.When called on ′run′, TST_DTAM enumerates a descriptorand for each instance parameterization set, creates the testerpart specified by its tst_cls property. For each instance,TST_DTAM binds to its terminals, parameterizes the partaccording to the descriptor and passes the ′run′ call on to thatpart. When the call returns it destroys the tester part.ConoutI_CONConsole I/O connection. This output should be connected to apart that provides console I/O services.TST_DTAM redirects calls from the tester part's consoleoutput to this output.


[2790]

159











2.2 Properties









Property name
Type
Notes





name
asciz
Menu title. This string is returned by TST_DTAM



(80 max)
when ′get_info′ is invoked on the in terminal.




Mandatory.


attr
uint32
Attributes to return on ′get info′. This should be either




0 or TST_A_IS_MANUAL if the tests connected to the




out terminal should be executed only in manual mode.




Default value: 0.


tst_cls
asciz
Class name of the tester part to create. This should



(128 max)
specify the class name of a part that conforms to the




boundary definition of a tester part (see TST data




sheet). TST_DTAM will parameterize the part




according to descriptor.




This property is mandatory.


tst_in
asciz
Terminal name of the tester part's command input.



(64 max)
Default value: “in”


tst_con
asciz
Terminal name of the tester part's console I/O output.



(64 max)
Default value: “con”


descp
uint32
Pointer to the parameterization descriptor. Must be a




valid pointer.




See below for the definition of the descriptor.




Mandatory.










[2791] 3. Parameterization Descriptor


[2792] The parameterization descriptor is used to define the number of tester part instances that TST_DTAM should create along with their parameterization and expected return code for activation operations.


[2793] The descriptor is an array of DTAM_ENTRY structures defined as follows:
160typedef struct DTAM_ENTRYtag{uint32et_type;// entry type, [DTAM_ET_xxx]char*namep;// property name or scenario titleuint32type;// property type, [ZPRP_T_xxx]uint32value;// either property value to set or expected return// status for instance activation operations} DTAM_ENTRY;


[2794] The possible entry types are as follows:
161Entry TypeDescriptionDTAM_ET_SCENDefines the beginning of a scenario for an instance of the testerpart.DTAM_ET_PROPProperty to set on the tester part instance. If the set operationfails, the test is considered as ′failed′.DTAM_ET_ACTExpected return status from I_CTRL.cm_activate. If this is notOK, TST_DTAM will not attempt to call the tester part at all,instead it will expect the activation to fail with the specifiedstatus.DTAM_ET_ENDMarks the end of the descriptor. This must always appear in thelast entry in the descriptor.


[2795] Below is a list of macros used to define the descriptor:
162MacroDescriptiondtam_begin (name)Begin the descriptor definition. The nameparameter defines the name of the descriptor.dtam_endEnd the descriptor definition.dtam_scenario (title)Start a new scenario for the tester part. Thetitle parameter is a string that is displayedon the console before the test is ran.dtam_propX (name, type,Define a property to be set on the partvalue)instance.dtam_prop (name, value)Define a property to be set on the partinstance. Property type none(ZPRP_T_NONE) is assumed.dtam_act_stat (stat)Define the expected part activation returnstatus. If this is not used in a scenario theexpected return status for activation isST_OK.


[2796] After defining the descriptor, it should be parameterized as the descp property on a TST_DTAM instance


[2797] Here is an example of a descriptor defining the parameterization for two instances of the same tester part. The first instance passes the activation life-cycle operation OK but the second instance failed activation because a mandatory property is not set.
163dtam_begin (mydesc)// instance #1dtam_scenario(“Pass”)dtam_propX(“prop1”, ZPRP_T_UINT32, 32)dtam_propX(“prop2”, ZPRP_T_ASCIZ , “Hello”)// instance #2dtam_scenario(“Fail activation: mandatory property is not set”)dtam_propX(“prop1”, ZPRP_T_UINT32, 32)dtam_act_stat(ST_REFUSE) // prop2 is not setdtam_end


[2798] 4. Use Cases


[2799] Use the TST_DTAM in place of a tester part by placing an instance of TST_DTAM where the tester part should be and parameterizing TST_DTAM to create the tester part itself. This provides the following benefits as opposed to creating the tester as part of the test assembly:


[2800] multiple instances of the tester part can be created and parameterized in different ways as defined by descriptor


[2801] the tester part creation failure is properly reported as a failure of the test itself


[2802] the failure to create the tester does not prevent other tests in the assembly from running


[2803] the failure of the tester is expected and is the normal conclusion of the test


[2804] status from tester's destructor is verified



TST_TCN—Test Console I/O

[2805]
FIG. 79 illustrates the boundary of part, TST_TCN—Test Console I/O


[2806] 5. Functional Overview


[2807] The test console implements the I_CON interface. It can be used to build tests or in any other case where a system with console I/O functionality has to be built entirely out of parts connected with the standard Dragon terminal connection mechanisms.


[2808] A single instance of TST_TCN can serve any number of clients.


[2809] This part is system-specific. The actual physical implementation of the console is not defined here; it could be a serial I/O channel, a built-in text console, a window in a GUI environment or any other console-like device.


[2810] Note: in some implementations, TST_TCN may be restricted to a single instance. To avoid compatibility problems, always build test systems with a single TST_TCN instance and connect all parts that require console I/O to that instance.


[2811] 6. Boundary
1646.1 TerminalsNameDirInterfaceNotesconinI_CONAccept console I/O requests. This terminal will accept anynumber of connections. In a multi-threaded environment, thecalls from different threads will be serialized.


[2812]

165











6.2 Properties









Name
Type
Notes





dev_name
asciz
Device name to use as a console device. On some implementations,




this property may be ignored (e.g., if there is only one device that




could possibly be a console device).




Default value: system-specific; The implementation will always




provide a default value that represents a valid console I/O device.











TST_TMD—Test Menu Dispatcher

[2813]
FIG. 80 illustrates the boundary of part, TST_TMD


[2814] 7. Functional Overview


[2815] TST_TMD is a generic menu for use in creating tests and other similar text-based menu-driven systems.


[2816] This part works together with the daisy-chain connector (TST_DCC) to allow extendible and modifiable networks of tests to be created by using multiple instances of TST_TMD and TST_DCC in a Z-force assembly (see use case).


[2817] The menu displayed by TST_TMD is generated by collecting information from the chain of tester parts connected to the out terminal (which may include other TST_TMD parts as sub-menus). TST_TMD supports a chain of up to 35 tester parts (limitation imposed to simplify menu selection keys, which are 1..9, A..Z). TST_TMD also adds “run all” and “exit” items to the menu; a sample result looks as follows:


[2818] Title (as specified by the ‘name’ property)


[2819] 1. <test1 name> (obtained by calling out on get_info)


[2820] 2. <test2 name>


[2821] . . .


[2822] *.Run All


[2823] 0. Exit


[2824] Select (<esc> to exit, <sp>—re-display menu):


[2825] 8. Boundary
1668.1 TerminalsNameDirTypeNotesininI_TSTCommand input. TST_TMD behaves like a tester part on thisinput (see the TST data sheet that describes a tester boundary).When called on I_TST.get_info, it returns the data specified byits name and attr properties.When called on I_TST.run with all=FALSE, it enumerates anddisplays the chained tests connected to its output (out), displaysa menu and runs the test(s) selected by the operator.When called on I_TST.run with all=TRUE, it enumarates andexecutes all chained tests connected to out , possibly skippingtests that are manual-only (if TST_A_MANUAL is notspecified in the attr field).outoutI_TSTTest output. This output should be connected to a chain of one ormore DCC parts (see use case). TST_TMD calls this output onI_TST.get_info to collect information about the chained testsconnected to the DCC parts when displaying the menu.TST_TMD executes I_TST.run when the operator selects amenu item.conoutI_CONConsole I/O connection. This output should be connected to apart that provides console I/O services. TST_TMD uses thisoutput to display the test menu and to request operator input.


[2826]

167











8.2 Properties









Property name
Type
Notes





name
asciz
Menu title. This string is returned by TST_TMD when



(80 max)
′get_info′ is invoked on the in terminal.




Mandatory.


attr
uint32
Attributes to return on ′get_info′. This should be either 0




or TST_A_IS_MANUAL if the tests connected to the out




terminal should be executed only in manual mode.




Default = 0.


quiet_on_all
uchar
Set to TRUE to make TST_TMD set the A_QUIET bit




when operator selects “run all”. Default = FALSE.


force_all
uchar
Setting this to TRUE disables the menu and makes




TST_TMD convert each call to in.run to out.run with the




all field set to TRUE. This effectively makes the instance




of TST_TMD appear as a single test that aggregates all




tests chained to its out terminal.




Default=FALSE.










[2827] 9. Use Cases


[2828] This example shows how to assemble a test system that has a total of four tests, organized as a menu with three items (2 tests and 1 sub-menu with 2 more tests). Note that typically if a test is a sub-menu it will be made as an assembly and not directly connected as shown here with the dcc2/tmd2/dcc 2.1/dcc2.2 branch.


[2829] All that has to be done to add new tests to the menu is to connect a new instance of DCC to the end of the chain and attach the new tester part to it.


[2830]
FIG. 81 illustrates an advantageous use of part, TST_TMD and TST_DCC



FAC—The Factory

[2831]
FIG. 82 illustrates the boundary of part, FAC—Factory


[2832] 1. Functional Overview


[2833] FAC is a dynamic structure part that is compliant with the XDL creation pattern meaning that the lifecycle of a part is as follows:


create→parameterize→activate→lifecycle start→normal operation→lifecycle stop→deactivate→destroy


[2834] FAC provides the ability to dynamically create, destroy and provide lifecycle to part instances based on an event flow.


[2835] FAC generates and sequences part factory operations and lifecycle events out its fac and inst_lfc terminals when certain events (e.g., “create” and “destroy”) are received on its in terminal. In addition, FAC sends the “create” event out its prm terminal between the creation and activation of the part instance so that others may have the opportunity to parameterize the part; the event will contain the part instance ID of the newly created part.


[2836] Lifecycle events sent out the inst_lfc terminal contain the part's instance ID and will have the same attributes as the pending create or lifecycle event. FAC supports asynchronous completion of all lifecycle events.


[2837] FAC desynchronizes lifecycle completion events received on its inst_lfc terminal that would result in the deactivation and destruction of the part instance. This mechanism is used to prevent FAC from destroying a part while it is within the context of a call. It is the responsibility of the recipient of the event to allow enough time for the path of execution to unwind before giving the event back to FAC.


[2838] In addition to factory create and destroy events, FAC accepts part enumeration events on its in terminal (i.e., get_first and get_next). FAC simply converts these events into the corresponding I_FACT operation out its fac terminal.


[2839] FAC will refuse to accept any events on its in terminal before it has received a lifecycle start event on its lfc terminal. When a lifecycle stop event is received on the lfc terminal, FAC enumerates the part instances out its fac terminal and for each instance: generates a lifecycle stop event out its inst_lfc terminal and deactivates and destroys the instance when the stop event completes.


[2840] All event IDs as well as offsets into the events used to extract and store instance IDs and enumeration contexts are provided as properties.


[2841] FAC may be used at interrupt level although it is not recommended because creating and destroying parts at interrupt level may lead to unpredictable results.


[2842] 1. Boundary
1681.1 TerminalsNameDirInterfaceNoteslfcBidirI_DRAINInput for lifecycle events. FAC will refuseto create any parts before it receives alifecycle start event.FAC destroys all remaining parts when itreceives a lifecycle stop event.inBidirI_DRAINInput for factory create, destroy andenumeration events.No self-owned events are allowed on thisterminal.inst_lfcBidirI_DRAINOutput for part instance lifecycle events.FAC generates a start event after a partinstance has been created, parameterized,and activated.FAC generates a stop event just prior todeactivating and destroying a partinstance. The events have the part instanceID stamped at offset 0 and have identicalattributes to create or destroy event thatwas received on the in terminal.facOutI_FACTOutput for part instance factoryoperations. FAC uses this terminal tocreate/destroy part instances.prmOutI_DRAINFAC sends the create event (w/modifiedattributes) out this terminal just prior toactivating the part instance.The event will have the part instance IDstamped into the event at the specifiedoffset.A failed return status will result in FACdestroying the part instance and failing thepending create event.This terminal may remain unconnected.dsyBidirI_DRAINFloating terminal used to desynchronizethe deactivation and destruction of a partinstance resulting from the asynchronouscompletion of a lifecycle event.if this terminal is not connected, FAC onlygenerates synchronous events out itsinst_lfc terminal


[2843]

169











1.2 Properties









Property name
Type
Notes





create_ev
uint32
Specifies the ID of the event received on the in




terminal that signals the creation, parameterization,




activation, and lifecycle starting of a part instance out




FAC's fac and inst_lfc terminals.




This property is mandatory


destroy_ev
uint32
Specifies the ID of the event received on the in




terminal that signals the lifecycle stopping,




deactivation, and destruction of a part instance out




FAC's inst_lfc and fac terminals.




This property is mandatory.


get_first_ev
uint32
Specifies the ID of the event received on the in




terminal that is translated into an I_FACT.get_first




operation out the fac terminal.




If the value is EV_NULL, no event is specified.




The default is EV_NULL.


get_next_ev
uint32
Specifies the ID of the event received on the in




terminal that is translated into an I_FACT.get_next




operation out the fac terminal.




If the value is EV_NULL, no event is specified.




The default is EV_NULL.


use_id
uint32
Boolean. If TRUE, use the value stored at id_offs as the




instance ID. If FALSE, the instance ID is generated by




the creator of the part out the fac terminal.




This property is used only when processing the create




event.




the default is FALSE.


id_offs
uint32
Specifies the offset in the event bus where the part




instance id resides. FAC assumes that the part




instance ID as a 32-bit self-contained value.




The default is 0.


class_name.offs
uint32
Specifies the offset in the event bus where the zero-




terminated class name of the part instance to be




created is stored.




If the value is −1, FAC will not specify a class name in




the I_FACT.create operation bus.




This property is used only when processing the create




event.




The default is −1.


class_name.by_ref
uint32
Boolean. If TRUE, the field at class_name.offs is a




32-bit pointer. If FALSE, the class name is contained




within the event.




This property is used only when processing the create




event.




The default is FALSE.


enum_ctx_offs
uint32
Specifies the offset in the event bus where to store the




enumeration context. If the value is −1, don't use.




This property is only used if the get_first_ev and/or




get_next_ev properties are not EV_NULL.




Note that the context storage must be at lease sizeeof




(_ctx) big.




The default is −1.










[2844] 1.3 Events and Notifications
170EventDirBusNotes1.4 Terminal: lfcEV_LFC_REQ_STARTInvoidStart normal operation. FAC will refuse allevents on its in terminal prior to thereceipt of this event.EV_LFC_REQ_STOPInvoidStop normal operation. FAC enumerates,lifecycle stops, deactivates and destroys allexisting part instances out its inst_lfcand fac terminals.This event should be asynchronouslycompletable.1.5 Terminal: in(create_ev)InvoidWhen this event is received, FAC creates apart instance, forwards the event out theprm terminal, activates it, and feeds it alifecycle start event.This event should have whatever attributesthat are required for the generated lifecyclestart event(destroy_ev)InvoidWhen this event is received, FACgenerates a lifecycle stop event to thespecified instance and deactivates anddestroys the part instance.This event should have whatever attributesthat are required for the generated lifecyclestop event1.6 Terminal: inst_lfcEV_LFC_REQ_STARTOut4 bytesFAC sends this event to a newly createdinstance after it has activated the instanceand before completing the “create” event itreceived on its in terminal.This event contains the part instance IDstored at offset 0 and has attributesidentical to those of the create eventreceived on the in terminal.EV LFC_REQ_STOPOut4 bytesFAC sends this event just prior todeactivating and destroying a part instance.This event contains the part instance IDstored at offset 0 and has attributesidentical to those of the destroy eventreceived on the in terminal or the lifecyclestop event received on FAC's lfc terminal.1.7 Terminal: prm(create_ev)OutvoidThis event is identical to the create eventreceived on the in terminal except that issynchronous and contains the just-createdpart's instance ID stamped at id_offs1.8 Terminal: dsyEV_LFC_REQ_STARTBidirvoidThis event is sent when the lifecycle startevent sent to a part instance completesasynchronously with a failed status.When FAC receives this event, itdeactivates and destroys the part instanceand completes the pending create operationwith the failed status.EV_LFC_REQ_STOPBidirvoidThis event is sent when the lifecycle stopevent sent to a part instance completesasynchronously with a successful status.When FAC receives this event, itdeactivates and destroys the part instanceand successfully completes the pendingdestroy operation.


[2845] 2. Environmental Dependencies


[2846] 3. Encapsulated Interactions


[2847] None.


[2848] 4. Other Environmental Dependencies


[2849] None.



Specification

[2850] 1. Responsibilities


[2851] Create, activate, and provide lifecycle start to a part instance out the fac and inst_lfc terminals when create_ev is received on the in terminal.


[2852] Provide lifecycle stop to, deactivate and destroy a part instance out the inst_lfc and fac terminals when destroy_ev is received on the in terminal.


[2853] Forward the create_ev event received on the in terminal out the prm terminal just prior to activating the just-created part instance


[2854] Desynchronize asynchronously completed part instance lifecycle events out the dsy terminal when the completion of the event results in the deactivation and destruction of the part instance.


[2855] Deactivate and destroy the part instance out the fac terminal and complete the pending create or destroy event out the in terminal when an event is received on the dsy terminal.


[2856] Translate get_first_ev and get_next_ev events received on the in terminal into get_first and get_next operations out the fac terminal.


[2857] 2. External States


[2858] None.


[2859] 3. Use Cases


[2860] 4. Creating a Part Instance


[2861] This use case describes the actions taken by FAC when a create_ev event is received on the in terminal.


[2862] create_ev event is received on the in terminal.


[2863] FAC generates a create operation out its fac terminal


[2864] If the create operation is successful, FAC stores the part instance ID in the create_ev event and forwards the event out the prm terminal.


[2865] If the return status is successful, FAC generates an activate operation out its fac terminal.


[2866] If the return status is successful, FAC generates a lifecycle start event out its inst_lfc terminal with the same attributes as the create_ev event received on the in terminal.


[2867] If any part of this process fails, FAC deactivates and destroys the part instance and fails the create_ev event.


[2868] 5. Destroying a Part Instance


[2869] This use case describes the actions taken by FAC when a destroy_ev event is received on the in terminal.


[2870] destroy_ev event is received on the in terminal.


[2871] FAC generates a lifecycle stop event out its inst_lfc terminal with the same attributes as the destroy_ev event received on the in terminal.


[2872] When the stop event completes, FAC deactivates and destroys the part instance out its fac terminal.


[2873] FAC completes the destroy_ev event.


[2874] Note: If for some reason, the part instance fails deactivation or destruction, FAC will not attempt to re-start or re-activate the part instance.


[2875] 6. Enumerating Part Instances


[2876] This use case describes the enumeration of part instances.


[2877] FAC receives a get_first ev_event on its in terminal


[2878] FAC generates a get_first_operation out its fac terminal, stores the returned part instance ID and enumeration context into the event, and returns.


[2879] FAC receives one or more get_next_ev events on its in terminal.


[2880] FAC extracts the enumeration context from the event, generates a get_next operation out its fac terminal, stores the returned part instance ID and enumeration context into the event, and returns.


[2881] 7. Asynchronous Completion of Part Instance Lifecycle


[2882] This use case describes the actions taken by FAC when a part instance asynchronously completes a lifecycle event that results in the deactivation and destruction or the part instance.


[2883] There are two situations where the asynchronous completion of a part instance lifecycle event will result in the deactivation and destruction of the part instance: asynchronous completion of lifecycle start event with a failed status and asynchronous completion of lifecycle stop event with a successful status.



Asynchronous Failure of Lifecycle Start Event

[2884] FAC receives a create_ev on its in terminal and has created and activated the part instance.


[2885] FAC generates an asynchronous lifecycle start event out its inst_lfc terminal and the call returns ST_PENDING; FAC returns ST_PENDING for the create_ev.


[2886] At a later time, FAC receives the lifecycle start completion event on its inst_lfc terminal containing a failed status.


[2887] FAC forwards the lifecycle event out its dsy terminal and returns.


[2888] FAC receives the lifecycle event on its dsy terminal and proceeds to deactivate and destroy the part instance out its fac terminal followed by completing the pending create_ev event out its in terminal with the failed status.



Asynchronous Completion of Lifecycle Stop Event with a Failed Status

[2889] FAC receives a destroy_ev on its in terminal.


[2890] FAC generates an asynchronous lifecycle stop event out its inst_lfc terminal and the call returns ST_PENDING; FAC returns ST_PENDING for the destroy_ev.


[2891] At a later time, FAC receives the lifecycle stop completion event on its inst_lfc terminal containing a successful status.


[2892] FAC forwards the lifecycle event out its dsy terminal and returns.


[2893] FAC receives the lifecycle event on its dsy terminal and proceeds to deactivate and destroy the part instance out its fac terminal followed by completing the pending destroy_ev event out its in terminal with the successful status.



Typical Usage

[2894] 1. Creating & Parameterizing Part Instances Based on Event Flow


[2895]
FIG. 83 illustrates an advantageous use of part, FAC—Factory


[2896] In this usage, FAC is assembled with PRM and ARR so that in addition to the standard lifecycle, newly created parts may also be parameterized using fields within the create event. A sequencer (SEQ) is used to forward the create and destroy events to FAC as well as to the part instance.



System Startup

[2897] APP receives a lifecycle start event on its if c terminal and is directed to fac and therefore fac is ready to start accepting factory events.



Instance Creation

[2898] APP receives a create event and is forwarded to seq. seq first sends the event out its out1 terminal and is received by fac. fac creates the part instance and stores the instance ID in the event bus. fac then sends the event out its prm terminal. p1 and p2 receive the event and generated property set operations as per their parameterization. fac then activates the part instance and sends a lifecycle start event to the part's lfc terminal. The lifecycle event completes successfully and fac completes the create event successfully. seq then forwards the create event to the part instance out its out2 terminal.



Instance Destruction

[2899] APP receives a destroy event and is forwarded to seq. seq first sends the event out its out2 terminal and is received by the part instance. The event completes and then seq sends the event out its out1 terminal and is received by fac. fac generates a lifecycle stop event out its inst_lfc terminal and is received by the part instance's lfc terminal. The event completes successfully and fac proceeds to deactivate and destroy the part instance out its fac terminal and returns.



System Shutdown

[2900] APP receives a lifecycle stop event on its if c terminal and is subsequently received by fac. fac enumerates the part instances out its fac terminal and for each instance found, generates a lifecycle stop event and then deactivates and destroys the instance. When all instances have been destroyed, fac completes the stop event.


[2901] 2. Document References


[2902] None.


[2903] 3. Unresolved Issues


[2904] None.



CMX—Connection Multiplexer/De-multiplexer

[2905]
FIG. 84 illustrates the boundary of part, CMX—Connection Multiplexer/De-multiplexer


[2906] 1. Functional Overview


[2907] CMX is a connectivity part that allows a single bidirectional terminal to be connected to multiple distinguishable bidirectional terminals and vice versa. Operations received on the bi terminal are forwarded out the mux terminal using a connection ID or an internally generated id stored in the operation bus. Operations received on the mux terminal are forwarded out the bi terminal with CMX stamping the connection id and optionally stamping an external connection context into the bus.


[2908] While CMX is active, it has the option to generate event requests out its ctl terminal when a connection is established and/or dissolved on its mux terminal. These requests provide the recipient with the ability to assign an external context to the connection, which can be used at a later time to process operation requests more efficiently.


[2909] CMX can be used to dispatch requests to one of many recipients (e.g., parts within a part array) or to connect multiple clients to a single server.


[2910] Both of CMX's input terminals are unguarded and may be invoked at interrupt time.


[2911] 2. Boundary
1712.1 TerminalsNameDirInterfaceNotesbibiI_POLYOperations received on this terminal are forwarded tothe mux terminal. The connection is specified by aconnection ID or an internally generated identifierstored in the operation bus.muxbiI_POLYOperations received on this tenninal are redirected tothe bi terminal. CMX stamps a connection identifierand context into the operation bus before forwardingthe operation.This is an “infinite cardinality” output-unlike anormal output terminal, it will accept any number ofsimultaneous connections.This terminal may be connected and disconnected whilethe part is active.ctlOutI_DRAINEvent requests are generated out this terminal when themux terminal is connected and/or disconnected whileCMX is active.This terminal may remain unconnected and may not beconnected while the part is active.


[2912]

172











2.2 Properties









Property name
Type
Notes





use_conn_id
uint32
Boolean. When TRUE, CMX uses a connection ID




to dispatch operations received on the bi terminal




to the mux terminal.




When FALSE, CMX uses an internally generated id




stored in the operation bus to dispatch the call




(faster than when using the connection id).




Default is FALSE.


Id_offset
uint32
Offset in operation bus for connection ID storage.




When use_conn_id is FALSE,it is assumed that




id_offset specifies the offset of a _ctx field in




the operation bus; otherwise it assumes that




id_offset specifies the offset of a DWORD field.




The default is 0.


conn_c tx_offset
uint32
Offset in operation bus where the connection




context returned on ctl_connect_ev request is




stored for operations traveling from mux to bi. This




field must be properly aligned.




When the value is −1 and/or CMX's ctl terminal is




not connected, no context is stored in the bus.




The default is −1.


Ctl_connect_ev
uint32
Event request to generate out ctl when a




connection on the mux terminal is established




(connected).




When the value is EV_NULL, no event is generated.




The default is EV_NULL.


ctl_disconnect_ev
uint32
Event to generate out ctl when a connection on the




mux terminal is dissolved (disconnected).




When the value is EV_NULL no event is generated.




The default is EV_NULL.


ctl_bus_sz
uint32
Size of event bus for connect and disconnect event




requests generated out the ctl terminal.




The value of this property must be at least as large




to accommodate storage for connection ID and




context as specified the ctl_id_offset and




ctl_conn_ctx_offset properties.




The default is 0.


Ctl_id_offset
uint32
Offset in event bus for connection id storage.




When use_conn_id is FALSE, it is assumed that




ctl_id_offset specifies the offset of a _ctx field




in the operation bus; otherwise it is assumes that




Ctl_id_offset specifies the offset of a DWORD




field. Either field must be properly aligned.




When the value is −1, no ID is stored in the event




bus.




The default is −1.


Ctl_Conn_Ctx_offset
uint32
Offset in event bus for connection context storage.




The recipient of the ctl_connect_ev request




provides the connection context and this context is




stamped into the bus of operations traveling from




mux to bi. The field must be properly aligned.




When the value is −1, no context is stored in the




event bus.




The default is −1.










[2913]

173











3. Events and notifications


3.1 Terminal: ctl










Event
Dir
Bus
Notes





(Ctl_connect_ev)
out
any
CMX generates this request when a connection is





established on its mux terminal.





The event data may contain a connection identifier as





specified by the use_conn_id property.


(Ctl_disconnect_ev)
out
any
CMX generates this request when a connection is





dissolved on its mux terminal.





The event data may contain a connection identifier as





specified by the use_conn_id property and or a





connection context that was returned with the





ctl_connect_ev request.










[2914] 4. Environmental Dependencies


[2915] 4.1 Encapsulated Interactions


[2916] None.


[2917] 4.2 Other Environmental Dependencies


[2918] None.


[2919] 5. Specification


[2920] 6. Responsibilities


[2921] 1. Forward operations received on bi to mux using the connection ID specified at id_offset when use_conn_id is TRUE.


[2922] 2. Forward operations received on bi to mux using an internally generated connection id specified at id_offset when use_conn_id is FALSE.


[2923] 3. Stamp connection ID as specified by use_conn_id into bus on operations traveling from mux to bi.


[2924] 4. Stamp connection context into bus of operations traveling from mux to bi if conn_ctx_offset is not −1.


[2925] 5. Generate event request out ctl terminal when a connection on mux terminal is established and the value of the ctl_connect ev property is not EV_NULL.


[2926] 6. Generate event request out ctl terminal when a connection on mux terminal is dissolved and the value of the ctl_disconnect_ev property is not EV_NULL.


[2927] 7. External States


[2928] None.


[2929] 8. Use Cases


[2930] 8.1 Mux Terminal Connection


[2931] This use case describes the actions taken by CMX when it receives a request to establish a connection on its mux terminal


[2932] If the value of the ctl_connect_ev property is EV_NULL or the ctl terminal is not connected, CMX establishes the connection and returns.


[2933] CMX allocates a ctl_connect_ev event request and if the use_conn_id property is TRUE, stores the actual connection ID at ctl_conn_id_offset; otherwise it stores an internally generated connection ID at ctl_conn_id_offset.


[2934] CMS sends the event out the ctl terminal. If the return status is not ST_OK, CMX fails the connect request with ST_REFUSE; otherwise CMX stores the connection context specified at ctl_conn_ctx_offset into the data for the connection and returns success.


[2935] 8.2 Mux Terminal Disconnection


[2936] This use case describes the actions taken by CMX when it receives a request to dissolve a connection on its mux terminal.


[2937] If the value of the ctl_disconnect_ev property is EV_NULL or the ctl terminal is not connected, CMX dissolves the connection and returns.


[2938] CMX allocates a ctl_disconnect_ev event request and if the use_conn_id property is TRUE, stores the actual connection ID at ctl_conn_id_offset; otherwise it stores an internally generated connection ID at ctl_conn_id_offset. CMX also stores the connection context that was returned on ctl_connect_ev at ctl_conn_ctx_offset.


[2939] CMX sends the event out the ctl terminal. If the return status is not ST_OK, CMX displays output to the debug console, dissolves the connection, and returns ST_OK; otherwise it simply dissolves the connection and returns ST_OK.


[2940] 8.3 De-multiplexing Operations


[2941] When CMX receives an operation on its bi terminal, it extracts the connection identifier stored at id_offset in the operation bus and interprets its value based on the value of its use_conn_id property. CMX selects the appropriate connection on its mux terminal and forwards the operation without modification.


[2942] 8.4 Multiplexing Operations


[2943] When CMX receives on operation on its mux terminal, it performs the following actions before forwarding the operation to its bi terminal:


[2944] Stamps the connection identifier at id_offset based on the value of its use_conn_id property.


[2945] Stamps the connection context associated with the connection at conn_ctx_offset.


[2946] Forwards the operation to the bi terminal.


[2947] 9. Typical Usage


[2948] 9.1 Using CMX to Allow Connection of Multiple Clients to a Single Server


[2949] This example illustrates how CMX can be used to manage the connections between multiple clients and a single server component. It is assumed that the server is able to handle multiple sessions at a time.


[2950]
FIG. 85 illustrates an advantageous use of part, CMX—Connection Multiplexer/De-multiplexer


[2951] In the above scenario, CMX's use_conn_id property is set to FALSE. When a connection is established, CMX generates a connect request out its ctl terminal and the server returns a connection context that CMX is to stamp into the bus of operations received on that connection of the mux terminal. This gives the server the ability to quickly identify the client that originated an operation request it receives.


[2952] When CMX receives a request on its mux terminal, it stamps the connection identifier of the connection on which it received the call into the operation bus and stamps the connection context provided by the server and forwards the call out its bi terminal. When CMX receives a request on its bi terminal from the server, it extracts the connection identifier from the operation bus, resolves the mux terminal connection and forwards the operation.


[2953] When CMX receives a disconnect request, it generates an event request out its ctl terminal to allow the server to perform any necessary cleanup before the connection is dissolved.


[2954] 9.2 Using CMX with the Dynamic Structure Framework


[2955] This example illustrates how CMX is used with the Dynamic Structure Framework parts. Its functionality is similar to that of CDMB.


[2956]
FIG. 86 illustrates an advantageous use of part, CMX—Connection Multiplexer/De-multiplexer


[2957] In the above scenario, CMX's use_conn_id property is set to TRUE. When a request is distributed to any of the part instances it carries an identifier that uniquely specifies the actual recipient (part instance (i.e., connection) ID). CMX extracts the identifier from the incoming request and dispatches the request to the corresponding part instance.


[2958] 10. Document References


[2959] None.


[2960] 11. Unresolved Issues


[2961] None.



FMX—Fast Connection Multiplexer/De-multiplexer

[2962]
FIG. 87 illustrates the boundary of part, FMX—Fast Connection Multiplexer/De-multiplexer


[2963] 1. Functional Overview


[2964] FMX is a connectivity part that allows a single bidirectional terminal to be connected to multiple distinguishable bi-directional terminals and vice versa. Operations received on the bi terminal are forwarded out the mux terminal using an externally generated ID (i.e., connection ID), provided that the ID is in a single pre-defined contiguous range (bit field). If for some reason, FMX is not able to dispatch the operation out the mux terminal (e.g., due to invalid ID or the ID is out of range), the incoming operation is forwarded out the aux terminal.


[2965] Operations received on the mux terminal are forwarded out the bi terminal with FMX optionally stamping the connection id into the bus. All operations received on the aux terminal are forwarded out the bi terminal without modification.


[2966] FMX can be used to quickly dispatch requests (by index rather than searching) to one of many recipients (e.g., parts within a part array) or to connect multiple clients to a single server.


[2967] All of FMX's input terminals are unguarded and may be invoked at interrupt time.


[2968] 2. Boundary
1742.1 TerminalsNameDirInterfaceNotesbibiI_POLYOperations received on this terminal are forwarded tothe mux terminal. The connection is specified by aconnection ID.muxbiI_POLYOperations received on this terminal are redirected tothe bi terminal.If parameterized, FMX applies the reverse action ofmask and shift to the connection ID and stamps it intothe operation bus before forwarding the operation.This is an “infinite cardinality” output-unlike a normaloutput terminal, it will accept any number ofsimultaneous connections.If connections are established while the part is inactive,the id_xxx properties must have been set first.Otherwise connection may fail. FMX will failactivation if the id_xxx properties are changed after aconnection is established.auxbiI_POLYOperations received on this terminal are redirected tothe bi terminal. Non-dispatch-able operations receivedon the bi terminal are redirected out this terminal.This terminal may remain unconnected (floating)


[2969]

175











2.2 Properties









Property name
Type
Notes





id_offset
uint32
Specifies the offset in the operation bus for connection




ID storage.




FMX assumes that id_offset specifies the offset of a




DWORD field.




The default is 0.


id_mask
uint32
Specifies a bit mask that is ANDED with the ID




stored at id_offset before determining if the ID is




within FMX's parameterized range.




The default is Oxffffffff.


id_shift
uint32
Specifies the number of bits to shift the ID stored at




id_offset to the right.




The ID is shifted after the application of id_mask.




The default is 0.


id_base
uint32
Specifies the base value of connection IDs for




operations to be dispatched out the mux terminal.




The default is 0.


n_conn
uint32
Specifies the maximum number of connections that




can be established on the mux terminal.




Note: memory resources are allocated, which are




proportional to the number of connections.




The default is 1.


stamp_id
uint32
Boolean. If TRUE, FMX stamps the connection ID into




the bus before forwarding operations received on mux




to bi. If FALSE, FMX forwards the operation without




modification.




The default is FALSE.










[2970] 3. Events and Notifications


[2971] None.


[2972] 4. Environmental Dependencies


[2973] 4.1 Encapsulated Interactions


[2974] None.


[2975] 4.2 Other Environmental Dependencies


[2976] None.


[2977] 5. Specification


[2978] 5.1 Responsibilities


[2979] 1. Reject attempts to connect the mux terminal if the specified connection ID is outside the range specified by id_base and n_conn or if a connection has already been established for that ID.


[2980] 2. Apply id_mask and id_shift to connection IDs received on terminal operations before determining if the ID is in range.


[2981] 3. Forward operations received on bi to mux using the connection ID specified at id_offset.


[2982] 4. Apply id_mask and id_shift operations to the connection ID and verify that the resulting value is within range before forwarding operation out the mux terminal.


[2983] 5. Forward operations received on bi out aux if the operation cannot be dispatched out mux (e.g., connection ID is out of range).


[2984] 6. If stamp_id is TRUE, stamp connection ID into bus on operations traveling from mux to bi with the mask and shift applied (affecting only the bits for which id_mask is 1, preserving those that are 0 in id_mask).


[2985] 7. Forward operations received on aux to bi without modification.


[2986] 5.2 External States


[2987] None.


[2988] 6. Use Cases


[2989] 6.1 De-multiplexing Operations


[2990] When FMX receives an operation on its bi terminal, it extracts the connection identifier stored at id_offset in the operation bus, applies the id_mask and id_shift properties to the value, verifies that the resulting ID within range, selects the appropriate connection on its mux terminal and forwards the operation without modification.


[2991] If for some reason, FMX is unable to dispatch the operation out the mux terminal, it forwards the operation out the aux terminal. If the aux terminal is not connected, it returns ST_INVALID for the call.


[2992] 6.2 Multiplexing Operations


[2993] When FMX receives an operation on its mux terminal, it performs the following actions before forwarding the operation to its bi terminal:


[2994] Applies the reverse action of id_mask and id_shift properties to the connection identifier if stamp_id is TRUE. The ID is shifted to the left the number of bits specified by id_shift. And the mask is applied in such a way that it affects only the bits for which id mask is 1, preserving those that are 0 in id_mask.


[2995] Stamps the connection identifier at id_offset if stamp_id is TRUE.


[2996] Forwards the operation to the bi terminal.


[2997] 7. Typical Usage


[2998] 7.1 Using FMX to Allow Connection of multiple Clients to a Single Server


[2999] This example illustrates how FMX can be used to manage the connections between multiple clients and a single server component. It is assumed that the server is able to handle multiple sessions at a time.


[3000]
FIG. 88 illustrates an advantageous use of part, FMX—Fast Connection Multiplexer/De-multiplexer


[3001] In the above scenario, FMX's stamp_id property is set to TRUE.


[3002] When FMX receives a request on its mux terminal, it stamps the connection identifier of the connection on which it received the call into the operation bus and forwards the call out its bi terminal. When FMX receives a request on its bi terminal from the server, it extracts the connection identifier from the operation bus, resolves the mux terminal connection and forwards the operation.


[3003] 7.2 Using FMX with the Dynamic Structure Framework


[3004] This example illustrates how FMX is used with the Dynamic Structure Framework parts. Its functionality is similar to that of CDMB and CMX.


[3005]
FIG. 89 illustrates an advantageous use of part, FMX—Fast Connection Multiplexer/De-multiplexer


[3006] In the above scenario, FMX's stamp_id property is set to FALSE. When a request is distributed to any of the part instances it carries an identifier that uniquely specifies the actual recipient (part instance (i.e., connection ID). FMX extracts the identifier from the incoming request and dispatches the request to the corresponding part instance.


[3007] 7.3 Using FMX with Static Connection IDs


[3008] Please note, this typical usage requires the ability to explicitly specify connection IDs when connecting parts statically within an XDL assembly.


[3009] This example illustrates how FMX is used to multiplex/de-multiplex connections between statically assembled parts.


[3010]
FIG. 90 illustrates an advantageous use of part, FMX—Fast Connection Multiplexer/De-multiplexer


[3011] This example is similar to the one previously described (using FMX to allow connection of multiple clients to single server) except that rather than the clients residing within an array, the clients are statically connected to FMX using unique connection IDs specified in the assembly's connection table.


[3012] The clients generate requests to FMX's mux terminal. FMX stamps the connection ID into the bus and forwards the operation to SRV. SRV does some stuff and then sends a response back to the client. FMX receives the response, extracts the ID and dispatches the operation to the specified client.


[3013] 8. Document References


[3014] None.


[3015] 9. Unresolved Issues


[3016] None.



SMX8—Static Multiplexer/De-multiplexer

[3017]
FIG. 91 illustrates the boundary of part, SMX8—Static Multiplexer/De-multiplexer


[3018] 1. Functional Overview


[3019] SMX8 is a connectivity part that allows multiplexing a single bi-directional terminal through 8 bi-directional terminals based on a value within the operation bus.


[3020] Operations received on the bi terminal are forwarded through one of the muxX terminals based on the terminal index retrieved from the operation bus. If SMX8 is unable to dispatch the operation through one of the muxX terminals (e.g., due to a terminal index that is out of range), the incoming operation is forwarded out the aux terminal.


[3021] Operations received through one of the muxX terminals are forwarded through the bi terminal. Before forwarding the operation through bi, SMX8 stamps the corresponding terminal index into the operation bus. All operations received on the aux terminal are forwarded through the bi terminal without modification.


[3022] SMX8 is typically used to multiplex incoming operations from multiple parts to one recipient and then de-multiplex the operations back to their respective parts upon completion.


[3023] All of SMX8's input terminals are unguarded and may be invoked at interrupt time.


[3024] 2. Boundary
1762.1 TerminalsNameDirInterfaceNotesbii/oI_POLYOperations received through this terminal are forwardedthrough one of the muxX terminals (mux0 through mux7)based on the terminal index stored in the operation busat the parameterized location.mux0-i/oI_POLYOperations received through these terminals are passedmux7through the bi terminal. The corresponding terminalindex is stamped in the bus at the parameterizedlocation before the operation is forwarded through bi.These terminals may remain unconnected (floating).auxi/oI_POLYOperations received on this terminal are passed throughthe bi terminal without modification. Non-dispatchableoperations received on the bi terminal are passedthrough this terminal without modification.This terminal may remain unconnected (floating).


[3025]

177











2.2 Properties









Property name
Type
Notes





offset
uint32
Specifies the offset in the operation bus where the




terminal index is stored (specified in bytes).




SMX8 assumes that offset specifies the offset of




a DWORD field.




The default is 0 (first field in the operation bus).


mask
uint32
Specifies a bit mask that is ANDed with the




terminal index stored at offset before shifting it.




The default is OxFFFFFFFF (no change).


shift
uint32
Specifies the number of bits to shift the terminal




index stored at offset.




The value at the offset field is shifted after the




application of mask and before multiplexing the




operation.




SMX8 always shifts the terminal indexes to the




right.




The default is 0 (no shift).


base
uint32
Specifies the base value of the terminal indexes.




A value of(0 + base) identifies mux0, a value of(1 +




base) identifies mux1, ..., and a value of(7 +




base) identifies mux7.




The default is 0.


stamp_ndx
uint32
Boolean.




Specifies whether to stamp the terminal index in




the operation bus for operations received through




the muxX terminals.




The default value is FALSE.










[3026] 3. Events and Notifications


[3027] None.


[3028] 4. Environmental Dependencies


[3029] 4.1 Encapsulated Interactions


[3030] None.


[3031] 4.2 Other Environmental Dependencies


[3032] None.


[3033] 5. Specification


[3034] 5.1 Responsibilities


[3035] 1. Forward operations received on bi through one of the muxX terminals (mux0 through mux7) using the terminal index specified by of f set.


[3036] 2. Apply mask and shift operations to the terminal index in the incoming operation bus.


[3037] 3. If specified, before forwarding through bi, stamp the terminal index into the operation bus for operations received on the muxX terminals with the specified mask and shift applied (affecting only the bits for which mask is 1, keeping those that are 0 in mask the same as previous).


[3038] 4. Forward operations received through bi out aux if the operation cannot be dispatched through one of the muxX terminals (e.g., terminal index is out of range).


[3039] 5. Forward operations received through aux to bi without modification.


[3040] 5.2 External States


[3041] None.


[3042] 6. Use Cases


[3043] 6.1 De-multiplexing Operations


[3044] When SMX8 receives an operation through its bi terminal, it extracts the terminal index from the operation bus at offset, identifying which terminal to send the operation through. SMX8 then applies the mask and shift properties to the value and forwards the operation through the corresponding muxX terminal.


[3045] If the terminal index is out of range (or the corresponding muxX terminal is not connected), SMX8 forwards the operation through the aux terminal. If the aux terminal is not connected, SMX8 returns ST_NOT_CONNECTED.


[3046] 6.2 Multiplexing Operations


[3047] When SMX8 receives an operation on one of its muxX terminals, it performs the following actions before forwarding the operation through the bi terminal:


[3048] SMX8 calculates a value to stamp into the operation bus by adding the terminal index to base. After the value to stamp is calculated, SMX8 ANDs (bitwise) it with the mask property value. Next, SMX8 ANDs (bitwise) the event field value with the complement of the mask property value. Finally, the two resulting values are ORed together. Below is the formula used by SMX8 to update the specified event field in the incoming event:


event field value=(event field value & ˜mask)|(value & mask)


[3049] SMX8 then forwards the operation through the bi terminal.


[3050] 7. Typical Usage


[3051] 7.1 Using SMX8 to Distribute Events Among Multiple Parts


[3052] This example illustrates how SMX8 can be used to forward events among multiple parts.


[3053]
FIG. 92 illustrates an advantageous use of part, SMX8—Static Multiplexer/De-multiplexer


[3054] Above, smx8 receives an event from p1 intended for part a through the mux1 terminal. smx8 stamps a multiplex context in the event bus identifying the terminal and then forwards the event through bi to a. At a later time, smx8 receives the completion of this event from a through bi and de-multiplexes (based on the multiplex index stamped by smx8) the event to p1 through mux1.


[3055] 8. Document References


[3056] None.


[3057] 9. Unresolved Issues


[3058] None.



EDFX—Extended Data Field Extractor

[3059]
FIG. 93 illustrates the boundary of part, EDFX—Extended Data Field Extractor


[3060] 1. Functional Overview


[3061] EDFX is a data manipulation part that extracts a value from the incoming event and stores it into another location in the same event. The location of the value to extract and the target storage are parameterized through properties.


[3062] EDFX modifies the data value before storing it in the event using a bit-wise AND mask and by performing a SHIFT operation on the data. The place from which the value is extracted is either in the body of the event or specified by a reference pointer placed in the event body.


[3063] The size of the source data may be 1, 2, 3 or 4 bytes long and can be in various byte orders (i.e., MSB first, LSB first or the processor native byte order).


[3064] The target storage is always in the event body, 4 bytes aligned and in native byte order.


[3065] EDFX is typically used to extract values from event data and store it in a native processor format in the event body, so the value can be processed by another part.


[3066] EDFX is not guarded and may be used in interrupt contexts.


[3067] 2. Boundary
1782.1 TerminalsNameDirTypeNotesininI_DRAINData is extracted from events received on this terminal (asspecified by EDFX's properties) and stamped into anotherlocation in the event before or after the event is forwarded tothe out terminal.outoutI_DRAINEvents received from the in terminal are passed through thisterminal either before or after the data has been extracted fromthe event.


[3068]

179











2.2 Properties









Property name
Type
Notes





stg.off
uint32
Specifies the location in the incoming event




into which the extracted value is to be stamped.




The size of the value stamped is 4 bytes (size




of DWORD). The data in the event may be




unaligned.




Default is 0 (first field in event).


val.offs
uint32
Specifies the location of the value in the




incoming event that EDFX should extract




(specified in bytes). This value specifies the




offset from beginning of event from which to




extract the field. If val.by_ref is TRUE, this




value determines the offset into the buffer at




which the field is to be extracted. The data in




the event may be unaligned.




Default is 4.


val.sz
uint32
Specifies the size of the value field in the




incoming event identified by val.offs (specified




in bytes). The size can be one of the following:




1, 2, 3, or 4.




Default is 4 (size of DWORD).


val.order
sint32
Specifies the byte order of the field (identified




by val.offs) in the incoming event. Can be one




of the following values:










0
Native machine format



1
MSB—Most-significant byte first




(Motorola)



−1
LSB—Least-significant byte first (Intel)











Default is 0 (Native machine format).


val.sgnext
bool32
Boolean.




If TRUE, values smaller than 4 bytes are sign




extended before the value is operated on using




val.mask and val.shift properties.




The default is FALSE.


val.mask
uint32
Mask that is bit-wise ANDed with the field




value before being stored.




Default is 0xFFFFFFFF (no change).


val.shift
sint32
Number of bits to shift the field value before




being stored. If the value is >0, the value is




shifted to the right. If the value is <0, the value




is shifted to the left.




Default is 0 (no change)


val.by_ref
bool32
Boolean.




If TRUE, the extracted value is identified by a




reference pointer contained within the event.




The offset of the reference pointer is specified




by the val.ptr_offs property.




If FALSE, the value is contained within the




event. The offset to value is specified by




val.offs property. The default value is FALSE




(the value is contained within the event).


val.ptr_offs
uint32
When the val.by_ref property is TRUE,




val.ptr_offs specifies the location (in the




incoming event) of the pointer to the buffer




containing the value that EDFX extracts. The




extracted value is placed at val.offs offset from




the beginning of the specified buffer.




The default value is 4 (second field of the




event).


extract_first
bool32
Boolean.




If TRUE, the data value is extracted before




the event is passed to the out terminal;




otherwise the data value is extracted after the




event is passed to the out terminal.




Default is TRUE.


set_first
bool32
Boolean. If TRUE, the data value is stored




before the event is passed to the out terminal.




This property is valid only when extract_first




is TRUE; otherwise it is ignored.




Default is TRUE.










[3069] 3. Events and Notifications
180EventDirBusNotes3.1 Terminal: inanyinanyData event.Values are extracted from events receivedthrough this terminal and stamped into theevent body. The event is then forwardedthrough the out terminal.3.2 Terminal: outanyoutanyData event.Values are extracted from events receivedthrough in and stamped into the eventbody. The event is then forwarded throughthis terminal.


[3070] 4. Environmental Dependencies


[3071] 4.1 Encapsulated Interactions


[3072] None.


[3073] 4.2 Other Environmental Dependencies


[3074] None.


[3075] 5. Specification


[3076] 5.1 Responsibilities


[3077] Extract the parameterized data field from the incoming event using the calculated offset either before or after forwarding the event through out as specified by the extract_first property.


[3078] Stamp the parameterized data field into the outgoing event using the calculated offset either before or after forwarding the event through out as specified by the set_first property.


[3079] Sign extend data values with size less than 4 bytes when val.sgnext property is TRUE.


[3080] Modify the extracted value as specified by the val.mask and val.shift properties.


[3081] 5.2 External States


[3082] None.


[3083] 6. Use Cases


[3084] 6.1 Extracting a Value Contained in the Event Body


[3085] EDFX is parameterized to extract a value from the event body (val.by_ref is FALSE) starting at an offset specified by val.offs. EDFX receives an event on its in terminal and extracts the value from the event at offset val.offs. EDFX stamps this value into the event at the location specified by stg.offs and forwards the event through the out terminal.


[3086] 6.2 Extracting a Value by Reference


[3087] EDFX is parameterized to extract a value from a buffer referenced by a field in the event (val.by_ref is TRUE). EDFX receives an event on its in terminal and calculates the pointer to the buffer at offset val.ptr_offs. EDFX extracts the value from the buffer at offset val.offs. EDFX stamps this value into the event at the location specified by stg.offs and forwards the event through the out terminal.


[3088] 6.3 Modification of the Value to be Stamped


[3089] After the value is extracted like in one of the use cases above, the following operations can be performed on it before it is stamped into the event:


[3090] 1. The value's byte order is converted (val.order).


[3091] 2. If needed, the value is sign-extended (val.sngext).


[3092] 3. The value is masked (val.mask)


[3093] 4. The value is shifted (val.shift)


[3094] The value is then stamped into the event at offset val.offs.


[3095] 7. Typical Usage


[3096] 7.1 EDFX Extracting and Stamping an Unsigned Integer


[3097]
FIG. 94 illustrates an advantageous use of part, EDFX—Extended Data Field Extractor


[3098] In this example, part a generates an event intended for part b. Part a stamps a 16-bit unsigned integer into a particular location in the event. Part b needs this value but is designed to extract the value from a different location in the event. Additionally, part b only needs the least significant 8 bits of the value. Part a sends the event to edfx through its in terminal. edfx extracts the unsigned integer from the event in the original location, masks out the last 8 bits, and stamps it into the event at the location from which bis designed to extract the value. edfx then forwards the event to part b through the out terminal.


[3099] 8. Document References


[3100] None.


[3101] 9. Unresolved Issues


[3102] None.



EDFS—Extended Data Field Stamper

[3103]
FIG. 95 illustrates the boundary of part, EDFS—Extended Data Field Stamper


[3104] 1. Functional Overview


[3105] EDFS is a data manipulation part that extracts a value from the incoming event and stores it into another location in the same event. The location of the value to extract and the target storage are parameterized through properties.


[3106] EDFS modifies the data value before storing it in the event using a bit-wise AND mask and by performing a SHIFT operation on the data. The place from which the value is extracted must be contained in the body of the event, 4 bytes aligned and in native byte order.


[3107] The size of the source data may be 1, 2, 3 or 4 bytes long and can be in various byte orders (i.e., MSB first, LSB first or the processor native byte order).


[3108] The target storage is either in the event body or specified by a reference pointer placed in the event body. The target storage may be unaligned.


[3109] EDFS is typically used to extract values from event data and store it in a native processor format in the event body, so the value can be processed by another part.


[3110] EDFS is not guarded and may be used in interrupt contexts.


[3111] 2. Boundary
1812.1 TerminalsNameDirTypeNotesininI_DRAINData is extracted from events received on thisterminal (as specified by EDFS's properties) andstamped into another location in the event beforeor after the event is forwarded to the out terminal.outoutI_DRAINEvents received from the in terminal are passedthrough this terminal either before or after thedata has been extracted from the event.


[3112]

182











2.2 Properties









Property name
Type
Notes





stg.offs
uint32
Specifies the location of the value in the




incoming event that EDFS should extract




(specified in bytes). The size of this field must




be size of uint32. The storage location in the




event must be aligned. This property is




mandatory.


val.offs
uint32
Specifies the location in the incoming event




where the extracted value is stamped. The




location where to stamp the value may be




unaligned. This property is mandatory.


val.sz
uint32
Specifies the size of the value field in the




incoming event identified by val.offs (specified




in bytes). The size can be one of the following:




1, 2, 3, or 4.




The default value is 4 (size of DWORD)


val.order
sint32
Specifies the byte order of the field (identified




by val.offs) in the incoming event. Can be one




of the following values:










0
Native machine format



1
MSB—Most-significant byte first




(Motorola)



−1
LSB—Least-significant byte first (Intel)











The default value is 0 (Native machine format).


val.mask
uint32
Mask that defines which portions of the




destination value can be modified by EDFS.




Bits in the mask with a value of 1 define the




bits that can be modified by EDFS in the




destination value. All other bits remain the




same. The default value is 0xFFFFFFFF




(modify the entire value).


val.shift
sint32
Number of bits to shift the field value before




being stored. If the value is >0, the value is




shifted to the right. If the value is <0, the value




is shifted to the left. The default value is 0 (no




change)


val.by_ref
uint32
Boolean.




If TRUE, the location in the incoming event




where the extracted value is stamped is




identified by a reference pointer contained




within the event. The offset of the reference




pointer is specified by the val.ptr_offs




property. If FALSE, the location is contained




within the event. The offset to value is




specified by val.offs property. The default




value is FALSE (the location is contained




within the event).


val.ptroffs
uint32
When the val_by ref property is TRUE,




val.ptr_offs specifies the location (in the




incoming event) of the pointer to the buffer




where the extracted value is stamped. The




extracted value is placed at val.offs offset from




the beginning of the specified buffer.




The default value is 0 (first field of the event).


get_first
uint32
Boolean. If TRUE, the value is extracted before




the event is passed to the out terminal;




otherwise the value is extracted after the event




is passed to the out terminal.




The default value is TRUE.


stamp_pre
uint32
Boolean. If TRUE, the value is stamped in the




event before the event is passed to the out




terminal; otherwise the value is stamped after




the event is passed to the out terminal.




The default value is TRUE.










[3113] 3. Events and Notifications
183EventDirBusNotes3.1 Terminal: inanyinanyData event.Values are extracted from events receivedthrough this terminal and stamped into thesame event. The event is then forwardedthrough the out terminal.3.2 Terminal: outanyoutanyData event.Values are extracted from events receivedthrough in and stamped into the sameevent. The event is then forwardedthrough this terminal.


[3114] 4. Environmental Dependencies


[3115] 4.1 Encapsulated Interactions


[3116] None.


[3117] 4.2 Other Environmental Dependencies


[3118] None.


[3119] 5. Specification


[3120] 5.1 Responsibilities


[3121] Extract the parameterized data field from the incoming event using the specified offset either before or after forwarding the event through out as specified by the get_first property.


[3122] Stamp the parameterized data field into the outgoing event using the calculated offset either before or after forwarding the event through out as specified by the stamp_pre property.


[3123] Convert the value based on the parameterized byte order.


[3124] Modify the extracted value as specified by the val. mask and val.shift properties.


[3125] 5.2 External States


[3126] None.


[3127] 6. Use Cases


[3128] 6.1 Stamping a Value in the Event Body


[3129] EDFS is parameterized to extract a value from the event body starting at an offset specified by stg.offs. EDFS receives an event on its in terminal and extracts the value from the event at offset stg.offs. EDFS stamps this value into the event at the location specified by val.offs and forwards the event through the out terminal. This case simply moves one field in an event into a different field contained within the same event.


[3130] 6.2 Stamping a Value in a Reference Pointer


[3131] EDFS is parameterized to extract a value from the event body starting at an offset specified by stg.offs. EDFS receives an event on its in terminal and calculates the pointer to the value at offset stg.offs. EDFS extracts the value from the event and stamps this value into the reference pointer identified by the val.ptr_off s property (the val. offs property is also used to stamp the value into an offset into the reference pointer). EDFS then forwards the event through the out terminal.


[3132] 6.3 Modification of the Value to be Stamped


[3133] After the value is extracted like in one of the use cases above, the following operations can be performed on it before it is stamped into the event:


[3134] 1. The value is masked (val.mask)


[3135] 2. The value is shifted (val.shift)


[3136] 3. The value's byte order is converted (val.order).


[3137] The value is then stamped into the event at the specified offset.


[3138] 7. Typical Usage


[3139] 7.1 EDFS Extracting and Stamping an Unsigned Integer


[3140]
FIG. 96 illustrates an advantageous use of part, EDFS—Extended Data Field Stamper


[3141] In this example, part a generates an event intended for part b. Part a stamps a 16-bit unsigned integer into a particular location in the event. Part b needs this value but is designed to extract the value from a different location in the event. Additionally, part b only needs the least significant 8 bits of the value. Part a sends the event to EDFS through its i n terminal. EDFS extracts the unsigned integer from the event in the original location, masks out the last 8 bits, and stamps it into the event at the location from which bis designed to extract the value. EDFS then forwards the event to part b through the out terminal.


[3142] 8. Document References


[3143] None.


[3144] 9. Unresolved Issues


[3145] None.


[3146] Portions of the present invention may be conveniently implemented using a conventional general purpose or a specialized digital computer or microprocessor programmed according to the teachings of the present disclosure, as will be apparent to those skilled in the computer art.



Advantages of the Invention

[3147] As described herein, the present invention has many advantages over the previous prior art systems. The following list of advantages is provided for purposes of illustration, and is not meant to limit the scope of the present invention, or imply that each and every possible embodiment of the present invention (as claimed) necessarily contains each advantageous feature.


[3148] 1. The present invention provides a system of reusable and composable objects that manipulate individual aspects of event and data processing, so that components and systems performing complex processing can be assembled by interconnecting these objects.


[3149] 2. The present invention provides a reusable object that has arbitrary set of properties that can be modified after the object is instantiated. The object provides two independent but complementary mechanisms for accessing the properties, making it possible for designers to utilize the appropriate mechanism.


[3150] 3. The present invention provides a reusable object that when used as a subordinate object in an assembly, can hold a set of properties of the assembly that no other subordinate has, allowing that set to be arbitrarily defined by the assembly designer.


[3151] 4. The present invention provides reusable container objects for holding data items. The set of data items held can be defined either by a designer at design time or may be defined at runtime.


[3152] 5. The present invention provides a reusable object for transferring properties or data items from one object to another.


[3153] 6. The present invention provides a system of reusable objects that convert variously encoded data fields to and from the native machine format. These objects allow separation of the data encoding from the processing of data, allowing usage of the same data processing objects with variously encoded data, including data received or to be sent to network or other systems.


[3154] 7. The present invention provides a system of reusable objects that provide the capability of assemblies to keep assembly-specific instance data and store, retrieve and otherwise manipulate that instance data, based on data and events that pass through these parts.


[3155] 8. The present invention provides a system of reusable objects for copying fields from data passing through these objects to and from instance data kept by the objects.


[3156] 9. The present invention provides a system of reusable objects for manipulating data in events passing through these objects.


[3157] 10. The present invention provides a reusable object for distributing and generating events based on the count of events received by that object.


[3158] 11. The present invention provides reusable objects that facilitate the life cycle—creation, parameterization, serialization and destruction—of dynamically created components.


[3159] 12. The present invention provides a reusable object for generating a predetermined event upon receiving an event.



Limits of the Implementation

[3160] The following list outlines the limitations of an embodiment of the inventive objects, none of which is necessary for practicing the present invention as claimed herein and none of which is necessarily preferred for the best mode of practicing the invention. Moreover, none of the following should be viewed as a limitation on means envisioned in the claims for practicing the invention as outlined herein above and below:


[3161] 1. The parts are built for the Z-force object-composition engine used in the Dragon system, and thus can be used directly only with that system. As a result, the parts are Dragon component objects. The reason for choosing that system for the preferred embodiment is that, to inventors best knowledge, it is the best composition-based system applicable in a wide area of applications that does not sacrifice performance.


[3162] 2. The inventive parts identify object classes, terminals and properties by names (text strings). Other identification mechanisms include without limitation, Microsoft COM GUID, integer values, IEEE 802.3 Ethernet MAC addresses, etc. The reason for using names is that the Dragon system uses names to identify these entities, which makes it easy for practitioners to remember and use.


[3163] 3. The inventive parts interact with each other through terminals. The reason for choosing this mechanism is that this is the preferred mechanism for such interactions in the Dragon system. Other mechanisms for connecting parts (or objects) may be employed.


[3164] The following Appendix further describes preferred implementation of interfaces.



Appendix 1—Interfaces

[3165] This appendix describes preferred definition of interfaces used by parts described herein.



I_POLY—Universal Polymorphic Bus-based Interface


Overview

[3166] The universal polymorphic bus-based interface is a generic v-table interface that can be used in place of any specific interface (e.g., I_PROP) provided that there are 64 or less operations.


[3167] Parts whose functionality is completely independent of the operations being invoked typically expose this interface.
184List of OperationsNameDescriptionop1operation #1op2operation #2... op64 operation #64



I_DRAIN—Event Drain


Overview

[3168] The Event Drain interface is used for event transportation and channeling. The events are carried with event ID, size, attributes and any event-specific data. Implementers of this interface usually need to perform a dispatch on the event ID (if they care).


[3169] Events are the most flexible way of communication between parts; their usage is highly justified in many cases, especially in weak interactions. Examples of usage include notification distribution, remote execution of services, etc.


[3170] Events can be classified in three groups: requests, notifications and general-purpose events. The events sent through this interface can be distributed synchronously or asynchronously. This is indicated by two bits in the attr member of the bus.


Claims
  • 1. In a software system including a standard mechanism for accessing properties, the standard mechanism including: a first operation for obtaining a property identifier; a second operation for obtaining a property value; and a third operation for setting the property value, an object comprising: a property, the property comprising a property identifier and a property value; an implementation of the first operation; an implementation of the second operation; and an implementation of the third operation, the implementation of the third operation setting both the property identifier and the property value if the third operation is executed for a first time, and changing the property value to a specified new property value if the third operation was previously executed.
  • 2. The object according to claim 1 wherein the property further comprises a property type and wherein the implementation of the third operation sets the property type in the first entry if the value for the first property has been previously set, the implementation of the third operation sets the property type in the first entry in the table if the value for the first property has not been set.
  • 3. In a software system including a standard mechanism for accessing properties of objects, the standard mechanism including: a first operation for enumerating property identifiers; a second operation for obtaining a property value of a property identified by a property identifier; and a third operation for setting the property value of a property identified by a property identifier, an object comprising: a table containing a plurality of entries, each entry comprising a property identifier and a property value; an implementation of the first operation, the implementation of the first operation retrieving a first property identifier of a first property from one of the entries in the table; an implementation of the second operation, the implementation of the second operation obtaining the property value from the one entry; an implementation of the third operation, the implementation of the third operation setting a property value in the one entry if a value for the first property has been previously set, the implementation of the third operation setting a property identifier and a property value in the one entry in the table if a value for the first property has not been set.
  • 4. The object according to claim 3 wherein the each entry further comprises a property type and wherein the implementation of the third operation sets the property type in the first entry if the value for the first property has been previously set, the implementation of the third operation sets the property type in the first entry in the table if the value for the first property has not been set.
  • 5. The object in claim 3 further comprising a terminal through which properties are accessed and their values from the first table.
  • 6. A copier object in a software system, the copier object comprising: a first terminal through which the copier object requests enumeration of property identifiers; a second terminal through which the copier object requests obtaining property values; a third terminal through which the copier object requests setting property values; a fourth terminal through which the copier object request receipt of a trigger signal, and upon receipt of the trigger signal the copier object obtains a first property name identifier through the first terminal, through which the copier object requests obtaining a first property value using the first property identifier through the second terminal, and through which the copier object requests setting the first property value using the first property identifier through the third terminal.
  • 7. A system of objects in a software system having a data memory, the system comprising: an extractor object for extracting first encoded values from the data memory and storing them in the data memory in native machine format; a stamper object for storing second encoded values into the data memory, the second encoded values obtained from the data memory in native machine format.
  • 8. The system in claim 7 the system wherein the data memory is an event object.
  • 9. A system of objects in a software system, the system comprising: a container object for storing a plurality of data values; an extractor object for extracting encoded data from data memory and storing the encoded data in the container object; a stamper object for obtaining the plurality of data values from the container object and storing them as encoded data in the data memory.
  • 10. The system in claim 9 further comprising a comparator object for comparing a first data value of encoded data from the data memory to a second data value from the container object and sending a reference to the data memory to a first terminal if the first value is less than the second value, to a second terminal if the first value is equal to the second value, and to a third terminal if the first value is greater than the second value.
  • 11. The system in claim 9 wherein the data memory is an event object.
  • 12. The system in claim 10 wherein the data memory is an event object.
  • 13. The system in claim 9 further comprising an arithmetic-logic-unit object for performing arithmetic operations on data values in the container object.
  • 14. A method in a composition-based software system for transferring data values in event objects, the method comprising the steps of: extracting a first value from a first event object; storing the first value into a container object; loading the first value from the container object; storing the first value into a second event object.
  • 15. The method of claim 14 further comprising the step of modifying the first value in the container object.
  • 16. The method of claim 14 wherein the first event object and the second event object are the same event object.
  • 17. A method in a composition-based software system for manipulating encoded data values in event objects, the method comprising the steps of: extracting a first value from a first data field of a first event object; decoding the first value into a normalized form; storing the first value into a second data field of the first event object; performing an operation that modifies the first value in the second data field, resulting in a second value being stored in the second data field; loading the second value from the second data field; storing the second value into the first data field.
  • 18. A system of interconnected objects in a software system, the system comprising: an extractor object for extracting a first value from a first data field in a first event object and storing it into a second data field in the first event object; a modifier object for modifying the second data field; a stamper object for loading a second value from the second data field and storing it into a third data field in the first event object.
  • 19. An object in a software system, the object comprising: a first terminal through which the object receives a source event; a first offset property specifying starting offset in the source event; a size property specifying size in the source event; a second offset property specifying starting offset for merging; a reference to a data memory for storing a data portion from the source event, starting from offset specified by the offset property and of size specified by the size property; a second terminal through which the object receives a merge event; a third terminal through which the object sends the merge event, the merge event modified by storing the data portion into the merge event at offset specified by the second offset property.
  • 20. The object in claim 19 wherein the first terminal and the second terminal are the same terminal.
  • 21. An object in a software system, the object comprising: an input terminal through which the object receives an input event; a first output terminal through which the object sends an event containing a first portion of the input event; a second output terminal through which the object sends an event containing a second portion of the input event; a first property specifying the size of the first portion.
  • 22. An object in a software system, the object comprising: a first input terminal through which the object receives a latch event; a second input terminal through which the object receives a trigger event; a field for storing a reference to the latch event when received on the first input terminal; an output terminal through which the object sends the latch event when the trigger event is received through the second input terminal.
  • 23. An object in a software system, the object comprising: an input terminal through which the object receives a first input signal; an output terminal through which the object sends the first input signal; a factory terminal through which the object requests the creation a new object instance when the object receives the first input signal; a property terminal through which the object requests the setting of properties on the new object instance.
  • 24. The object in claim 23 further comprising a parameterization terminal through which the object sends a parameterization signal so that an external object can parameterize the new object instance.
  • 25. A system of interconnected objects in a software system, the system of interconnected objects comprising: a factory object for receiving creation and destruction events; a dynamic container object for containing objects created by the factory object.
  • 26. An object in a software system, the object comprising: an input terminal through which the object receives events; a property specifying a target number of events; a field for maintaining a count of events received through the input terminal; a first output terminal through which the object sends events received through the input terminal when the count of events reaches the target number.
  • 27. The object in claim 26 further comprising a reset terminal through which the object receives a request to reset the count to zero.
  • 28. The object in claim 26 further comprising a second output terminal through which the object sends events received through the input terminal when the count of events is under the target number.
Provisional Applications (1)
Number Date Country
60235463 Sep 2000 US