Fun with datatypes

From: Kathy McKinley (mckinley@cadence.com)
Date: Wed Apr 28 2004 - 15:29:51 PDT

  • Next message: Shalom.Bresticker@motorola.com: "Re: Fun with datatypes"

    As we agreed at our last meeting, I am posting a list of "what you can do"
    with new or enhanced datatypes from the Cadence donation. Many of the basic
    possibilities are common with analogous datatypes from SystemVerilog.
    Where possible, I tried to use concepts rather than names (e.g. 2-state
    and 4-state rather than "bool" and "logic"). This listing is not perfect,
    but I think that it captures the primary differences and commonality
    between datatypes.

    SCALAR LOGIC TYPES (2-state and 4-state)

        Things that apply to any scalar logic datatype/object:

           - All integral type operations as defined in table 4.1 of the IEEE LRM
           - Assignment (as permitted by object kind)
           - Implicit conversions between scalar logic types
           - Implicit conversions to/from vector types
           - Wait on it
           

    VECTOR TYPES (indexed vectors, tagged vectors, enumerations, unions)

        Things that apply to any vector datatype/object:

            - All integral type operations as defined in table 4.1 of the IEEE LRM
            - Implicit conversions (sign/zero extension, truncation)
            - Assignment (as permitted by object kind)
            - Selection of an element by index (e.g. bit select)
            - Selection of a set of elements by range (e.g. part select)
            - Wait on entire thing
            - Defer specification of underlying logic type to a higher-level
              context (e.g. an enclosing object or type declaration)
     
        INDEXED VECTORS:

            - Declare objects/types with one or more ranges (dimensions)
            - Declare objects/types with elements of any vector datatype or
              scalar logic datatype

        ENUMERATIONS:

            - Declare objects/types with or without explicit range
            - Declare objects/types with elements of any scalar logic type
            - Declare names for constants associated with datatype/object

        TAGGED VECTORS:

            - Declare objects/types with or without explicit range
            - Declare objects/types with named members of any vector or
              scalar logic datatype (as long as underlying logic type is same)
            - Selection of element(s) by member name

        UNION:

            - Declare objects/types with or without explicit range
            - Declare objects/types with named members of any vector or
              scalar logic datatype
            - Selection of element(s) by member name

    ARRAY TYPE

        - Declare objects/types with one or more ranges (dimensions)
        - Declare objects/types with elements of any datatype
        - Assignment (as permitted by object kind, must have same shape
          and element type)
        - Selection of an element by index
        - Selection of a set of elements by range (at end of expression only)
        - case equality (===)
        - case inequality (!==)

    STRUCT TYPE

        - Declare objects/types with named members of any datatype
        - Assignment (as permitted by object kind, strongly typed)
        - Selection of element(s) by member name
        - case equality (===)
        - case inequality (!==)
        - Possibly faster member access than tagged vectors
          (because an implementation is allowed to pad for alignment)

    POINTER TYPE

        - Declare objects/types that reference a dynamic object of any
          kind of datatype
        - Allocate a dynamic object (new)
        - Dereference pointer to dynamic object
        - Assignment (as permitted by object kind, strongly typed)
        - case equality (===)
        - case inequality (!==)



    This archive was generated by hypermail 2.1.4 : Wed Apr 28 2004 - 15:10:54 PDT and
    sponsored by Boyd Technology, Inc.