[Top] [Prev] [Next] [Bottom]

CHAPTER 3 IR_Kind Basic Structure and Data Types

This chapter will layout the basic file structure, basic datatypes, the FIR header, and FIR trailer structures.

A small set of basic data types, specified in this chapter, lend precision to constructing, getting and setting FIR values.

3.1 Basic File Structure

An FIR file logically consists of three sections: a header, a body, and a trailer. The header defines aspects of the represented design global to the entire file. The body consists of zero of more IR records; the records are generally inter-related by IR_Ref values. The trailer provides a completeness and integrity check. We will discuss in this section: the partitioning of a logical file into physical files, the basics of bit and byte ordering (endian), and the handling of variable length data.

The working assumption is that the FIR is a logical file that is a stream of bytes. Bytes are assumed to be able to assume 256 different states (i.e consist of eight bits). Ordering of bytes of larger data elements are architecture dependent and follow the writing architecures' convention. The reader must extract this ordering information from the header and transpose all data types to match the reading architecture.

3.1.1 Prototype Reader/Writer

This prototype reader/writer has been deleted from this version of the document, as it was too close to an improper presentation of an implementation. Helpful hints to implementation will be left in where appropriate.

3.1.2 Partitioning of Logical Files

Each FIR is a stream of bytes in one logical file. In order to accommodate limitations in the file length supported by specific operation systems, an FIR may be partitioned into multiple physical files.

A writer supporting partitioned FIR must know the maximum file length supported by the writer's environment. (This maximum size is the lesser of the operating system file length limit and the file transfer agent length limit, as appropriate.) The writer must not exceed the length limit when writing a record. (A record may not be split across different physical files.) Likewise, a reader must be capable of accepting a sequence of files, concatenating them as they are read.

The end of a physical file must be reached at or before alignment is satisfied for what would be the next record. (That is end-of-file will be encountered trying to read the IR_Kind of the next record.)

Since the FIR file header is not easily partitioned, as a minimum requirement the computing and transfer environment must be capable of handling the entire header in a single file. Since the smallest file quantum in common use today is a 1.44M diskette, this requirement should not be a limitation in practice.

3.1.3 Ordering of FIR Records

In order to permit single-pass reading and writing of an IR file, it is essential that FIR records be stored so as that each record of an FIR description is defined before it is referenced, thereby minimizing the reading and writing cost. (If the intermediate representation is a tree, then a single depth first traversal would be the natural method.)

There is only one constraint on the order of FIR records. If the source locator is used (exists) for any FIR record type in the FIR then a FIR_DesignFile record must be forward of its constituents, so the format of the source locator (FIR_Source) can be determined.

A single pass will often be impossible. Either because of cycles in the graph of the IIR, or difficulty in removing forward reference in writing an FIR. In order to accommodate these structures this FIR paradigm, one may take one of three approaches: a multi-pass paradigm, the maintenance of intermediate patch information held in memory, or the use of proxy records within the FIR.

Multi-pass approaches trade increased reading and writing time for decrease ancillary memory requirements. When reading an FIR description using a multi-pass approach, the reader ignores any records that have references to records not (yet) present in memory (self-referential records are assumed to already be "in memory"). The reader must iteratively read the file until all records can be read. If there are IR records not yet read into memory and the reader cycles through the entire file without adding at least one record to memory, the file contains an error or a cycle. {what about two records that refer to each other. i.e. two VHDL record types that have access types to each other. The access types refer to the base types, so they cannot be written until the bases, but the bases cannot be written until the bases? This would imply the necessity for patching or proxy records.-RNN}

Alternatively, using the patch approach, the reader may use memory to record unresolved references within records that have already been read. After the entire FIR has been read (or incrementally as new records are read), patches are resolved by updating the FIR structures. If, at the end of the FIR, a patch cannot be resolved the FIR contains an error.

A proxy record, sometimes know as a deferred record, is a partially formed record containing sufficient information to allocate storage for the record. It acts as a place-holder until the reader reaches the full record later in the FIR. Proxy records are not currently supported by the FIR specification.

3.1.4 Bit and Byte Ordering.

The files will be written using the architecture of the writing machine, and all parameters to extract all datatypes must be filled in the header.

Bit numbering is usually not important, as within a byte the high order bit is preserved in its position, whether the architecture specifies that bit number as 0 or not. Byte ordering is important as our atom for file transfer is assumed to be a byte. (Note, this byte is not a character. Characters may be multiple bytes as will be described in the datatypes section.)

Some records will be composite records. These records need to include the size of the contained records in their size. Also these contained records are not referable by other records, so the count of FIR_Ref is not incremented for them. These contained records are not of variable length.

3.1.5 Variable Length Records

Both the header and body are of variable length. The header has several fields that are arrays of varying length. The length of each is describe as integer values within fields of the header. These length fields occur prior to the arrays they describe. The body is variable length not just for the variable number of records, but some of the records are of variable size themselves.

Since the FIR is to be sequentially written and read, variable-length fields are not a problem as long as the length can be determined. Acceptable methods include an explicit description of the length or the use of a distinct terminator; such a terminator must be distinct from any legal field value. For performance and orthogonality, AIRE uses an explicit length of the variable field.

However, variation in header and record sizes complicates the representation of headers and records as C structures or C++ classes. Neither ANSI.ISO C nor draft ANSI/ISO C++ allow sizing of on structure element, such as an array, based on the value of another element. Thus, pseudo-C struct representation of FIR record structures is only documentation.

3.2 Basic Data Types

We will define all FIR records out of a few basic data types. All structures will be decomposed into these basic types. Enumerations not of IR_Kind will be mapped to an appropriate integer.

FIR readers will be responsible for identifying any byte switching that is necessary to handle endian conversion on these basic types. The endian information for the writing architecture is in the header. {Endian discussion continues -RNN}

The basic data types that are used to read and write an FIR are:

boolean,

character,

32-bit integers,

64-bit integers,

single precision floating point,

double precision floating point,

IR_Kind,

FIR_Ref.

3.2.1 IR_Boolean

The boolean type must use the identifier `IR_Boolean' with two enumerated values: `FALSE' and `TRUE'. The type is either an enumerated type (preferred) or an integer with range including 0 and 1. Values may either come from an enumerated type (preferred) or the constants 0 (FALSE) and 1 (TRUE). Its size must be 1,2, or 4 bytes.

3.2.2 IR_Character

A character type must be provided called `IR_Character' with a domain of values which at least includes those defined by ISO 8859-1:1987. Informally, ISO 8859-1:1987 defines a character set with 256 distinct encodings within 8 bits. C/C++ users should pay careful attention that ISO 8859-1 defines a significant character with the value 0; 0 is not available to uniquely denote the end of a string. Its size must be 1,2, or 4 bytes. Variable string lengths are denoted in bytes.

3.2.3 32-bit Integer

A 32 bit integer type must be provided called `IR_Int32' with a domain of discrete values including the range -2,147,483, 647 to +2,147,483,647. The C++ definition of `int' generally complies with this definition. Its length is 4 bytes and alignment at least 4 bytes.

3.2.4 64-bit Integer

A 64 bit integer type must be provided called `IR_Int64' with a domain of discrete values including the range -2,147,483, 647 to +2,147,483,647. The C++ definition of `long long' generally complies with this definition if one is provided by a C++ environment (in hardware or software). If such a representation is not provided by the C++ environment, a suitable data type may be implemented as a C++ class defined in terms of two 32 bit integers. Its length and alignment must be 8 bytes.

3.2.5 Single Precision Floating Point

A 32 bit floating point type must be provided called `IR_FP32' as defined by single precision representations in IEEE Std. 754. The C++ definition of `float' generally complies with this definition. Its length must be 4 bytes and and alignment must be at least 4 bytes.

3.2.6 Double Precision Floating Point

A 64 bit floating point type must be provided called `IIR_FP64' as defined by double precision representations in IEEE Std. 754. The C++ definition of `double' generally complies with this definition. Its length and alignment must be 8 bytes.

3.2.7 IR_Kind

An enumerated type must be provided, called `IR_Kind', which uniquely identifies the FIR class associated with a particular record created from an AIRE object. Its length must be 1,2,or 4 bytes. The enumeration may be implemented as a true enumerated type or (preferred) as an integer and constant set. In either case, the type must include the following labels prior to any labels associated with completely new, instantiable AIRE extension classes:

IR_DESIGN_FILE,

IR_COMMENT,

IR_IDENTIFIER,

IR_INTEGER_LITERAL,

IR_INTEGER_LITERAL32,

IR_INTEGER_LITERAL64,

IR_FLOATING_POINT_LITERAL

IR_FLOATING_POINT_LITERAL32,

IR_FLOATING_POINT_LITERAL64,

IR_CHARACTER_LITERAL,

IR_BIT_STRING_LITERAL,

IR_STRING_LITERAL,

IR_ASSOCIATION_ELEMENT,

IR_ASSOCIATION_ELEMENT_BY_EXPRESSION,

IR_ASSOCIATION_ELEMENT_OPEN,

IR_BREAK_ELEMENT,

IR_CASE_STATEMENT_ALTERNATIVE_BY_EXPRESSION,

IR_CASE_STATEMENT_ALTERNATIVE_BY_CHOICES,

IR_CASE_STATEMENT_ALTERNATIVE_BY_OTHERS,

IR_CHOICE,

IR_CONDITIONAL_WAVEFORM,

IR_BLOCK_CONFIGURATION,

IR_COMPONENT_CONFIGURATION,

IR_DESIGNATOR_EXPLICIT,

IR_DESIGNATOR_BY_OTHERS,

IR_DESIGNATOR_BY_ALL,

IR_ENTITY_CLASS_ENTRY,

IR_ELSIF,

IR_GROUP_CONSTITUENT,

IR_SELECTED_WAVEFORM,

IR_SIMULTANEOUS_ALTERNATIVE_BY_EXPRESSION,

IR_SIMULTANEOUS_ALTERNATIVE_BY_CHOICES,

IR_SIMULTANEOUS_ALTERNATIVE_BY_OTHERS,

IR_SIMULTANEOUS_ELSIF,

IR_WAVEFORM_ELEMENT,

IR_ASSOCIATION_LIST,

IR_ATTRIBUTE_SPECIFICATION_LIST,

IR_BREAK_LIST,

IR_CASE_ALTERNATIVE_LIST,

IR_CHOICE_LIST,

IR_COMMENT_LIST,

IR_CONCURRENT_STATEMENT_LIST,

IR_CONDITIONAL_WAVEFORM_LIST,

IR_CONFIGURATION_ITEM_LIST,

IR_DECLARATION_LIST,

IR_DESIGN_FILE_LIST,

IR_DESIGNATOR_LIST,

IR_ELEMENT_DECLARATION_LIST,

IR_ENTITY_CLASS_ENTRY_LIST,

IR_ENUMERATION_LITERAL_LIST,

IR_GENERIC_LIST,

IR_INTERFACE_LIST,

IR_LIBRARY_UNIT_LIST,

IR_PORT_LIST,

IR_SELECTED_WAVEFORM_LIST,

IR_SEQUENTIAL_STATEMENT_LIST,

IR_SIMULTANEOUS_ALTERNATIVE_LIST,

IR_SIMULTANEOUS_STATEMENT_LIST,

IR_UNIT_LIST,

IR_WAVEFORM_LIST,

IR_ENUMERATION_TYPE_DEFINITION,

IR_ENUMERATION_SUBTYPE_DEFINITION,

IR_INTEGER_TYPE_DEFINITION,

IR_INTEGER_SUBTYPE_DEFINITION,

IR_FLOATING_TYPE_DEFINITION,

IR_FLOATING_SUBTYPE_DEFINITION,

IR_PHYSICAL_TYPE_DEFINITION,

IR_PHYSICAL_SUBTYPE_DEFINITION,

IR_RANGE_TYPE_DEFINITION,

IR_ARRAY_TYPE_DEFINITION,

IR_ARRAY_SUBTYPE_DEFINITION,

IR_RECORD_TYPE_DEFINITION,

IR_ACCESS_TYPE_DEFINITION,

IR_ACCESS_SUBTYPE_DEFINTION,

IR_FILE_TYPE_DEFINITION,

IR_SIGNATURE,

IR_FUNCTION_DECLARATION,

IR_PROCEDURE_DECLARATION,

IR_ELEMENT_DECLARATION,

IR_TYPE_DECLARATION,

IR_SUBTYPE_DECLARATION,

IR_CONSTANT_DECLARATION,

IR_FILE_DECLARATION,

IR_SIGNAL_DECLARATION,

IR_SHARED_VARIABLE_DECLARATION,

IR_VARIABLE_DECLARATION,

IR_TERMINAL_DECLARATION,

IR_FREE_QUANTITY_DECLARATION

IR_BRANCH_QUANTITY_DECLARATION,

IR_CONSTANT_INTERFACE_DECLARATION,

IR_FILE_INTERFACE_DECLARATION,

IR_SIGNAL_INTERFACE_DECLARATION,

IR_VARIABLE_INTERFACE_DECLARATION,

IR_TERMINAL_INTERFACE_DECLARATION,

IR_QUANTITY_INTERFACE_DECLARATION,

IR_ALIAS_DECLARATION,

IR_ATTRIBUTE_DECLARATION,

IR_COMPONENT_DECLARATION,

IR_GROUP_DECLARATION,

IR_GROUP_TEMPLATE_DECLARATION,

IR_LIBRARY_DECLARATION,

IR_ENTITY_DECLARATION,

IR_ARCHITECTURE_DECLARATION,

IR_PACKAGE_DECLARATION,

IR_PACKAGE_BODY_DECLARATION,

IR_CONFIGURATION_DECLARATION,

IR_PHYSICAL_UNIT,

IR_ATTRIBUTE_SPECIFICATION,

IR_CONFIGURATION_SPECIFICATION,

IR_DISCONNECTION_SPECIFICATION,

IR_LABEL,

IR_LIBRARY_CLAUSE,

IR_USE_CLAUSE,

IR_SELECTED_NAME,

IR_SELECTED_NAME_BY_ALL,

IR_INDEXED_NAME,

IR_SLICE_NAME,

IR_USER_ATTRIBUTE,

IR_BASE_ATTRIBUTE,

IR_LEFT_ATTRIBUTE,

IR_RIGHT_ATTRIBUTE,

IR_LOW_ATTRIBUTE,

IR_HIGH_ATTRIBUTE,

IR_ASCENDING_ATTRIBUTE,

IR_IMAGE_ATTRIBUTE,

IR_VALUE_ATTRIBUTE,

IR_POS_ATTRIBUTE,

IR_VAL_ATTRIBUTE,

IR_SUCC_ATTRIBUTE,

IR_PRED_ATTRIBUTE,

IR_LEFT_OF_ATTRIBUTE,

IR_RIGHT_OF_ATTRIBUTE,

IR_RANGE_ATTRIBUTE,

IR_REVERSE_RANGE_ATTRIBUTE,

IR_LENGTH_ATTRIBUTE,

IR_DELAYED_ATTRIBUTE,

IR_STABLE_ATTRIBUTE,

IR_QUIET_ATTRIBUTE,

IR_TRANSACTION_ATTRIBUTE,

IR_ASCENDING_ATTRIBUTE,

IR_EVENT_ATTRIBUTE,

IR_ACTIVE_ATTRIBUTE,

IR_LAST_EVENT_ATTRIBUTE,

IR_LAST_ACTIVE_ATTRIBUTE,

IR_LAST_VALUE_ATTRIBUTE,

IR_DRIVING_ATTRIBUTE,

IR_DRIVING_VALUE_ATTRIBUTE,

IR_SIMPLE_NAME_ATTRIBUTE,

IR_INSTANCE_NAME_ATTRIBUTE,

IR_PATH_NAME_ATTRIBUTE,

IR_ACROSS_ATTRIBUTE,

IR_THROUGH_ATTRIBUTE,

IR_REFERENCE_ATTRIBUTE,

IR_CONTRIBUTION_ATTRIBUTE,

IR_DOT_ATTRIBUTE,

IR_INTEG_ATTRIBUTE,

IR_ABOVE_ATTRIBUTE,

IR_IDENTITY_OPERATOR,

IR_NEGATION_OPERATOR,

IR_ABSOLUTE_OPERATOR,

IR_NOT_OPERATOR,

IR_AND_OPERATOR,

IR_OR_OPERATOR,

IR_NAND_OPERATOR,

IR_NOR_OPERATOR,

IR_XOR_OPERATOR,

IR_XNOR_OPERATOR,

IR_EQUALITY_OPERATOR,

IR_INEQUALITY_OPERATOR,

IR_LESS_THAN_OPERATOR,

IR_LESS_THAN_OR_EQUAL_OPERATOR,

IR_GREATER_THAN_OPERATOR,

IR_GREATER_THAN_OR_EQUAL_OPERATOR,

IR_SLL_OPERATOR,

IR_SRL_OPERATOR,

IR_SLA_OPERATOR,

IR_SRA_OPERATOR,

IR_ROL_OPERATOR,

IR_ROR_OPERATOR,

IR_ADDITION_OPERATOR,

IR_SUBTRACTION_OPERATOR,

IR_CONCATENATION_OPERATOR,

IR_MULTIPLICATION_OPERATOR,

IR_DIVISION_OPERATOR,

IR_MODULUS_OPERATOR,

IR_REMAINDER_OPERATOR,

IR_EXPONENTIATION_OPERATOR,

IR_FUNCTION_CALL,

IR_PHYSICAL_LITERAL,

IR_AGGREGATE,

IR_OTHERS_INITIALIZATION,

IR_QUALIFIED_EXPRESSION,

IR_TYPE_CONVERSION,

IR_ALLOCATOR,

IR_WAIT_STATEMENT,

IR_ASSERTION_STATEMENT,

IR_REPORT_STATEMENT,

IR_SIGNAL_ASSIGNMENT_STATEMENT,

IR_VARIABLE_ASSIGNMENT_STATEMENT,

IR_PROCEDURE_CALL_STATEMENT,

IR_IF_STATEMENT,

IR_CASE_STATEMENT,

IR_FOR_LOOP_STATEMENT,

IR_WHILE_LOOP_STATEMENT,

IR_NEXT_STATEMENT,

IR_EXIT_STATEMENT,

IR_RETURN_STATEMENT,

IR_NULL_STATEMENT,

IR_BLOCK_STATEMENT,

IR_PROCESS_STATEMENT,

IR_SENSITIZED_PROCESS_STATEMENT,

IR_CONCURRENT_PROCEDURE_CALL_STATEMENT,

IR_CONCURRENT_ASSERTION_STATEMENT,

IR_CONCURRENT_CONDITIONAL_SIGNAL_STATEMENT,

IR_CONCURRENT_SELECTED_SIGNAL_STATEMENT,

IR_COMPONENT_INSTANTIATION_STATEMENT,

IR_CONCURRENT_GENERATE_FOR_STATEMENT,

IR_CONCURRENT_GENERATE_IF_STATEMENT,

IR_SIMPLE_SIMULTANEOUS_STATEMENT,

IR_SIMULTANEOUS_IF_STATEMENT,

IR_SIMULTANEOUS_CASE_STATEMENT,

IR_SIMULTANEOUS_PROCEDURAL_STATEMENT,

IR_SIMULTANEOUS_NULL_STATEMENT,

FIR_PROXY_REF,

FIR_PROXY_INDICATOR

where IR_DESIGN_FILE=1 and IR_SIMULTANEOUS_NULL_STATEMENT=????.

3.2.8 IR_SignalKind

enum IR_SignalKind {
	IR_NO_SIGNAL_KIND,
	IR_REGISTER_KIND,
	IR_BUS_KIND 
};

3.2.9 IR_Mode

enum IR_Mode {
	IR_UNKNOWN_MODE,
	IR_IN_MODE,
	IR_OUT_MODE,
	IR_INOUT_MODE,
	IR_BUFFER_MODE,
	IR_LINKAGE_MODE
};

3.2.10 IR_Pure

enum IR_Pure {
	IR_PURE_FUNCTION,
	IR_IMPURE_FUNCTION 
};

3.2.11 IR_DelayMechanism

enum IR_DelayMechanism {
	IR_INERTIAL_DELAY,
	IR_TRANSPORT_DELAY
};

3.2.12 FIR Reference

FIR_Ref provides a relation reference between two or more IR records withing a single FIR. Each record in the FIR has a unique FIR_Ref within the FIR. An FIR_Ref is represented as an integer, which is incremented each time it is assigned to an FIR record. The initial value is one greater than the number of predefined FIR nodes noted in the FIR header. A FIR_Ref of zero is used for a null value and does not refer to any record.

3.2.13 FIR_ProxyRef and FIR_ProxyIndicator

These structures are used to resolve cyclic reference and can be used to resolve forward reference. The FIR_ProxyReference is placed in the FIR instead of a actual data base record. It indicates the storage needed for the eventual record and each has a unique FIR_Ref to be used as if it refered to the actual. The target IR_Kind and the size will indicate how much storage should be allocated. The variable data sizes are dependent on the target class. There will be one size for each variable field, and the sizes will be in the order of the variable data in the target record class definition. There will be no size for classes with out variable data. This makes the size of the FIR_ProxyReference record variable and based on the target record class.

The FIR_ProxyIndicator is placed immediately before an actual record that has a proxy reference. It contains a reference to the original FIR_ProxyReference.

It is erroneous to have a proxy of a proxy.

struct FIR_ProxyReference {
	IR_Kind		kind; /* FIR_PROXY_REF */
	IR_Kind		targetkind;
	IR_Int32		size1; /* of first variable data */
	IR_Int32		size2; /* of second variable data */
		.
		.
		.
};
struct FIR_ProxyIndicator {
	IR_Kind		kind;  /* FIR_PROXY_INDICATOR */
	FIR_Ref		proxy; /* to FIR_ProxyRefeference/
};

3.2.14 FIR Source Locator

The source locator (FIR_Source) is an indicator of the start of the language element represented by a FIR record. FIR_Source is an optional element in each non list FIR record class. FIR_Source can take several forms and each application can implement zero or all of the predefined forms. All FIR_Source in a FIR must be the same size, so there can be no variable extensions. There is no expectation that the source locator will be portable between applications. It is hoped that the predefined sources can be widely used and allow portability of source information.

The FIR header contains a field that designates whether an FIR record class has a source locator. The forms of FIR_Source map to the enumeration FIR_SourceKind. Each form of FIR_Source starts with an FIR_Ref to a FIR_DesignFile. FIR_DesignFile will have a FIR_SourceType field to indicate the type of FIR_Source can take for records that have a source locator that references that file.

Even if a FIR_DesignFile has a FIR_SourceKind of FIR_NO_SOURCE, the records that correspond to that file still have a source locator if they are so marked in the FIR header. The data is undefined.

enum FIR_SourceKind {
	FIR_NO_SOURCE, 
	FIR_CHAR_SOURCE,
	FIR_LINE_CHAR_SOURCE,
	FIR_X_Y_SOURCE
};
struct FIR_CharSource  { 
	FIR_Ref			source_file; /* FIR_DesignFile */
	IR_Int32			character_offset;
};
struct FIR_LineCharSource {
	FIR_Ref			source_file; /* FIR_DesignFile */
	IR_Int32			line_number;
	IR_Int32			character_offset;
};
struct FIR_XYSource  {
	FIR_Ref			source_file; /* FIR_DesignFile */
	IR_Int32			x;
	IR_Int32			y;
};

3.3 File Header

An FIR begins with the header. It specifies a number of constants, type and record sizes, and record specific global information. This global information is essential to interpret the rest of the FIR. An implementation may extend this header and include extension information. All extension information must follow the predefined header data. An implementation may use whatever internal representation of this data it feels is prudent to write or read this header.

struct FIR_Header {
	IR_Int32    _magic_number;
	IR_Int32    _guard;
	IR_Int32    _version_number;
	IR_Int32    _number_of_bytes_in_header;
	IR_Int32    _number_of_basic_types;
	IR_Int32    _number_of_bytes_in_basic_types[];
	IR_Int32    _byte_alignment_of_basic_types[];
	IR_Int32    _number_of_ir_kinds;
	IR_Int32    _number_of_bytes_in_ir_kind[];
	IR_Int32    _ir_kind_has_source_locator[];
	IR_Int32    _lenth_of_extension_id;
	IR_Int32    _extension_id[];
	IR_Int32    _number_of_predefined_records;
};

3.3.1 Magic Number

The magic number serves to identify the IR file has been written on either a big-endian or a little-endian architecture. It also identifies the arrangement of bits in a byte and helps to reject files not compliant with the file format described in this document.

Currently defined magic numbers are:

· IEEE Std 1076-1987 (VHDL): 0xFFA43703,

· IEEE Std 1076-1993 (VHDL): 0xFFA43709,

· IEEE Std 1364-1995 (Verilog): 0xFFD0290B,

· ANSI>ISO Standard TBD (C++): 0xF53432B0.

3.3.2 Guard

The guard is an IR_Int32 with value 0xFFFFFFFF. IT is intended both to detect the case of an improperly transferred FIR (where all eight bits of any byte are not preserved) and also to increase the ability of a reader to reject non FIR.

3.3.3 FIR Version

The version number defines the FIR version used. From this version number, the header structure, defined basic types, and defined IR_Kinds can be deduced. These three elements are the "portable FIR subset." Any additional information added to the header, to the set of basic types and to the set of IRKinds is an extension. Readers compliant with the portable FIR subset need only read information associated with the subset defined by this document. All other bytes can be ignored. References to nodes defined within some extension should be translated as NIL_IR references.

The Version number corresponding to a particular revision of this document is given on the title page of the document and is 3.0 (0x03000000).

3.3.4 Header size

The _number_of_bytes_in_header specifies the total size of the Header in bytes. The size must be at least as large as theFIR_Header documented above, and the first part must correspond to the structure defined here.

Extensions are added at the end of the header. The presence of extensions can be detected by a larger than expected header size.

3.3.5 Basic types

The number of basic types is the size of the two following arrays. Currently there are nine basic types defined in section [].

The size of basic types is an array of the different number of bytes each type uses in the FIR.

The alignment of basic types describes the byte alignment in the FIR by each of the basic types. If a structure requires extra bytes between fields to match alignment, a reader may make no assumptions about the data in those extra bytes. These extra bytes may be used for extension data if desired by an application.

The basic type entries in these arrays follows the order of the enumeration: IR_boolean, IR_character, IR_Int32, IR_Int64, IR_FP32, IRFP64, IR_Kind, FIR_Ref.

3.3.6 IR Kinds

The number of IR_Kinds is the size of the enumeration of IR_Kind plus any extensions. The minimum is the size of the enumeration of IR_Kind in this document. The base size of each FIR record is recorded in the _number_ of_bytes_in_ir_ kind array. Any variable size data in a record is counted as the minimum. (often zero).

3.3.7 Extension Self Identification

The Extension Self Identification is a mechanism to identify the type of extensions used in the FIR. The length of the extension id indicates the number of IR_Int32 used by the extension to identify itself. If there are no extensions then the length is zero, and the array takes no space. It is up to the application to make what ever use of this field it feels is prudent.

3.3.8 Predefined FIR records

The number of predefined FIR records is listed here. These FIR records will immediately follow the header. The predefined records represent predefined packages and other constructs, all of which can be incorporated by reference. The first FIR_Ref of these is one and the last is the number of predefined records. The type of the predefined record is found by substituting FIR for PD from the following enumeration tags.

enum FIR_Predefined_Records { 
	PD_DesignFileList=1,
};

3.4 File Trailer

The logical FIR ends with a trailer that includes an IR_Int32 checksum. The checksum is computed by adding the value of all bytes in the FIR (excluding the checksum itself) modulo 2**32. The Trailer is identified while trying to read an IR_Kind for a record. The id is the largest positive integer representable as an unsigned integer of the same size as IR_Kind. For a two byte IR_Kind this would be 0xffff, 216-1, or 65,535.

struct FIR_Trailer {
	IR_Kind		id;
	IR_Int32		checksum;
};



[Top] [Prev] [Next] [Bottom]

aire@vhdl.org
Copyright © 1995, 1996 FTL Systems Inc. All rights reserved except as noted in the document copyright statement.