VHDL Issue Number: 0036 Classification: Language Definition Problem Language Version: VHDL-87 Summary: The format of TextIO files is undefined in various places. This makes TextIO unportable. Related Issues: 0032 Relevant LRM Sections: 14.3 Key Words and Phrases: TextiO, READ, WRITE, READLINE, WRITELINE, File format. Current Status: Accepted 1076-1993 Disposition: Closed (All Issues Completely Addressed) Disposition Rationale: TextIO is portable. Superseded By: N/A ------------------------ Date Submitted: 1989/05/?? Author of Submission: Dave Bernstein Author's Affiliation: Vantage Analysis Systems, Inc. Author's Post Address: 42840 Christy St., Suite 201 Fremont, CA 9453 Author's Phone Number: (415) 659-0901 Author's Fax Number: Author's Net Address: N/A ------------------------ Date Analyzed: 1989/06/14 Author of Analysis: Clive Charlwood (Zycad Corp.) Revision Number: $Revision: 1.9 $ Date Last Revised: $Date: 1995/05/13 21:53:48 $ Description of Problem ---------------------- TextIO is not well defined. Proposed Resolution ------ ------------ VASG-ISAC considers it important that different vendors be able to read and write the same TEXTIO files. The LRM is vague about the input and output format of the TEXTIO procedures READ and WRITE. Portability is unlikely without clarification. Criteria: 1) If VHDL-1076 is explicit then it must be used. 2) Only specify the format if it aids the portability of TEXTIO files. VASG-ISAC Analysis & Rationale ------------------------------ One solution to this and other TEXTIO issues is to redefine TEXTIO. This is considered too significant a diversion from the current standard. Hence the recommended approach to the issue of TEXTIO format is to: 1) Add a sentence to the paragraph "Procedures READLINE ... " on page 14-12. 2) Rework and expand the paragraph starting "Each READ ..." at the foot of page 14-12 into several new paragraphs. 3) Make two changes to the paragraph starting, "Parameter UNIT ..." on page 14-13. Reworked Paragraph "Procedures READLINE ...": Procedures READLINE and WRITELINE declared in package TEXTIO read and write entire lines of text from a file of type TEXT. Procedure READLINE causes the next line to be read from the file and returns as the value of parameter L an access value that designates an object representing that line. The representation of the line does not contain the character (or characters) that signify the end of line. If parameter L contains a non-null access value at the start of the call, the object designated by the value is deallocated before the new object is created. Procedure WRITELINE causes the current line designated by parameter L to be written to the file and returns with the value of parameter L designating a null string. If parameter L contains a null access value at the start of the call, then a null string is written to the file. Reworked Paragraph "Each READ ...": Each READ procedure declared in package TEXTIO extracts data from the beginning of the string value designated by parameter L and modifies the string value so that it designates the remaining portion of the line on exit. The READ procedures defined for types other than CHARACTER and STRING begin by skipping leading blanks, a "blank" is defined as a space or a horizontal tabulation character (SP or HT). Characters are then input so long as the sequence input can be interpreted as part of the string representation of a value of the specified type or, in the case of types STRING and BIT_VECTOR, until VALUE'length characters have been input. The READ will not succeed if this sequence of characters is not a valid string representation of a value of the specified type or, in the case of types STRING and BIT_VECTOR, if the sequence does not contain VALUE'length characters. The definitions of the string representation of the value for each data type are as follows. The representation of a BIT value is formed by a single character, either 1 or 0. The representation of a BIT_VECTOR value is formed by a sequence of characters, either 1 or 0. The representation of a BOOLEAN value is formed by an identifier, either TRUE or FALSE. The representation of a CHARACTER value is formed by a single character. The representation of both INTEGER and REAL values is that of a decimal literal (see section 13.4.1), with the addition of an optional leading sign (but no intervening characters). The representation of a STRING value is formed by a sequence of characters, one for each element of the string. The representation of a TIME value is formed by an optional numeric literal, one or more blanks, and a TIME unit name, as defined in package STANDARD. Each WRITE procedure appends data to the end of the string value designated by parameter L. L continues to designate the entire line after the value is appended. The format of the data is defined by the definition of string representations listed above. The READ and WRITE procedures for the types BIT_VECTOR and STRING read and write the array elements in left to right order. Clarification of paragraph "Parameter UNIT ..." : A space should be added to each string value in the paragraph starting "Parameter UNIT ...". The sentence should read " ... would result in the string value "0.005 us" ... would result in the string value "5 ns"... " VASG-ISAC Recommendation for IEEE Std 1076-1987 ----------------------------------------------- The above re-wording of LRM 14.3 should be assumed. VASG-ISAC Recommendation for Future Revisions --------------------------------------------- The above re-wording of LRM 14.3 should be included.