Stop Binary/Octal/Hex Read Procedures At Trailing UnderScore

Proposal Details

  • Who Updates: main.CliffordWalinsky
  • Date Proposed: 2014-1-23
  • Date Last Updated: 2014-1-23
  • Bugzilla Reference:276

Current Situation

In VHDL-2008 underlines are allowed in the data for several of the read procedures in package textio: procedures READ[line,bit_vector], OCTAL_READ and HEX_READ. With regard to underline characters there are two potentially conflicting stopping rules. For example in the description of OREAD it states:

"Each underline character is also removed from L, provided the underline character does not precede the sequence of octal digits and does not immediately follow another underline character." It also states: "Moreover, character removal and composition stops when the expected number of digits have been removed..."

It is unclear which rule takes precedence. For example, suppose line1 contains "7_abc" and a variable v1 is bit_vector(1 to 3). What is the effect when OCTAL_READ(line1,v1) is executed? Is the underline consumed or not?

A very literal reading of the LRM probably leads to the conclusion that the underline is read. However, this makes the READ procedure not backward compatible.


Trailing underlines should not be allowed (so that the underline in the example is not consumed). Why do we allow trailing underlines and not leading ones? In addition, trailing underlines are not allowed in based literals, basic identifiers or bit string literals. For consistency, they should not be allowed in the various read routines.

Arguments FOR

The Mentor Graphics simulator already conforms to this requirement.

Arguments AGAINST

This change in the standard could render existing designs with their datasets incompatible. That is, if an input file contains the string "7_abc", and the string is read with the procedure call OCTAL_READ(line1,v1), where v1 is defined with subtype bit_vector(1 to 3), a simulator conforming to the existing standard could terminate reading after consuming the underscore character. A subsequent read call will read beginning at the string "abc". With this revision, a simulator will necessarily terminate the OCTAL_READ call at the underscore character, and a subsequent read call will begin at the string "_abc". This change in behavior could potentially cause existing designs to behave differently.

General Comments


Add your signature here to indicate your support for the proposal

  • main.CliffordWalinsky

This topic: P1076 > WebHome > Vhdl2019CollectedRequirements > StopReadOnTrailingUnderscore
Topic revision: r2 - 2020-02-17 - 15:34:39 - JimLewis
Copyright © 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback