#|| VHDL Object Model 1.0 --------------------- Copyright (c) 1993 Ohio Board of Regents and the University of Cincinnati. All rights reserved. Authors: David Benz, Phillip Baraona E-Mail: dbenz@thor.ece.uc.edu, pbaraona@thor.ece.uc.edu ||# #|| File: class-defns.re Contains: Class definitions for VHDL object model. Organization: The object-class definitions are organized in a hierarchical manner from most general to most specific. The top-level objects are at the top of this file, such as VHDL-Design-File, Design-Unit, and the bottom-level objects are towards the bottom, such as Expressions, Literals, etc. Also, we tried not to break up chapters (of the VHDL LRM) except in the cases where it makes more sense to do so. The specification also includes relevant chapter / section pointers into the LRM. ||# !! in-package("VOM-1-0") !! in-grammar('user) %%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Object Hierarchy %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% var Vhdl-Object : object-class subtype-of user-object var Syntactic-Object : object-class subtype-of vhdl-object var Vhdl-Program : object-class subtype-of syntactic-object %% Design Files (Sec. 11.1) var VHDL-Design-File : object-class subtype-of syntactic-object %% Design Units (Sec. 11.1) var Design-Unit : object-class subtype-of syntactic-object %% Context Items (Sec. 11.3) var Context-Item : object-class subtype-of syntactic-object var Library-Clause : object-class subtype-of context-item %% Design Entities, Configurations and Packages (Chaps. 1 & 2) var Library-Unit : object-class subtype-of syntactic-object var Entity-Declaration : object-class subtype-of library-unit var Architecture-Body : object-class subtype-of library-unit var Configuration-Declaration : object-class subtype-of library-unit var Package-Declaration : object-class subtype-of library-unit var Package-Body : object-class subtype-of library-unit %% Block Configuration (Sec. 1.3.1) var Configuration-Item : object-class subtype-of syntactic-object var Block-Configuration : object-class subtype-of configuration-item var Component-Configuration : object-class subtype-of configuration-item %% Statements (Chaps. 8 & 9) var Statement : object-class subtype-of syntactic-object %% Concurrent Statements (Chap. 9) var Concurrent-Statement : object-class subtype-of statement var Labeled-Concurrent-Stmt : object-class subtype-of concurrent-statement var Unlabeled-Concurrent-Stmt : object-class subtype-of concurrent-statement var Block-Statement : object-class subtype-of unlabeled-concurrent-stmt var Process-Statement : object-class subtype-of unlabeled-concurrent-stmt var Postponed-Concurrent-Stmt : object-class subtype-of unlabeled-concurrent-stmt var Unpostponed-Concurrent-Stmt : object-class subtype-of unlabeled-concurrent-stmt var Concurrent-Procedure-Call : object-class subtype-of unpostponed-concurrent-stmt var Concurrent-Assertion-Stmt : object-class subtype-of unpostponed-concurrent-stmt var Concurrent-Signal-Assign : object-class subtype-of unpostponed-concurrent-stmt var Conditional-Signal-Assign : object-class subtype-of concurrent-signal-assign var Selected-Signal-Assign : object-class subtype-of concurrent-signal-assign var Component-Instantiation : object-class subtype-of concurrent-statement var Generate-Statement : object-class subtype-of concurrent-statement %% Conditional Waveform (Sec. 9.5.1) var Conditional-Waveform : object-class subtype-of statement %% Selected Waveform (Sec. 9.5.2) var Selected-Waveform : object-class subtype-of statement %% Instantiated Unit (Sec. 9.6) var Instantiated-Unit : object-class subtype-of statement var Component-Unit-Name : object-class subtype-of instantiated-unit var Entity-Unit-Name : object-class subtype-of instantiated-unit var Configuration-Unit-Name : object-class subtype-of instantiated-unit %% Generate Statement (Sec. 9.7) var Generation-Scheme : object-class subtype-of statement var If-Generation-Scheme : object-class subtype-of generation-scheme var For-Generation-Scheme : object-class subtype-of generation-scheme %% Sequential Statements (Chap. 8) var Sequential-Statement : object-class subtype-of statement var Labeled-Sequential-Stmt : object-class subtype-of sequential-statement var Unlabeled-Sequential-Stmt : object-class subtype-of sequential-statement var Wait-Statement : object-class subtype-of unlabeled-sequential-stmt var Assertion-Statement : object-class subtype-of unlabeled-sequential-stmt var Report-Statement : object-class subtype-of unlabeled-sequential-stmt var Variable-Assignment : object-class subtype-of unlabeled-sequential-stmt var Signal-Assignment : object-class subtype-of unlabeled-sequential-stmt var Waveform-Element : object-class subtype-of statement var Procedure-Call : object-class subtype-of unlabeled-sequential-stmt var If-Statement : object-class subtype-of unlabeled-sequential-stmt var Elsif-Object : object-class subtype-of statement var Case-Statement : object-class subtype-of unlabeled-sequential-stmt var Case-Alternative : object-class subtype-of statement var Basic-Loop-Statement : object-class subtype-of unlabeled-sequential-stmt var While-Loop-Statement : object-class subtype-of unlabeled-sequential-stmt var For-Loop-Statement : object-class subtype-of unlabeled-sequential-stmt var Next-Statement : object-class subtype-of unlabeled-sequential-stmt var Exit-Statement : object-class subtype-of unlabeled-sequential-stmt var Return-Statement : object-class subtype-of unlabeled-sequential-stmt var Null-Statement : object-class subtype-of unlabeled-sequential-stmt %% Target (Sec. 8.4) var Target : object-class subtype-of statement %% Delay Mechanism (Sec. 8.4) var Delay-Mechanism : object-class subtype-of statement var Transport-Delay-Mechanism : object-class subtype-of delay-mechanism var Inertial-Delay-Mechanism : object-class subtype-of delay-mechanism %% Declarations and Specifications (Chaps. 4 & 5) var Declaration : object-class subtype-of syntactic-object var Type-Declaration : object-class subtype-of declaration var Full-Type-Declaration : object-class subtype-of type-declaration var Incomplete-Type-Declaration : object-class subtype-of type-declaration var Subtype-Declaration : object-class subtype-of declaration var Object-Declaration : object-class subtype-of declaration var Constant-Declaration : object-class subtype-of object-declaration var Signal-Declaration : object-class subtype-of object-declaration var Variable-Declaration : object-class subtype-of object-declaration var File-Declaration : object-class subtype-of object-declaration var Alias-Declaration : object-class subtype-of declaration var Attribute-Declaration : object-class subtype-of declaration var Component-Declaration : object-class subtype-of declaration var Group-Template-Declaration : object-class subtype-of declaration var Configuration-Declarative-Item : object-class subtype-of declaration var Group-Declaration : object-class subtype-of configuration-declarative-item var Use-Clause : object-class subtype-of configuration-declarative-item var Attribute-Specification : object-class subtype-of configuration-declarative-item var Configuration-Specification : object-class subtype-of declaration var Disconnection-Specification : object-class subtype-of declaration var Subprogram-Declaration : object-class subtype-of declaration var Subprogram-Specification : object-class subtype-of subprogram-declaration var Procedure-Declaration : object-class subtype-of subprogram-specification var Function-Declaration : object-class subtype-of subprogram-specification var Pure-Function-Decl : object-class subtype-of function-declaration var Impure-Function-Decl : object-class subtype-of function-declaration var Subprogram-Body : object-class subtype-of subprogram-declaration %% Subprogram Kind (Sec. 2.2) var Subprogram-Kind : object-class subtype-of syntactic-object var Procedure-Kind : object-class subtype-of subprogram-kind var Function-Kind : object-class subtype-of subprogram-kind %% Various objects used in Declarations var Entity-Class-Entry : object-class subtype-of syntactic-object var Component-Specification : object-class subtype-of syntactic-object var File-Open-Information : object-class subtype-of syntactic-object var Designator : object-class subtype-of syntactic-object var Entity-Designator : object-class subtype-of syntactic-object %% Interface Declarations (Sec. 4.3.2) var Interface-Declaration : object-class subtype-of syntactic-object var Interface-File-Decl : object-class subtype-of interface-declaration %% Binding Indication (Sec. 5.2.1) (Entity, Generic-Map and Port Map Aspects) var Entity-Aspect : object-class subtype-of syntactic-object var Generic-Map-Aspect : object-class subtype-of syntactic-object var Port-Map-Aspect : object-class subtype-of syntactic-object %% Entity Class (Sec. 5.1) var Entity-Class : object-class subtype-of syntactic-object var Entity-Keyword : object-class subtype-of entity-class var Procedure-Keyword : object-class subtype-of entity-class var Type-Keyword : object-class subtype-of entity-class var Signal-Keyword : object-class subtype-of entity-class var Label-Keyword : object-class subtype-of entity-class var Group-Keyword : object-class subtype-of entity-class var Architecture-Keyword : object-class subtype-of entity-class var Function-Keyword : object-class subtype-of entity-class var Subtype-Keyword : object-class subtype-of entity-class var Variable-Keyword : object-class subtype-of entity-class var Literal-Keyword : object-class subtype-of entity-class var File-Keyword : object-class subtype-of entity-class var Configuration-Keyword : object-class subtype-of entity-class var Package-Keyword : object-class subtype-of entity-class var Constant-Keyword : object-class subtype-of entity-class var Component-Keyword : object-class subtype-of entity-class var Units-Keyword : object-class subtype-of entity-class %% Entity Header Clauses (Sec. 1.1.1) var Generic-Clause : object-class subtype-of syntactic-object var Port-Clause : object-class subtype-of syntactic-object %% Signal Kind (Sec. 4.3.1.2) var Signal-Kind : object-class subtype-of syntactic-object var Register-Kind : object-class subtype-of signal-kind var Bus-Kind : object-class subtype-of signal-kind %% Mode (Sec. 4.3.2) var Mode : object-class subtype-of syntactic-object var In-Mode : object-class subtype-of mode var Out-Mode : object-class subtype-of mode var Inout-Mode : object-class subtype-of mode var Buffer-Mode : object-class subtype-of mode var Linkage-Mode : object-class subtype-of mode %% Types (Sec. 3) var Type-Definition : object-class subtype-of syntactic-object var Scalar-Type-Definition : object-class subtype-of type-definition var Enumeration-Type-Def : object-class subtype-of scalar-type-definition var Integer-Type-Def : object-class subtype-of scalar-type-definition var Floating-Type-Def : object-class subtype-of scalar-type-definition var Physical-Type-Def : object-class subtype-of scalar-type-definition var Composite-Type-Definition : object-class subtype-of type-definition var Array-Type-Def : object-class subtype-of composite-type-definition var Unconstrained-Array-Def : object-class subtype-of array-type-def var Constrained-Array-Def : object-class subtype-of array-type-def var Record-Type-Def : object-class subtype-of composite-type-definition var Access-Type-Definition : object-class subtype-of type-definition var File-Type-Definition : object-class subtype-of type-definition %% Physical types (Sec 3.1.3) var Secondary-Unit-Declaration : object-class subtype-of syntactic-object var Physical-Literal-Or-Name : object-class subtype-of syntactic-object %% Array types (Sec 3.2.1) var Index-Subtype-Definition : object-class subtype-of syntactic-object %% Record types (Sec 3.2.2) var Element-Declaration : object-class subtype-of syntactic-object %% Constraints (Sec. 4.2, 3.1, 3.2.1) var Range-Constraint : object-class subtype-of syntactic-object var Index-Constraint : object-class subtype-of syntactic-object %% NOTE: Any object class with the prefix "Simple-" means that it is the %% same as the object class of the same name except that anything which %% could parse as an Expression has been removed. %% Range (Sec. 3.1, 3.2.1) var VHDL-Range : object-class subtype-of syntactic-object var Simple-Range : object-class subtype-of vhdl-range var Direction : object-class subtype-of syntactic-object var To-Direction : object-class subtype-of direction var Downto-Direction : object-class subtype-of direction %% Discrete Range var Discrete-Range : object-class subtype-of syntactic-object var Simple-Discrete-Range : object-class subtype-of syntactic-object %% Subtype Indications (Sec. 4.2) var Subtype-Indication : object-class subtype-of syntactic-object var Simple-Subtype-Indication : object-class subtype-of subtype-indication %% Signatures (Sec. 2.3.2) var Signature : object-class subtype-of syntactic-object %% Expressions (Sec. 7) var Expression : object-class subtype-of syntactic-object var Logical-And : object-class subtype-of expression var Logical-Or : object-class subtype-of expression var Logical-Xor : object-class subtype-of expression var Logical-Nand : object-class subtype-of expression var Logical-Nor : object-class subtype-of expression var Logical-Xnor : object-class subtype-of expression var Compare-Equal : object-class subtype-of expression var Compare-Greater : object-class subtype-of expression var Compare-Less : object-class subtype-of expression var Compare-Greater-Equal : object-class subtype-of expression var Compare-Less-Equal : object-class subtype-of expression var Compare-Not-Equal : object-class subtype-of expression var Shift-Left-Logic : object-class subtype-of expression var Shift-Left-Arith : object-class subtype-of expression var Shift-Right-Logic : object-class subtype-of expression var Shift-Right-Arith : object-class subtype-of expression var Rotate-Left-Logic : object-class subtype-of expression var Rotate-Right-Logic : object-class subtype-of expression var Add-Operator-Plus : object-class subtype-of expression var Add-Operator-Minus : object-class subtype-of expression var Add-Operator-And : object-class subtype-of expression var Sign-Operator-Plus : object-class subtype-of expression var Sign-Operator-Minus : object-class subtype-of expression var Mult-Operator-Times : object-class subtype-of expression var Mult-Operator-Divide : object-class subtype-of expression var Mult-Operator-Mod : object-class subtype-of expression var Mult-Operator-Rem : object-class subtype-of expression var Misc-Operator-Square : object-class subtype-of expression var Misc-Operator-Abs : object-class subtype-of expression var Misc-Operator-Not : object-class subtype-of expression var Qualified-Expression : object-class subtype-of expression var Aggregate-Expression : object-class subtype-of expression var Allocator : object-class subtype-of expression %% Association Lists (Sec. 4.3.2.2) var Association-Element : object-class subtype-of syntactic-object var Formal-or-Actual-Part : object-class subtype-of syntactic-object %% Element Associations (Sec. 7.3.2) var Element-Association : object-class subtype-of syntactic-object %% Choices (Sec. 7.3.2) var Choice : object-class subtype-of syntactic-object %% Names (Sec. 6) var VHDL-Name : object-class subtype-of syntactic-object var Simple-Name : object-class subtype-of vhdl-name var Selected-Name : object-class subtype-of vhdl-name var Indexed-or-Slice-Name : object-class subtype-of vhdl-name var Attribute-Name : object-class subtype-of vhdl-name var Range-Attribute-Name : object-class subtype-of vhdl-name var String-Literal : object-class subtype-of vhdl-name %% Identifiers var Identifier : object-class subtype-of syntactic-object %% Literals (Sec. 13) var Literal : object-class subtype-of syntactic-object var Real-Literal : object-class subtype-of literal var Integer-Literal : object-class subtype-of literal var Character-Literal : object-class subtype-of literal var Bit-String-Literal : object-class subtype-of literal var Null-Literal : object-class subtype-of literal var Physical-Literal : object-class subtype-of literal var Enumeration-Literal : object-class subtype-of syntactic-object %%%%%%%%%%%%%%%%%%%%%%%%%%%% Design Decisions %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #|| Simply put, some constructs in VHDL fall easily into an object-oriented description while others just don't. Many choices were made to try and keep this specification as easy to understand as possible while still remaining true to the IEEE VHDL '93 Language Reference Manual. This section contains notes on design decisions which were made. Most of these design decisions relate to the fact that the VHDL description has many redundant productions. In other words the same syntax can parse in more than one way (according to the reference manual). In these cases, semantic information (such as symbol table info) is needed to determine how the object is to be used. The order in this section corrseponds to the order in which the VHDL language specification was written (chronological). Literals - In order to distinguish between an identifier and a physical literal a physical literal was redefined as: physical_literal ::= abstract_literal _name In the case where just a _name is present, this will be parsed as an identifier. This will work fine for now but may cause problems later. (db - 8/30) - Moved String-Literal so that it is descended from Name instead of String-Literal. This makes more sense in terms of how objects are actually used, but makes less sense in terms of how they are named. Without doing this, a special production would be needed so that an expression could parse as a String-Literal. (db - 10/3) Names - Got rid of Prefix object entirely. The way we are doing function calls makes a prefix object redundant. (db - 8/30) - Added object-class Range-Attribute-Name. This is needed because the reserved word "range" is also the name of a pre-defined attribute. See notes in Sec. 13.9. (db - 10/4) Expressions Function Calls - A function call and an indexed name are syntactically pretty much the same thing. The parser dialect generates would not be able to distinguish between them in most cases, so I have made them the same thing and defined them both in the object "Indexed-Name". Whether it is a function call or indexed name will have to be determined by context (see chap. 10.5). NOTE: also the same as a type conversion. (db - 9/1) Association Lists - Had to re-write association_element as: association-element ::= [ formal-part-map { [ "=>" actual-part-map ] } ] In the event that the actual part is not included, the formal part becomes the actual part (see section 4.3.2.2 LRM). (db - 9/4) Discrete Range - Turns out that slice name and indexed name are too similar to differentiate syntactically. These have been combined into one class Indexed-Or-Slice-Name. To accomplish this Formal-Or-Actual-Part now goes to a Discrete-Range instead of just an Expression. This makes things really interesting. (db - 9/9) - The other really interesting part is that Indexed-Constraint becomes redundant in a Subtype-Indication since this will be parsed as: vhdl-name indexed-or-slice-name (db - 9/9) - At this point in time I include a tree diagram for discrete-range since drawing this is about the only way it makes any sense: Discrete-Range: discrete-range ________________ / \ \ simple-subtype- simple-range expression indication | \ \______ / | | \ \ name name and/or expression direction expression constraint (db - 9/9) - A Simple-Discrete-Range is the same as Discrete-Range except that it can not be anything that falls under the class Expression. (db - 9/9) Realized we don't need Simple-Discrete-Range anymore with the new Indexed-or-Slice-Name class. Got rid of it, but left this comment for historical significance.. (db - 9/13) Range and Range-Constraint - In the production range ::= _attribute_name | expression direction expression _attribute_name was moved up into the object Range-Constraint. This enabled us to get around one-token lookahead and eliminate the conflicts caused between Expression and Attribute-Name. (db - 9/13) - Note also that Index-Constraint and Range-Constraint are completely separate objects. No relation! This is as it should be and not as the VHDL LRM would lead you to think. (db - 9/13) Declarations Group Declaration - A group declaration containing a group_constituent_list is the same as the _name being an indexed-or-slice-name. (db - 9/16) Entity Aspect - An entity aspect with an _identifier is the same as having the _name being an indexed-or-slice-name. (db - 9/16) Concurrent Statements Conditional Signal Assignment - Wrote this a little differently then the reference manual suggests. Either a semantic check to make sure that Conditional-Waveform contains a test-condition everywhere but in the last statement is needed or this needs to be re-written. (db - 9/25) Component Instantiation - Component instantiation is correct except for one special case. This special case occurs when an component instantiation is of the form: component_instantiation ::= [ _label ":" _name ] In this special case, our object model calls this a concurrent-procedure-call object and not a component instantiation. A semantic check will need to be performed on concurrent-procedure-call to make sure it is not a component-instantiation. (db - 9/29) Instantiated Unit - An instantiated unit of the form: instantiated_unit ::= "entity" _name [ "(" _identifier ")" ] is represented in our model as: entity-unit-name ::= [ "entity" instantiated-unit-name ] builds entity-unit-name The instantiation-unit-name will be an indexed-or-slice-name if there is an optional _identifier. (db - 10/7) Configuration Declaration - Configuration-Declaration has a declaration section. Unfortunately, due to the parser inability to distiguish between a Block-Configuration and a Configuration-Specification we could not use the attribute DECLARATION-LIST. So evolved the creation of the object Configuration-Declarative-Item. This object merely allows the parsing of: Use-Clause | Attribute-Specification | Group-Declaration ||# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Notes %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #|| This section contains a list of the things remaining to be fixed. As they are fixed please delete them from here. Expressions - Aggregate expression. Problem with the added production expression ::= "(" expression ")" Might want to solve this by forcing an aggregate to have more than one element-associations. Or maybe not. (db - 9/22) Seems like any fix I can see is worse than the problem. As things stand now the parser correctly chooses the shift so I'm leaving it alone. (db - 9/29) ||#