This page provides a summary of the syntax for the VHDL subset of CV. Productions are ordered in order of appearance in the VHDL Language Reference Manual (LRM). The form of a production is described by means of a context-free grammar, using Backus-Naur notation (the following is lifted from the LRM):
formal_port_list,
entity
letter_or_digit::=letter | digit
choices ::= choice { | choice }
return_statement ::= return [ statement ]
term ::= factor { multiplying_operator factor }
entity_declaration ::= entity identifier is entity_header [ begin ] end [ entity ] [ entity_simple_name ] ;
entity_header ::= [ formal_port_clause ]
port_clause ::= port ( port_list ) ;
port_list ::= port_interface_list
architecture_body ::= architecture identifier of entity_name is architecture_declarative_part begin architecture_statement_part end [ architecture ] [ architecture_simple_name ] ;
architecture_declarative_part ::= { block_declarative_item }
architecture_statement_part ::= { concurrent_statement }
package_declaration ::= package identifier is package_declarative_part end [ package ] [ package_simple_name ] ;
package_declarative_part ::= { package_declarative_item }
package_declarative_item ::= type_declaration | subtype_declaration | constant_declaration | use_clause
package_body ::= package body package_simple_name is package_body_declarative_part end [ package body ] [ package_simple_name ] ;
package_body_declarative_part ::= { package_body_declarative_item }
package_body_declarative_item ::= type_declaration | subtype_declaration | constant_declaration | use_clause
scalar_type_definition ::= enumeration_type_definition | integer_type_definition
enumeration_type_definition ::= ( enumeration_literal { , enumeration_literal } )
enumeration_literal ::= identifier | character_literal
integer_type_definition ::= range_constraint
range_constraint ::= range range
range ::= simple_expression direction simple_expression
direction ::= to | downto
declaration ::= type_declaration | subtype_declaration | object_declaration | interface_declaration | entity_declaration | package_declaration
type_declaration ::= full_type_declaration
full_type_declaration ::= type identifier is type_definition ;
type_definition ::= scalar_type_definition
subtype_declaration ::= subtype identifier is subtype_indication ;
subtype_indication ::= type_mark [ constraint ]
type_mark ::= type_name | subtype_name
constraint ::= range_constraint
object_declaration ::= constant_declaration | signal_declaration | variable_declaration
constant_declaration ::= constant identifier_list : subtype_indication := expression ;
signal_declaration ::= signal identifier_list : subtype_indication [ := expression ] ;
variable_declaration ::= variable identifier_list : subtype_indication [ := expression ] ;
interface_declaration ::= interface_signal_declaration
interface_signal_declaration ::= [signal] identifier_list : [ mode ] subtype_indication [ := static_expression ]
mode ::= in | out
interface_list ::= interface_element { ; interface_element }
interface_element ::= interface_declaration
name ::= simple_name | operator_symbol | selected_name
simple_name ::= identifier
selected_name ::= prefix . suffix
prefix ::= name
suffix ::= simple_name | all
expression ::= relation { and relation } | relation { or relation } | relation { xor relation } | relation [ nand relation ] | relation [ nor relation ] | relation { xnor relation }
relation ::= shift_expression [ relational_operator shift_expression ]
shift_expression ::= simple_expression
simple_expression ::= term
term ::= factor
factor ::= primary | not primary
primary ::= name | literal | ( expression )
relational_operator ::= = | /= | < | <= | > | >=
literal ::= numeric_literal | enumeration_literal
numeric_literal ::= abstract_literal
sequence_of_statements ::= { sequential_statement }
sequential_statement ::= wait_statement | signal_assignment_statement | variable_assignment_statement | if_statement | case_statement | null_statement
wait_statement ::= [ label : ] wait [ sensitivity_clause ] [ condition_clause ] ;
label ::= identifier
sensitivity_clause ::= on sensitivity_list
sensitivity_list ::= signal_name { , signal_name }
condition_clause ::= until condition
signal_assignment_statement ::= [ label : ] target <= waveform ;
target ::= name
inertial waveform ::= waveform_element
waveform_element ::= value_expression
variable_assignment_statement ::= [ label : ] target := expression ;
if_statement ::= [ if_label : ] if condition then sequence_of_statements { elsif condition then sequence_of_statements } [ else sequence_of_statements ] end if [ if_label ] ;
condition ::= boolean_expression
case_statement ::= [ case_label : ] case expression is case_statement_alternative { case_statement_alternative } end case [ case_label ] ;
case_statement_alternative ::= when choices => sequence_of_statements
loop_statement ::= [ loop_label : ] while condition loop sequence_of_statements end loop [ loop_label ] ;
null_statement ::= [ label : ] null ;
concurrent_statement ::= block_statement | process_statement | concurrent_signal_assignment_statement
block_statement ::= block_label : block [ is ] block_header block_declarative_part begin block_statement_part end block [ block_label ] ;
block_declarative_part ::= { block_declarative_item }
block_declarative_item ::= type_declaration | subtype_declaration | constant_declaration | signal_declaration | use_clause
block_statement_part ::= { concurrent_statement }
process_statement ::= [ process_label : ] process [ ( sensitivity_list ) ] [ is ] process_declarative_part begin process_statement_part end process [ process_label ] ;
process_declarative_part ::= { process_declarative_item }
process_declarative_item ::= type_declaration | subtype_declaration | constant_declaration | variable_declaration | use_clause
process_statement_part ::= { sequential_statement }
concurrent_signal_assignment_statement ::= [ label : ] conditional_signal_assignment ; | [ label :] selected_signal_assignment ;
conditional_signal_assignment ::= target <= options conditional_waveforms ;
conditional_waveforms ::= { waveform when condition else } waveform [ when condition ]
selected_signal_assignment ::= with expression select target <= options selected_waveforms ;
selected_waveforms ::= { waveform when choices , } waveform when choices
use_clause ::= use selected_name { , selected_name } ;
design_file ::= design_unit { design_unit }
design_unit ::= context_clause library_unit
context_clause ::= { context_item }
context_item ::= library_clause | use_clause
library_clause ::= library logical_name_list ;
logical_name_list ::= logical_name { , logical_name }
logical_name ::= identifier
library_unit ::= primary_unit | secondary_unit
primary_unit ::= entity_declaration | package_declaration
secondary_unit ::= architecture_body | package_body
See also:
Documentation Sections: cva(1) VHDL Grammar cvc(1) Specification Language
Main Sections: Introduction Installation Documentation Examples