[Flavors] Flavors Technology Incorporated


PIM/Paracell Product Summary

  • Flavors Home
  • Flavors Product Information
  • PIM/Paracell Presentation
  • PIM Configurations
  • Product Documentation
  • PIM/Paracell Product Summary
  • Paracell User's Guide
  • Application Notes
  • Flavors Staff
  • Flavors Links
  • Flavors Download Page

  • 4. Variables

    The scope of a variable describes its accessibility. There are two scopes of Paracell variables: Global and Local. Global variables are stored in shared memory, are accessible by all tiles, and thus have global scope. Global variables are imported every frame, for their value may have been changed by another tile. Some global variables are I/O variables, which are mapped to a peripheral device (see IV.3 I/O Configuration). Local variables, stored in the local RAM resource of each cell, are accessible only by the owning tile, and thus have local scope.

    Figure 3-7.

    4.a Declaring Variables

    Variable declarations are optional, and when Paracell code is translated and compiled, the variables that have not been explicitly declared are typed according to context. If the Compiler is unable to define a variable from its context, the user is prompted to help (see III.8.a The Compiler).

    4.b Naming Variables

    Variable names may include alphas, digits, hyphens, underscores, and special characters (excepting punctuation marks) in any order.

    4.c Data Types

    Many of the data types used in Paracell will be familiar to programmers, however, some have been created or modified specifically for real-time applications where predictability and consistency are critical. The new data type, the Paracell Number, emulates a floating point digital meter, and is an alternative to floating point numbers. Paracell numbers maintain a constant resolution throughout their range (unlike floating point numbers which decrease in resolution as they increase in magnitude), and include three exceptional values; NAN (Not A Number), -RAIL, +RAIL, not included in traditional floating point numbers. Integers also use NAN, -RAIL, and +RAIL as exceptional values.

    [pnum]

    Figure 3-8. Exception value examples.

    The benefits of using exceptions are that even after overflow has occurred (and perhaps after some additional computation), useful comparisons can still be made (Figure 3-8).

    A listing of Paracell data types is shown below. The list has been broken down into two categories, individual data types and collections. These two categories have been broken down further indicating data types that have been implemented, and those that are specified but not yet implemented. The implementation of this second tier will be driven by customer requirements.

    1. Boolean - A boolean variable may have the value of true, false, or "no value". When referenced as an integer, true is 1, false is 0, and no value is NAN.
    2. Integer - An integer is a 32-bit signed number whose value may range from - 2,147,483,646 to 2,147,483,646 inclusive. Values for NAN, +RAIL ,and ­RAIL are also included (figure 3-8, above).
    3. Paracell Number - A Paracell number represents a rational number n/10,000 where n is an integer (see description of integer data type). The denominator is an implied constant such that Paracell numbers require only 32 bits of storage. Some arithmetic operations on Paracell numbers (e.g. +,-) are faster as they do not require floating point operations. Paracell numbers are displayed as fixed point numbers (similar to a multimeter display).

    SPECIFIED:

    1. Short Float - Short floats are standard IEEE 32-bit floating point numbers.
    2. Long Float - Long floats are standard IEEE 64-bit floating point numbers.
    3. Enumerated - In Paracell, you are free to make up new data types and name the elements as you like. Such data types are said to be enumerated, because the type is defined in terms of an (ordered) sequence of elements that are individually listed.
    4. Structure - A structure is a grouping of one or more types, as in a C structure or Pascal record, such that the structure can be treated as a unit. For example the structure coordinate could consist of the paracell numbers; longitude, and latitude.
    5. Random State - The Paracell random number generator requires a random state as its parameter in order to generate a random number. For example set x to random of RS1, where RS1 is a random state, assigns x a random value. Repeating the statement will assign a new random value to x. Random states may be copied, and two copies of the same random state will generate the same sequence of random numbers.

    The following data types are generically referred to as "collections". Collections are made up of items (or "objects") which may be of any type, but must be all of the same type.

    1. Array - An array is a contiguous collection of variables of any type that are referenced by index. Arrays must be of fixed size and all the elements of an array must be of the same type.

    SPECIFIED:

    1. Queue - An ordered collection (list) of objects whereby adding a new item places it at the bottom of the list and removing an item removes the item from the top of the list (like a theater ticket line). Also known as a FIFO (First In First Out) list. Queues are useful when a group of objects are created that need to be accessed again later in the same order in which they were created.
    2. Stack - An ordered collection (list) of items whereby adding a new item places it at the top of the list and removing an item removes the item from the top of the list (like a plate dispenser in a cafeteria). Also known as a LIFO (Last In First Out) list. Stacks are useful when a group of objects are created that need to be accessed again later in the reverse order in which they were created.
    3. Set - An unordered collection of objects, whereby no two objects have the same value. The primary function of a set is to collect objects and to then determine whether various items are in the set. This technique can simplify a number of tasks, for example, how you determine if the color requested is in the set of available colors.
    4. Priority Queue - A collection of items whereby each item has a priority associated with it. Removing an item from a priority queue will always return the item with the highest priority. Also known as a heap.
    5. Double-ended Queue - A collection of items whereby new items may be added at either end of the collection and items may be removed from either end of the collection. Also known as a DEQUE (Double Ended QUEue).


    5. Documentation of code

    Paracell is very rich in code documentation, a large portion of which is automatic.

    5.a Tile Documentation

    When a tile is created or modified, the revision history with author and time stamp is automatically created or updated.

    [simulationTile]

    Figure 3-9.

    Application developers can select from a wide range of patterns, colors and icons, controlling the appearance of nodes in the Navigator window. Whether an application is being developed by a single author, or by teams of developers, use of visual aids such as these can be powerful in segmenting projects, function, or specific application areas.

    5.b Paracell Documentation

    Documentation may be embedded in the Paracell code between the delimiters '/* and */'. Due to the English language style of Paracell, it is easy to determine what a section of code does. The embedded documentation in Paracell code is intended to explain why something is done.

    [tileDoc]

    Figure 3-10.

    5.c Variable Documentation

    When a tile is saved and compiled, any new variable created in the tile must be defined. The developer is presented with a dialog box for purposes of doing so. At this time, documentation for the variable is automatically created with type, author, and date/time stamp. Any new tiles that reference that variable are automatically added to the importer or exporter list for that variable.

    Within a Paracell Tile, the developer may choose to view the tile with variable tables showing. Clicking on a value in lists of either import or export variables will highlight the instances of the selected variables within a tile. Likewise, a user may elect to show the current values of those variables within the Paracell Code. The Navigator provides the tools for these different views.

    [simulationChrono]

    Figure 3-11.

    By double-clicking on the name of a variable in either of the lists, a variable tracking tool is presented for following the import and export paths of variables.

    The Paracell Tracker displays tiles that use a particular variable (Variable #1) and the variables within that tile that are effected by the value of that variable (Variable #2, as effected by Variable #1).

    [tracker]

    Figure 3-12.The Paracell Tracker

     


    Chapter II, Continued (More Paracell...)
    Chapter III: /O
    Back: Paracell, first section
    Table of Contents
    Return to Top of Page


    Flavors Technology, Inc.
    Sunrise Labs
    5 Dartmouth Drive
    Auburn, NH 03032 USA
    Internet: info@flavors.com
    Telephone: 603-644-4500 / Fax: 603-622-9797

    Copyright© 1993-6 by Flavors Technology, Inc. All rights Reserved.