Information Technology Reference
In-Depth Information
VHDL = EntityDeclaration
> ArchitectureBody;
The Entity Declaration grammar could be written as:
EntityDeclaration = EntityKeyword > Identifier > IsKeyword
> ( GenericClause | *ascii::space )
> PortClause
> EndKeyword > Identifier > lit(';');
Such a grammar may match a Generic Clause, if it is defined in the VHDL
source file, otherwise zero or more white spaces, and a Port Clause every time
an Entity Declaration is found.
The grammar for an Architecture Body is divided into two blocks:
- Architecture Declarative Part Grammar
- Architecture Statement Part Grammar
The custom grammar for the Architecture body could be written as:
ArchitectureBody = ArchitectureKeyword > ArchitectureIdentifier > OfKeyword
> EntityIdentifier > IsKeyword
> ArchitectureDeclarativePart
> BeginKeyword
> ArchitectureStatementPart
> EndKeyword >
ArchitectureIdentifier > lit(";");
In an Architecture Declarative Part there are one or more Component inter-
faces and zero or more Signal Declarations:
ArchitectureDeclarativePart = (+ ComponentDeclaration)
> (* SignalDeclaration);
The Component Declaration Grammar is very similar to the Entity Decla-
ration, since the Component interface is the copy of the Entity interface. In an
Architecture Statement there may be instantiated components with Generic Map
and Port Map, assigned values to signals and generate well-patterned structures.
These three statements can be found in any order and in any number within the
Architecture Statement Part (here Generic Map and Port Map are joined for
the sake of simplicity):
ArchitectureStatementPart = + ( GenericMapPortMap
| SignalAssignment
| GenerateStatement
);
In Fig. 9 the parser components have been defined, the grammars and the
other parser components used are summarized.
Once the VHDL grammar has been defined, the need to store the information
parsed from the VHDL projects arises. This information must be stored at parse
time, and elaborated at a later time, possibly by other modules of the ToPoliNano
Search WWH ::




Custom Search