Repair Text on Context Clauses

Proposal Details

  • Who Updates: DanielKho, CliffordWalinsky
  • Date Proposed:2013-12-09
  • Date Last Updated:2013-12-09
  • Priority:
  • Complexity:
  • Focus:
  • Bugzilla Reference: 289

Current Situation

The LRM states that, at the point of a context declaration, the use and context clauses in the declaration are not evaluated until they are expanded at the point of its reference (Section 13.4 "Context clauses"):

"A given context clause is equivalent to an expanded context clause containing only library clauses and use clauses. The expanded context clause is formed from the given context clause by replacing each context reference with the expanded context clause of the context clause in the context declaration denoted by the selected name of the context reference."

Library clauses appearing in a context declaration are different, however:

"It is an error if, during analysis of a design unit, there is a library clause in the expanded context clause of the design unit that occurs as part of a replacement of a context reference, and a logical name in that library clause denotes a different design library from the design library denoted by the logical name during analysis of the context declaration from which the library clause was expanded."

Since other elements of a context declaration are not referenced until the declaration is expanded, the existence and immutability requirements for libraries described by library clauses of the context declaration are gratuitous. The requirement's satisfaction has no bearing on whether other elements of the declaration will be valid when the context is referenced.

Consider, as an example of the irrelevance of this requirement, the following context declaration.

context ctx is
    library lib1;
    library lib2;
    use lib2.pack.all;
end context ctx; 

If, at the time context ctx is referenced and expanded, logical library lib1 refers to a different library from the point of declaration, it's irrelevant to the determination of whether package pack resides within library lib2, or that logical library lib2 exists.

Furthermore, this requirement exists nowhere else in the language. It's the responsibility of the compiler/simulator tool to determine whether a design that uses a package containing library clause "library lib1" can compile successfully when logical library lib1 is mapped to a different physical library. Typically, tools will track dependency links to determine the parts of a design that need to be recompiled after remapping logical libraries.

Requirement

We propose to remove the statement of section 13.4 requiring a test that library clauses occurring within a context declaration refer to the identical libraries in existence at the time the context declaration is referenced. Library clauses will be treated identically to other context clauses and use clauses occurring within context declarations.

Removing the requirement will have no effect on current designs: those that compile without error will continue to do so after this requirement is removed.

Implementation details

Code Examples

Use Cases

Arguments FOR

Arguments AGAINST

General Comments

Supporters

-- DanielKho - 2013-11-14

-- CliffordWalinsky - 2013-12-9

Add your signature here to indicate your support for the proposal

Topic revision: r5 - 2020-02-17 - 15:34:31 - JimLewis
 
Copyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback