pyVHDLModel.Formatting.VHDL

This module contains a writer, which formats a VHDL language model as VHDL source text.

The writer is a Visitor: a model element walks itself and the writer appends the VHDL source text of each event to a buffer. A parser’s subclass of a model class (e.g. from pyGHDL.dom) is written like that model class. Writing is a re-format: comments, blank lines and the letter case of reserved words in a parsed source are not preserved.

Classes

  • KeywordCase: An enumeration of letter cases for VHDL reserved words in the written source text.

  • IndentStyle: An enumeration of indentation styles of the written source text, as vhdl-style-guide’s option indent_style.

  • VHDLStyle: Represents the formatting options of the VHDL writer.

  • VHDLWriter: A writer formatting VHDL language model elements as VHDL source text.


Classes

class pyVHDLModel.Formatting.VHDL.KeywordCase(*values)[source]

An enumeration of letter cases for VHDL reserved words in the written source text.

See also

Configuring Uppercase and Lowercase Rules

→ vhdl-style-guide’s option case.

Inheritance

Inheritance diagram of KeywordCase

Lower = 0

Lower case, e.g. downto.

Upper = 1

Upper case, e.g. DOWNTO.

classmethod __contains__(value)

Return True if value is in cls.

value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)

classmethod __getitem__(name)

Return the member matching name.

classmethod __iter__()

Return members in definition order.

classmethod __len__()

Return the number of members (no aliases)

class pyVHDLModel.Formatting.VHDL.IndentStyle(*values)[source]

An enumeration of indentation styles of the written source text, as vhdl-style-guide’s option indent_style.

See also

Configuring Indent Rules

→ vhdl-style-guide’s options indent_style and indent_size, with an example of smart tabs.

Inheritance

Inheritance diagram of IndentStyle

Spaces = 0

Spaces, indent_size per indentation level (VSG: spaces).

SmartTabs = 1

One tab per indentation level (VSG: smart_tabs - tabs indent, spaces align).

classmethod __contains__(value)

Return True if value is in cls.

value is in cls if: 1) value is a member of cls, or 2) value is the value of one of the cls’s members. 3) value is a pseudo-member (flags)

classmethod __getitem__(name)

Return the member matching name.

classmethod __iter__()

Return members in definition order.

classmethod __len__()

Return the number of members (no aliases)

class pyVHDLModel.Formatting.VHDL.VHDLStyle(keywordCase=KeywordCase.Lower, indentStyle=IndentStyle.Spaces, indentSize=2)[source]

Represents the formatting options of the VHDL writer.

The options follow vhdl-style-guide’s names and values.

See also

Configuring Uppercase and Lowercase Rules

→ vhdl-style-guide’s option case.

Configuring Indent Rules

→ vhdl-style-guide’s options indent_style and indent_size.

Inheritance

Inheritance diagram of VHDLStyle

Parameters:
__init__(keywordCase=KeywordCase.Lower, indentStyle=IndentStyle.Spaces, indentSize=2)[source]

Initializes the formatting options.

Parameters:
  • keywordCase (KeywordCase) – Optional, letter case of reserved words. Default: KeywordCase.Lower.

  • indentStyle (IndentStyle) – Optional, indentation style. Default: IndentStyle.Spaces.

  • indentSize (int) – Optional, number of spaces per indentation level. Default: 2.

Raises:
Return type:

None

_keywordCase: KeywordCase

Letter case of reserved words.

_indentStyle: IndentStyle

Indentation style.

_indentSize: int

Number of spaces per indentation level.

property KeywordCase: KeywordCase

Read-only property to access the letter case of reserved words (_keywordCase).

Returns:

The letter case of reserved words.

property IndentStyle: IndentStyle

Read-only property to access the indentation style (_indentStyle).

Returns:

The indentation style.

property IndentSize: int

Read-only property to access the number of spaces per indentation level (_indentSize).

Returns:

The number of spaces per indentation level.

classmethod GetMethodsWithAttributes(predicate=None)

Return the class’ methods that carry at least one matching attribute.

Parameters:

predicate (type[TAttr] | Iterable[type[TAttr]] | None) – Optional, an attribute class, an iterable of attribute classes, or None to accept every attribute.

Return type:

dict[Callable[..., Any], tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

Raises:
  • ValueError – If an element of parameter ‘predicate’ is not a sub-class of Attribute.

  • ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.

__getstate__()

Return the object’s state for pickling, collecting every slot of the class hierarchy.

Return type:

dict[str, Any]

Returns:

Dictionary of slot names and their values.

Raises:

ExtendedTypeError – If a slot was never assigned, so it has no value to serialize.

__setstate__(state)

Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.

Parameters:

state (dict[str, Any]) – Dictionary of slot names and their values.

Raises:

ExtendedTypeError – If the given state misses a slot or carries an unexpected one.

Return type:

None

class pyVHDLModel.Formatting.VHDL.VHDLWriter(style=None)[source]

A writer formatting VHDL language model elements as VHDL source text.

The writer handles the visitor events of each supported model class. An element of a class without a walk of its own raises NotImplementedError; nothing is skipped.

Expressions are written with the parentheses VHDL’s operator precedence requires (IEEE Std 1076-2008, clause 9.2). Parentheses from the source (SubExpression) are kept. Symbols are written from their Name, whether resolved or not.

Inheritance

Inheritance diagram of VHDLWriter

Parameters:

style (Nullable[VHDLStyle])

_BASE_SPECIFIERS: ClassVar[dict[BitStringBase, str]] = {<BitStringBase.Binary: 2>: 'b', <BitStringBase.Decimal: 10>: 'd', <BitStringBase.Hexadecimal: 16>: 'x', <BitStringBase.Octal: 8>: 'o'}

Dictionary of base specifiers, indexed by bit string base.

__init__(style=None)[source]

Initializes a VHDL writer.

Parameters:

style (VHDLStyle | None) – Optional, formatting options. Default: VHDLStyle().

Raises:

TypeError – If parameter ‘style’ is not of type VHDLStyle.

Return type:

None

_style: VHDLStyle

Formatting options.

_buffer: list[str]

Fragments of the VHDL source text written by Format().

_minimum: OperatorPrecedence

Loosest precedence of the next operand without parentheses.

_frames: list[tuple[OperatorPrecedence, bool]]

Stack of entered operands: precedence and if in parentheses.

_indentation: int

Indentation level of the next line.

property Style: VHDLStyle

Read-only property to access the formatting options (_style).

Returns:

The formatting options.

Format(element)[source]

Format a model element as VHDL source text.

Each call starts with an empty buffer at indentation level 0. A declaration, a statement or a design unit ends with a newline.

Parameters:

element (ModelEntity | Symbol) – The model element to format.

Return type:

str

Returns:

The VHDL source text.

Raises:
VisitLeftParenthesis(element)[source]

Write the left parenthesis opening a parenthesized list.

Parameters:

element (IndexedName | ParenthesisName | TypeConversion | EntityAspectEntity | EntityInstantiation) – The element enclosing the list.

Return type:

None

_Write(text)[source]

Append VHDL source text to the buffer.

Parameters:

text (str) – The VHDL source text.

Return type:

None

VisitComma(element)[source]

Write the comma between two items of a list.

In a map aspect, the next association starts on a new line.

Parameters:

element (IndexedName | ParenthesisName | Aggregate | ConstrainedArraySubtypeSymbol | ConstrainedRecordSubtypeSymbol | EnumeratedType | ArrayType | AttributeSpecification | GenericMapAspectMixin | PortMapAspectMixin | Reference | ComponentConfiguration | ProcessStatement | ProcedureCallMixin | WaveformMixin | SelectedWaveformsMixin | SelectedExpressionsMixin | WaitStatement) – The element containing the list.

Return type:

None

VisitArrow(element)[source]

Write the arrow (=>) between a choice or formal and its value.

After the choices of a case or case-generate alternative, the alternative’s body follows on new lines, indented.

Parameters:

element (AssociationItem | IndexedAggregateElement | RangedAggregateElement | NamedAggregateElement | ConcurrentCase | SequentialCase) – The element containing the arrow.

Return type:

None

VisitApostrophe(expression)[source]

Write the apostrophe of a qualified expression and, unless the operand brings its own, a left parenthesis.

An aggregate or a parenthesized sub-expression brings its own parentheses.

Parameters:

expression (QualifiedExpression) – The qualified expression.

Return type:

None

VisitWhen(element)[source]

Write the reserved word when of a conditional expression or waveform, or of a selected waveform or expression.

Parameters:

element (WhenElseExpression | ConditionalWaveform | SelectedWaveform | OthersSelectedWaveform | ConditionalExpression | SelectedExpression | OthersSelectedExpression | LoopControlStatement) – The conditional expression, the conditional waveform or the selected waveform or expression.

Return type:

None

_Keyword(keyword)[source]

Apply the keyword case of the formatting options to a reserved word.

Parameters:

keyword (ReservedWord) – The reserved word.

Return type:

str

Returns:

The reserved word in the configured letter case.

_Keywords(keywords)[source]

Apply the keyword case of the formatting options to reserved words and join them by spaces.

Format: shared variable, protected body

Parameters:

keywords (Iterable[ReservedWord]) – The reserved words.

Return type:

str

Returns:

The reserved words in the configured letter case, separated by spaces.

VisitElse(element)[source]

Write the reserved word else of a conditional expression or between the alternatives of an assignment.

Parameters:

element (WhenElseExpression | ConditionalWaveformsMixin | SequentialConditionalVariableAssignment) – The conditional expression or the conditional assignment.

Return type:

None

VisitOperator(expression)[source]

Write the operator of a binary expression.

The right operand binds tighter than the operator, unless it’s a primary.

Parameters:

expression (BinaryExpression) – The binary expression.

Return type:

None

VisitDirection(rng)[source]

Write the direction of a range.

Parameters:

rng (RangeExpression | SimpleRange) – The range.

Return type:

None

VisitNullLiteral(literal)[source]

Write a null literal.

Format: null

Parameters:

literal (NullLiteral) – The null literal.

Return type:

None

VisitEnumerationLiteral(literal)[source]

Write an enumeration literal.

Format: Idle

Parameters:

literal (EnumerationLiteral) – The enumeration literal.

Return type:

None

VisitIntegerLiteral(literal)[source]

Write an integer literal.

Format: 42

A negative value is written with a sign, so it binds like a sign.

Parameters:

literal (IntegerLiteral) – The integer literal.

Return type:

None

_Enter(precedence)[source]

Enter an operand and write a left parenthesis, if it binds looser than its position allows.

Parameters:

precedence (OperatorPrecedence) – The precedence level of the operand.

Return type:

None

DepartIntegerLiteral(literal)[source]

Leave an integer literal.

Parameters:

literal (IntegerLiteral) – The integer literal.

Return type:

None

_Leave()[source]

Leave an operand and write a right parenthesis, if it was entered with a left parenthesis.

Return type:

None

VisitFloatingPointLiteral(literal)[source]

Write a floating-point literal.

Format: 3.5

A negative value is written with a sign, so it binds like a sign.

Parameters:

literal (FloatingPointLiteral) – The floating-point literal.

Return type:

None

DepartFloatingPointLiteral(literal)[source]

Leave a floating-point literal.

Parameters:

literal (FloatingPointLiteral) – The floating-point literal.

Return type:

None

static _PrecedenceOfReal(value)[source]

Determine how tight a floating-point value binds as an operand.

A negative value, -0.0 included, is written with a sign, so it binds like a sign.

Parameters:

value (float) – The floating-point value.

Return type:

OperatorPrecedence

Returns:

The precedence level.

_FormatReal(element, value)[source]

Format a floating-point value as VHDL abstract literal with a decimal point.

Format: 1.0e-09

Parameters:
  • element (ModelEntity) – The model element carrying the value.

  • value (float) – The floating-point value.

Return type:

str

Returns:

The VHDL source text.

Raises:

VHDLWriterError – If the value is infinite or not a number.

VisitPhysicalIntegerLiteral(literal)[source]

Write a physical literal with an integer value.

Format: 10 ns

Parameters:

literal (PhysicalIntegerLiteral) – The physical literal.

Return type:

None

DepartPhysicalIntegerLiteral(literal)[source]

Leave a physical literal with an integer value.

Parameters:

literal (PhysicalIntegerLiteral) – The physical literal.

Return type:

None

VisitPhysicalFloatingLiteral(literal)[source]

Write a physical literal with a floating-point value.

Format: 1.5 ns

Parameters:

literal (PhysicalFloatingLiteral) – The physical literal.

Return type:

None

DepartPhysicalFloatingLiteral(literal)[source]

Leave a physical literal with a floating-point value.

Parameters:

literal (PhysicalFloatingLiteral) – The physical literal.

Return type:

None

VisitCharacterLiteral(literal)[source]

Write a character literal.

Format: 'a'

Parameters:

literal (CharacterLiteral) – The character literal.

Raises:

VHDLWriterError – If the value is not a single graphic character.

Return type:

None

static _IsGraphic(text)[source]

Check if all characters are VHDL graphic characters (ISO/IEC 8859-1 without control characters).

Parameters:

text (str) – The text to check.

Return type:

bool

Returns:

True, if all characters are graphic characters.

VisitStringLiteral(literal)[source]

Write a string literal and double each enclosed quotation mark.

Format: "say ""hi"" twice"

Parameters:

literal (StringLiteral) – The string literal.

Raises:

VHDLWriterError – If the value contains a non-graphic character.

Return type:

None

VisitBitStringLiteral(literal)[source]

Write a bit string literal.

Format: 8ux"A0"

Parameters:

literal (BitStringLiteral) – The bit string literal.

Raises:
  • VHDLWriterError – If the literal’s class has no base specifier.

  • VHDLWriterError – If a decimal bit string literal is signed or unsigned.

  • VHDLWriterError – If the value contains a quotation mark or a non-graphic character.

Return type:

None

VisitUnaryExpression(expression)[source]

Write the operator of a unary expression with a reserved word as operator; its operand is a primary.

Format: not (a and b)

Parameters:

expression (UnaryExpression) – The unary expression.

Return type:

None

DepartUnaryExpression(expression)[source]

Leave a unary expression with a reserved word as operator.

Parameters:

expression (UnaryExpression) – The unary expression.

Return type:

None

VisitNegationExpression(expression)[source]

Write the sign of a negation; its operand is a term.

Format: -a

Parameters:

expression (NegationExpression) – The negation.

Return type:

None

DepartNegationExpression(expression)[source]

Leave a negation.

Parameters:

expression (NegationExpression) – The negation.

Return type:

None

VisitIdentityExpression(expression)[source]

Write the sign of an identity; its operand is a term.

Format: +a

Parameters:

expression (IdentityExpression) – The identity.

Return type:

None

DepartIdentityExpression(expression)[source]

Leave an identity.

Parameters:

expression (IdentityExpression) – The identity.

Return type:

None

DepartTypeConversion(conversion)[source]

Write the right parenthesis closing the operand of a type conversion.

Format: integer(r)

Parameters:

conversion (TypeConversion) – The type conversion.

Return type:

None

VisitSubExpression(expression)[source]

Write the left parenthesis of a parenthesized sub-expression from the source.

Format: (a + b)

Parameters:

expression (SubExpression) – The sub-expression.

Return type:

None

DepartSubExpression(expression)[source]

Write the right parenthesis of a parenthesized sub-expression from the source.

Parameters:

expression (SubExpression) – The sub-expression.

Return type:

None

VisitLogicalExpression(expression)[source]

Enter a binary logical expression; its left operand is a relation or a chain of the same associative operator.

The associative operators are and, or, xor and xnor.

Format: a and b and c or (a and b) or c

Parameters:

expression (LogicalExpression) – The logical expression.

Return type:

None

DepartLogicalExpression(expression)[source]

Leave a binary logical expression.

Parameters:

expression (LogicalExpression) – The logical expression.

Return type:

None

VisitRelationalExpression(expression)[source]

Enter a relational expression; its left operand is a shift expression.

Format: a = b

Parameters:

expression (RelationalExpression) – The relational expression.

Return type:

None

DepartRelationalExpression(expression)[source]

Leave a relational expression.

Parameters:

expression (RelationalExpression) – The relational expression.

Return type:

None

VisitShiftExpression(expression)[source]

Enter a shift or rotate expression; its left operand is a simple expression.

Format: a sll 2

Parameters:

expression (ShiftExpression) – The shift or rotate expression.

Return type:

None

DepartShiftExpression(expression)[source]

Leave a shift or rotate expression.

Parameters:

expression (ShiftExpression) – The shift or rotate expression.

Return type:

None

VisitAddingExpression(expression)[source]

Enter an adding expression; it associates to the left.

Format: a - b - c or a - (b - c)

Parameters:

expression (AddingExpression) – The adding expression.

Return type:

None

DepartAddingExpression(expression)[source]

Leave an adding expression.

Parameters:

expression (AddingExpression) – The adding expression.

Return type:

None

VisitMultiplyingExpression(expression)[source]

Enter a multiplying expression; it associates to the left.

Format: (a + b) * c

Parameters:

expression (MultiplyingExpression) – The multiplying expression.

Return type:

None

DepartMultiplyingExpression(expression)[source]

Leave a multiplying expression.

Parameters:

expression (MultiplyingExpression) – The multiplying expression.

Return type:

None

VisitExponentiationExpression(expression)[source]

Enter an exponentiation; both operands are primaries.

Format: a ** (b ** c)

Parameters:

expression (ExponentiationExpression) – The exponentiation.

Return type:

None

DepartExponentiationExpression(expression)[source]

Leave an exponentiation.

Parameters:

expression (ExponentiationExpression) – The exponentiation.

Return type:

None

VisitRangeExpression(expression)[source]

Enter a range expression; its bounds are simple expressions.

Format: 7 downto 0

Parameters:

expression (RangeExpression) – The range expression.

Return type:

None

DepartRangeExpression(expression)[source]

Leave a range expression.

Parameters:

expression (RangeExpression) – The range expression.

Return type:

None

VisitWhenElseExpression(expression)[source]

Enter a conditional expression; its value and condition are logical expressions.

Format: a when c else b

Parameters:

expression (WhenElseExpression) – The conditional expression.

Return type:

None

DepartWhenElseExpression(expression)[source]

Leave a conditional expression.

Parameters:

expression (WhenElseExpression) – The conditional expression.

Return type:

None

DepartQualifiedExpression(expression)[source]

Write the right parenthesis closing the operand of a qualified expression, unless the operand brings its own.

Format: byte'(others => '0')

Parameters:

expression (QualifiedExpression) – The qualified expression.

Return type:

None

VisitSubtypeAllocation(allocation)[source]

Write the reserved word new of an allocation of a subtype.

Format: new node

Parameters:

allocation (SubtypeAllocation) – The allocation.

Return type:

None

VisitQualifiedExpressionAllocation(allocation)[source]

Write the reserved word new of an allocation initialized by a qualified expression.

Format: new integer'(5)

Parameters:

allocation (QualifiedExpressionAllocation) – The allocation.

Return type:

None

VisitAggregate(aggregate)[source]

Write the left parenthesis of an aggregate.

Format: (0 => '1', others => '0')

Parameters:

aggregate (Aggregate) – The aggregate.

Raises:
  • VHDLWriterError – If the aggregate has no elements.

  • VHDLWriterError – If the aggregate has a single positional element (it would read as parentheses).
    Use a named element, e.g. others => value.

Return type:

None

DepartAggregate(aggregate)[source]

Write the right parenthesis of an aggregate.

Parameters:

aggregate (Aggregate) – The aggregate.

Return type:

None

VisitIndexedAggregateElement(element)[source]

Enter an aggregate element chosen by an index; the index is a simple expression.

Format: 0 => '1'

Parameters:

element (IndexedAggregateElement) – The aggregate element.

Return type:

None

VisitOthersAggregateElement(element)[source]

Write the choice others of an aggregate element.

Format: others => '0'

Parameters:

element (OthersAggregateElement) – The aggregate element.

Return type:

None

VisitSimpleRange(rng)[source]

Enter a range given by its bounds; its bounds are simple expressions.

Format: 0 to 7

Parameters:

rng (SimpleRange) – The range.

Return type:

None

DepartSimpleRange(rng)[source]

Leave a range given by its bounds.

Parameters:

rng (SimpleRange) – The range.

Return type:

None

VisitRangeFromName(rng)[source]

Enter a range denoted by a name.

Format: v'range

Parameters:

rng (RangeFromName) – The range.

Return type:

None

DepartRangeFromName(rng)[source]

Leave a range denoted by a name.

Parameters:

rng (RangeFromName) – The range.

Return type:

None

VisitSimpleName(name)[source]

Write a simple name.

Format: clk

Parameters:

name (SimpleName) – The simple name.

Return type:

None

DepartSelectedName(name)[source]

Write the suffix of a selected name after its prefix.

Format: ieee.numeric_std

Parameters:

name (SelectedName) – The selected name.

Return type:

None

DepartAllName(name)[source]

Write the suffix all of a selected name after its prefix, or the reserved word all without a prefix.

Format: ieee.numeric_std.all or all

Parameters:

name (AllName) – The all name.

Return type:

None

DepartAttributeName(name)[source]

Write the attribute designator of an attribute name after its prefix.

Format: v'range

Parameters:

name (AttributeName) – The attribute name.

Return type:

None

DepartIndexedName(name)[source]

Write the right parenthesis closing the indices of an indexed name.

Format: m(i, j)

Parameters:

name (IndexedName) – The indexed name.

Return type:

None

DepartParenthesisName(name)[source]

Write the right parenthesis closing the associations of a parenthesis name (index, slice or function call).

Format: resize(a, 8)

Parameters:

name (ParenthesisName) – The parenthesis name.

Return type:

None

VisitSlicedName(name)[source]

Reject a sliced name, because it carries no discrete range.

Parameters:

name (SlicedName) – The sliced name.

Raises:

VHDLWriterError – Always, because a sliced name carries no discrete range.
Use a ParenthesisName with a range expression as association.

Return type:

None

VisitOpenName(name)[source]

Write the reserved word open.

Format: open

Parameters:

name (OpenName) – The open name.

Return type:

None

VisitAssociationItem(item)[source]

Check an association item before its formal and actual are written.

Format: formal => actual or actual

Parameters:

item (AssociationItem) – The association item.

Raises:

VHDLWriterError – If the association item has no actual.

Return type:

None

VisitSemicolon(element)[source]

Write the semicolon between two items of an interface list; the next item starts on a new line.

Parameters:

element (WithGenericsMixin | WithPortsMixin | WithParametersMixin) – The element containing the interface list.

Return type:

None

_WriteIndentation()[source]

Write the indentation of the current indentation level.

Return type:

None

VisitVariableAssignment(element)[source]

Write the variable assignment delimiter (:=) before a default expression or the value of a variable assignment.

Parameters:

element (WithDefaultExpressionMixin | AssignmentMixin) – The element with the default expression or the variable assignment.

Return type:

None

VisitIs(element)[source]

Write the reserved word is ending the header of a declaration; its body is indented.

In an alias declaration and an attribute specification, the name or the expression follows on the same line. A subprogram without declared items and statements is a subprogram declaration, which has no is.

Parameters:

element (ModeViewDeclaration | Alias | AttributeSpecification | Subprogram | Architecture | Configuration | ProcessStatement | CaseStatement) – The declaration.

Return type:

None

VisitRangeConstraint(symbol)[source]

Write the reserved word range of a range constraint.

Format: integer range 0 to 7

Parameters:

symbol (ConstrainedScalarSubtypeSymbol) – The constrained subtype symbol.

Return type:

None

VisitIndexConstraint(element)[source]

Write the left parenthesis of an index constraint.

Format: bit_vector(7 downto 0)

Parameters:

element (ConstrainedArraySubtypeSymbol | ConstrainedRecordSubtypeSymbol | ArrayType) – The constrained subtype symbol or the array type.

Return type:

None

DepartIndexConstraint(element)[source]

Write the right parenthesis of an index constraint.

Parameters:

element (ConstrainedArraySubtypeSymbol | ConstrainedRecordSubtypeSymbol | ArrayType) – The constrained subtype symbol or the array type.

Return type:

None

VisitRecordConstraint(symbol)[source]

Write the left parenthesis of a record constraint.

Format: frame(data(7 downto 0), mask(3 downto 0))

Parameters:

symbol (ConstrainedRecordSubtypeSymbol) – The constrained subtype symbol.

Return type:

None

DepartRecordConstraint(symbol)[source]

Write the right parenthesis of a record constraint.

Parameters:

symbol (ConstrainedRecordSubtypeSymbol) – The constrained subtype symbol.

Return type:

None

VisitGenericClause(element)[source]

Write the reserved word generic and the left parenthesis of a generic clause; each generic is on its own line.

Format: generic ( … );

The generic clause of a subprogram follows its designator on the same line and ends without a semicolon.

Parameters:

element (WithGenericsMixin) – The element with generics.

Return type:

None

DepartGenericClause(element)[source]

Write the right parenthesis of a generic clause on its own line.

Parameters:

element (WithGenericsMixin) – The element with generics.

Return type:

None

_WriteClosingParenthesis(terminator)[source]

Write the right parenthesis closing a list on its own line, one indentation level up.

Parameters:

terminator (str) – The text following the right parenthesis.

Return type:

None

VisitPortClause(element)[source]

Write the reserved word port and the left parenthesis of a port clause; each port is on its own line.

Format: port ( … );

Parameters:

element (WithPortsMixin) – The element with ports.

Return type:

None

DepartPortClause(element)[source]

Write the right parenthesis of a port clause on its own line.

Parameters:

element (WithPortsMixin) – The element with ports.

Return type:

None

VisitConstant(constant)[source]

Write the reserved word constant and the identifiers of a constant declaration.

Format: constant BITS : positive := 8;

Parameters:

constant (Constant) – The constant declaration.

Return type:

None

_WriteObjectDeclaration(obj)[source]

Write the indentation, the object class reserved word and the identifiers of an object declaration.

Parameters:

obj (Obj) – The object declaration.

Return type:

None

DepartConstant(constant)[source]

Write the semicolon ending a constant declaration.

Parameters:

constant (Constant) – The constant declaration.

Return type:

None

VisitDeferredConstant(constant)[source]

Write the reserved word constant and the identifiers of a deferred constant declaration.

Format: constant BITS : positive;

Parameters:

constant (DeferredConstant) – The deferred constant declaration.

Return type:

None

DepartDeferredConstant(constant)[source]

Write the semicolon ending a deferred constant declaration.

Parameters:

constant (DeferredConstant) – The deferred constant declaration.

Return type:

None

VisitVariable(variable)[source]

Write the reserved word variable and the identifiers of a variable declaration.

Format: variable count : natural := 0;

Parameters:

variable (Variable) – The variable declaration.

Return type:

None

DepartVariable(variable)[source]

Write the semicolon ending a variable declaration.

Parameters:

variable (Variable) – The variable declaration.

Return type:

None

VisitSharedVariable(variable)[source]

Write the reserved words shared variable and the identifiers of a shared variable declaration.

Format: shared variable counter : counter_t;

Parameters:

variable (SharedVariable) – The shared variable declaration.

Return type:

None

DepartSharedVariable(variable)[source]

Write the semicolon ending a shared variable declaration.

Parameters:

variable (SharedVariable) – The shared variable declaration.

Return type:

None

VisitSignal(signal)[source]

Write the reserved word signal and the identifiers of a signal declaration.

Format: signal a, b : bit := '0';

Parameters:

signal (Signal) – The signal declaration.

Return type:

None

DepartSignal(signal)[source]

Write the semicolon ending a signal declaration.

Parameters:

signal (Signal) – The signal declaration.

Return type:

None

VisitFile(file)[source]

Write the reserved word file and the identifiers of a file declaration.

Format: file input : text;

The model carries no file open information, so none is written.

Parameters:

file (File) – The file declaration.

Return type:

None

DepartFile(file)[source]

Write the semicolon ending a file declaration.

Parameters:

file (File) – The file declaration.

Return type:

None

VisitGenericConstantInterfaceItem(item)[source]

Write the identifiers and the mode of a generic constant.

Format: BITS : positive := 8

Parameters:

item (GenericConstantInterfaceItem) – The generic constant.

Return type:

None

_WriteInterfaceItem(item, keywords, mode)[source]

Write the object class reserved words (if any), the identifiers and the mode (if any) of an interface item.

Parameters:
  • item (Obj) – The interface item.

  • keywords (tuple[ReservedWord, ...]) – The object class reserved words, or an empty tuple.

  • mode (Mode) – The mode; Mode.Default writes none.

Return type:

None

VisitGenericTypeInterfaceItem(item)[source]

Write a generic type.

Format: type T

Parameters:

item (GenericTypeInterfaceItem) – The generic type.

Return type:

None

VisitPortSimpleSignalInterfaceItem(item)[source]

Write the identifiers and the mode of a port.

Format: clk : in std_logic

Parameters:

item (PortSimpleSignalInterfaceItem) – The port.

Return type:

None

VisitPortViewSignalInterfaceItem(item)[source]

Write the identifiers and the reserved word view of a port with a mode view.

Format: link : view master

Parameters:

item (PortViewSignalInterfaceItem) – The port.

Return type:

None

VisitParameterConstantInterfaceItem(item)[source]

Write the reserved word constant, the identifiers and the mode of a constant parameter.

Format: constant value : in integer

Parameters:

item (ParameterConstantInterfaceItem) – The constant parameter.

Return type:

None

VisitParameterVariableInterfaceItem(item)[source]

Write the reserved word variable, the identifiers and the mode of a variable parameter.

Format: variable result : out integer

Parameters:

item (ParameterVariableInterfaceItem) – The variable parameter.

Return type:

None

VisitParameterSimpleSignalInterfaceItem(item)[source]

Write the reserved word signal, the identifiers and the mode of a signal parameter.

Format: signal clk : in std_logic

Parameters:

item (ParameterSimpleSignalInterfaceItem) – The signal parameter.

Return type:

None

VisitParameterViewSignalInterfaceItem(item)[source]

Write the reserved word signal, the identifiers and the reserved word view of a signal parameter.

Format: signal link : view master

Parameters:

item (ParameterViewSignalInterfaceItem) – The signal parameter.

Return type:

None

VisitParameterFileInterfaceItem(item)[source]

Write the reserved word file and the identifiers of a file parameter.

Format: file input : text

Parameters:

item (ParameterFileInterfaceItem) – The file parameter.

Return type:

None

VisitModeViewDeclaration(declaration)[source]

Write the reserved word view, the identifier and the reserved word of of a mode view declaration.

Format: view master of bus_t is … end view master;

Parameters:

declaration (ModeViewDeclaration) – The mode view declaration.

Return type:

None

DepartModeViewDeclaration(declaration)[source]

Write the end of a mode view declaration.

Parameters:

declaration (ModeViewDeclaration) – The mode view declaration.

Return type:

None

_WriteEnd(keywords, identifier)[source]

Leave the indented body and write the reserved word end, the given reserved words and the identifier.

Parameters:
  • keywords (tuple[ReservedWord, ...]) – The reserved words after end.

  • identifier (str | None) – The identifier or label of the declaration or statement, or None if it has none.

Return type:

None

_WriteEndLine(keywords, identifier)[source]

Write the reserved word end, the given reserved words and the identifier on a line of the current level.

Parameters:
  • keywords (tuple[ReservedWord, ...]) – The reserved words after end.

  • identifier (str | None) – The identifier or label of the declaration or statement, or None if it has none.

Return type:

None

VisitSimpleModeViewElement(element)[source]

Write an element of a mode view with a mode.

Format: valid, data : out;

Parameters:

element (SimpleModeViewElement) – The mode view element.

Raises:

VHDLWriterError – If the mode view element has no mode.

Return type:

None

VisitCompositeModeViewElement(element)[source]

Write the identifiers and the reserved word view of an element of a mode view with a mode view.

Format: request : view master;

Parameters:

element (CompositeModeViewElement) – The mode view element.

Return type:

None

DepartCompositeModeViewElement(element)[source]

Write the semicolon ending an element of a mode view with a mode view.

Parameters:

element (CompositeModeViewElement) – The mode view element.

Return type:

None

VisitComponent(component)[source]

Write the header of a component declaration; its generic and port clauses are indented.

Format: component counter is … end component counter;

Parameters:

component (Component) – The component declaration.

Return type:

None

DepartComponent(component)[source]

Write the end of a component declaration.

Parameters:

component (Component) – The component declaration.

Return type:

None

VisitBox(arrayType)[source]

Write the reserved word range and the box (<>) of an unbounded index of an array type.

Format: natural range <>

Parameters:

arrayType (ArrayType) – The array type.

Return type:

None

VisitOf(arrayType)[source]

Write the reserved word of before the element subtype of an array type.

Parameters:

arrayType (ArrayType) – The array type.

Return type:

None

VisitUnits(physicalType)[source]

Write the reserved word units and the primary unit of a physical type on their own lines.

Parameters:

physicalType (PhysicalType) – The physical type.

Return type:

None

VisitSecondaryUnitDeclaration(physicalType, identifier)[source]

Write the identifier of a secondary unit declaration.

Format: mm = 1000 um;

Parameters:
  • physicalType (PhysicalType) – The physical type.

  • identifier (str) – The identifier of the secondary unit.

Return type:

None

DepartSecondaryUnitDeclaration(physicalType, identifier)[source]

Write the semicolon ending a secondary unit declaration.

Parameters:
  • physicalType (PhysicalType) – The physical type.

  • identifier (str) – The identifier of the secondary unit.

Return type:

None

VisitEntitySpecification(specification)[source]

Write the reserved word of before the names of an attribute specification.

Parameters:

specification (AttributeSpecification) – The attribute specification.

Return type:

None

DepartEntitySpecification(specification)[source]

Write the entity class after the names of an attribute specification.

Parameters:

specification (AttributeSpecification) – The attribute specification.

Return type:

None

VisitAnonymousType(declaration)[source]

Write an incomplete type declaration.

Format: type node;

Parameters:

declaration (AnonymousType) – The incomplete type declaration.

Return type:

None

VisitSubtype(subtype)[source]

Write the reserved word subtype, the identifier and the reserved word is of a subtype declaration.

Format: subtype byte is bit_vector(7 downto 0);

The model’s resolution function of a subtype is not written.

Parameters:

subtype (Subtype) – The subtype declaration.

Return type:

None

DepartSubtype(subtype)[source]

Write the semicolon ending a subtype declaration.

Parameters:

subtype (Subtype) – The subtype declaration.

Return type:

None

VisitEnumeratedType(enumeratedType)[source]

Write the header and the left parenthesis of an enumerated type declaration.

Format: type state is (Idle, Busy, Done);

Parameters:

enumeratedType (EnumeratedType) – The enumerated type.

Return type:

None

_WriteTypeHeader(declaration)[source]

Write the indentation, the reserved word type, the identifier and the reserved word is of a type.

Parameters:

declaration (FullType) – The type declaration.

Return type:

None

DepartEnumeratedType(enumeratedType)[source]

Write the right parenthesis ending an enumerated type declaration.

Parameters:

enumeratedType (EnumeratedType) – The enumerated type.

Return type:

None

VisitIntegerType(integerType)[source]

Write the header and the reserved word range of an integer type declaration.

Format: type nibble is range 0 to 15;

Parameters:

integerType (IntegerType) – The integer type.

Return type:

None

DepartIntegerType(integerType)[source]

Write the semicolon ending an integer type declaration.

Parameters:

integerType (IntegerType) – The integer type.

Return type:

None

VisitRealType(realType)[source]

Write the header and the reserved word range of a floating-point type declaration.

Format: type fraction is range 0.0 to 1.0;

Parameters:

realType (RealType) – The floating-point type.

Return type:

None

DepartRealType(realType)[source]

Write the semicolon ending a floating-point type declaration.

Parameters:

realType (RealType) – The floating-point type.

Return type:

None

VisitPhysicalType(physicalType)[source]

Write the header and the reserved word range of a physical type declaration; its units are indented.

Format: type distance is range 0 to 1000000 … units … end units distance;

Parameters:

physicalType (PhysicalType) – The physical type.

Return type:

None

DepartPhysicalType(physicalType)[source]

Write the end of the units of a physical type declaration.

Parameters:

physicalType (PhysicalType) – The physical type.

Return type:

None

VisitArrayType(arrayType)[source]

Write the header and the reserved word array of an array type declaration.

Format: type memory is array (0 to 255) of byte; or type bits is array (natural range <>) of bit;

Parameters:

arrayType (ArrayType) – The array type.

Return type:

None

DepartArrayType(arrayType)[source]

Write the semicolon ending an array type declaration.

Parameters:

arrayType (ArrayType) – The array type.

Return type:

None

VisitRecordType(recordType)[source]

Write the header of a record type declaration; its element declarations are indented.

Format: type frame is record … end record frame;

Parameters:

recordType (RecordType) – The record type.

Return type:

None

DepartRecordType(recordType)[source]

Write the end of a record type declaration.

Parameters:

recordType (RecordType) – The record type.

Return type:

None

VisitRecordTypeElement(element)[source]

Write the identifiers of an element declaration of a record type.

Format: valid, last : bit;

Parameters:

element (RecordTypeElement) – The record element declaration.

Return type:

None

DepartRecordTypeElement(element)[source]

Write the semicolon ending an element declaration of a record type.

Parameters:

element (RecordTypeElement) – The record element declaration.

Return type:

None

VisitAccessType(accessType)[source]

Write the header and the reserved word access of an access type declaration.

Format: type pointer is access node;

Parameters:

accessType (AccessType) – The access type.

Return type:

None

DepartAccessType(accessType)[source]

Write the semicolon ending an access type declaration.

Parameters:

accessType (AccessType) – The access type.

Return type:

None

VisitFileType(fileType)[source]

Write the header and the reserved words file of of a file type declaration.

Format: type text_file is file of string;

Parameters:

fileType (FileType) – The file type.

Return type:

None

DepartFileType(fileType)[source]

Write the semicolon ending a file type declaration.

Parameters:

fileType (FileType) – The file type.

Return type:

None

VisitAlias(alias)[source]

Write the reserved word alias and the identifier of an alias declaration.

Format: alias low : bit_vector(3 downto 0) is data(3 downto 0); or alias clock is clk;

Parameters:

alias (Alias) – The alias declaration.

Return type:

None

DepartAlias(alias)[source]

Write the semicolon ending an alias declaration.

Parameters:

alias (Alias) – The alias declaration.

Return type:

None

VisitAttribute(attribute)[source]

Write the reserved word attribute and the identifier of an attribute declaration.

Format: attribute keep : boolean;

Parameters:

attribute (Attribute) – The attribute declaration.

Return type:

None

DepartAttribute(attribute)[source]

Write the semicolon ending an attribute declaration.

Parameters:

attribute (Attribute) – The attribute declaration.

Return type:

None

VisitAttributeSpecification(specification)[source]

Write the reserved word attribute of an attribute specification.

Format: attribute keep of valid, ready : signal is true;

Parameters:

specification (AttributeSpecification) – The attribute specification.

Raises:

VHDLWriterError – If the entity class is EntityClass.Others.

Return type:

None

DepartAttributeSpecification(specification)[source]

Write the semicolon ending an attribute specification.

Parameters:

specification (AttributeSpecification) – The attribute specification.

Return type:

None

VisitBegin(element)[source]

Write the reserved word begin before the statement part on its own line.

A subprogram declaration, an entity without statements and the body of a generate statement without declared items have no begin.

Parameters:

element (Subprogram | Entity | Architecture | ProcessStatement | ConcurrentBlockStatement | GenerateBranch | ConcurrentCase | ForGenerateStatement) – The element with a statement part.

Return type:

None

static _IsSubprogramBody(subprogram)[source]

Check if a subprogram is written as a subprogram body.

A subprogram is a body, if it has declared items or statements, or if its parent is neither a package declaration nor a protected type declaration (e.g. a package body or an architecture).

Parameters:

subprogram (Subprogram) – The subprogram.

Return type:

bool

Returns:

True, if the subprogram is written as a subprogram body.

VisitReturn(function)[source]

Write the reserved word return before the return type of a function.

Parameters:

function (Function | GenericFunctionInterfaceItem) – The function.

Return type:

None

VisitFormalParameterList(element)[source]

Write the left parenthesis of a formal parameter list; each parameter is on its own line.

Format: procedure p ( … )

After a generic clause, the reserved word parameter precedes the left parenthesis.

Parameters:

element (WithParametersMixin) – The element with parameters.

Return type:

None

DepartFormalParameterList(element)[source]

Write the right parenthesis of a formal parameter list on its own line.

Parameters:

element (WithParametersMixin) – The element with parameters.

Return type:

None

VisitGenericMapAspect(element)[source]

Write the reserved words generic map and the left parenthesis on a new line; each association is on its own line.

Format: generic map ( … )

The generic map aspect of a block statement is written like its generic clause and ends with a semicolon.

Parameters:

element (GenericMapAspectMixin) – The element with a generic map aspect.

Return type:

None

_WriteMapAspect(keyword, element)[source]

Write the reserved words of a map aspect and the left parenthesis on a new line, one indentation level deeper.

In a block statement, the map aspect starts its own line at the block header’s indentation level.

Parameters:
Return type:

None

DepartGenericMapAspect(element)[source]

Write the right parenthesis of a generic map aspect on its own line.

Parameters:

element (GenericMapAspectMixin) – The element with a generic map aspect.

Return type:

None

_WriteMapAspectEnd(element)[source]

Write the right parenthesis of a map aspect on its own line and leave its indentation level.

In a block statement, a semicolon follows the right parenthesis.

Parameters:

element (GenericMapAspectMixin | PortMapAspectMixin) – The element with the map aspect.

Return type:

None

VisitProcedure(procedure)[source]

Write the reserved word procedure and the designator of a procedure declaration or body.

Format: procedure reset; or procedure reset is … begin … end procedure reset;

A procedure without declared items and statements is written as a procedure declaration.

Parameters:

procedure (Procedure) – The procedure.

Return type:

None

DepartProcedure(procedure)[source]

Write the semicolon ending a procedure declaration, or the end of a procedure body.

Parameters:

procedure (Procedure) – The procedure.

Return type:

None

VisitFunction(function)[source]

Write the reserved word impure, if impure, function and the designator of a function declaration or body.

Format: function parity return bit; or function parity return bit is … end function parity;

A function without declared items and statements is written as a function declaration.

Parameters:

function (Function) – The function.

Return type:

None

_WriteFunctionDesignator(function)[source]

Write the reserved word impure, if impure, the reserved word function and the designator of a function.

Parameters:

function (Function) – The function.

Return type:

None

DepartFunction(function)[source]

Write the semicolon ending a function declaration, or the end of a function body.

Parameters:

function (Function) – The function.

Return type:

None

VisitGenericProcedureInterfaceItem(item)[source]

Write the reserved word procedure and the designator of a generic procedure.

Format: procedure log ( … )

Parameters:

item (GenericProcedureInterfaceItem) – The generic procedure.

Return type:

None

VisitGenericFunctionInterfaceItem(item)[source]

Write the reserved word impure, if impure, function and the designator of a generic function.

Format: function compare ( … ) return boolean

Parameters:

item (GenericFunctionInterfaceItem) – The generic function.

Return type:

None

VisitProcedureInstantiation(instantiation)[source]

Write the reserved word procedure, the designator and the reserved words is new of a procedure instantiation.

Format: procedure log_byte is new log … ;

Parameters:

instantiation (ProcedureInstantiation) – The procedure instantiation.

Return type:

None

DepartProcedureInstantiation(instantiation)[source]

Write the semicolon ending a procedure instantiation.

Parameters:

instantiation (ProcedureInstantiation) – The procedure instantiation.

Return type:

None

VisitFunctionInstantiation(instantiation)[source]

Write the reserved word function, the designator and the reserved words is new of a function instantiation.

Format: function maximum_byte is new maximum … ;

Parameters:

instantiation (FunctionInstantiation) – The function instantiation.

Return type:

None

DepartFunctionInstantiation(instantiation)[source]

Write the semicolon ending a function instantiation.

Parameters:

instantiation (FunctionInstantiation) – The function instantiation.

Return type:

None

VisitProtectedType(protectedType)[source]

Write the header of a protected type declaration; its methods are indented.

Format: type counter is protected … end protected counter;

Parameters:

protectedType (ProtectedType) – The protected type.

Return type:

None

DepartProtectedType(protectedType)[source]

Write the end of a protected type declaration.

Parameters:

protectedType (ProtectedType) – The protected type.

Return type:

None

VisitProtectedTypeBody(body)[source]

Write the header of a protected type body; its declared items are indented.

Format: type counter is protected body … end protected body counter;

Parameters:

body (ProtectedTypeBody) – The protected type body.

Return type:

None

DepartProtectedTypeBody(body)[source]

Write the end of a protected type body.

Parameters:

body (ProtectedTypeBody) – The protected type body.

Return type:

None

VisitPortMapAspect(element)[source]

Write the reserved words port map and the left parenthesis on a new line; each association is on its own line.

Format: port map ( … )

Parameters:

element (PortMapAspectMixin) – The element with a port map aspect.

Return type:

None

DepartPortMapAspect(element)[source]

Write the right parenthesis of a port map aspect on its own line.

Parameters:

element (PortMapAspectMixin) – The element with a port map aspect.

Return type:

None

VisitContextClause(designUnit)[source]

Separate a design unit by a blank line from the text written before it.

Parameters:

designUnit (DesignUnit) – The design unit.

Return type:

None

DepartContextClause(designUnit)[source]

Separate the context items of a design unit by a blank line from the design unit.

Parameters:

designUnit (DesignUnit) – The design unit.

Return type:

None

VisitLibraryClause(clause)[source]

Write the reserved word library of a library clause.

Format: library ieee;

Parameters:

clause (LibraryClause) – The library clause.

Return type:

None

DepartLibraryClause(clause)[source]

Write the semicolon ending a library clause.

Parameters:

clause (LibraryClause) – The library clause.

Return type:

None

VisitUseClause(clause)[source]

Write the reserved word use of a use clause.

Format: use ieee.numeric_std.all;

Parameters:

clause (UseClause) – The use clause.

Return type:

None

DepartUseClause(clause)[source]

Write the semicolon ending a use clause.

Parameters:

clause (UseClause) – The use clause.

Return type:

None

VisitContextReference(reference)[source]

Write the reserved word context of a context reference.

Format: context ieee.ieee_std_context;

Parameters:

reference (ContextReference) – The context reference.

Return type:

None

DepartContextReference(reference)[source]

Write the semicolon ending a context reference.

Parameters:

reference (ContextReference) – The context reference.

Return type:

None

VisitContext(context)[source]

Write the header of a context declaration; its context items are indented.

Format: context project is … end context project;

Parameters:

context (Context) – The context declaration.

Return type:

None

_WriteUnitHeader(keywords, identifier)[source]

Write the reserved words, the identifier and the reserved word is of a header; the body is indented.

Parameters:
  • keywords (tuple[ReservedWord, ...]) – The reserved words before the identifier.

  • identifier (str) – The identifier.

Return type:

None

DepartContext(context)[source]

Write the end of a context declaration.

Parameters:

context (Context) – The context declaration.

Return type:

None

VisitPackage(package)[source]

Write the header of a package declaration; its generic clause and declared items are indented.

Format: package utilities is … end package utilities;

Parameters:

package (Package) – The package declaration.

Return type:

None

DepartPackage(package)[source]

Write the end of a package declaration.

Parameters:

package (Package) – The package declaration.

Return type:

None

VisitPackageBody(body)[source]

Write the header of a package body; its declared items are indented.

Format: package body utilities is … end package body utilities;

Parameters:

body (PackageBody) – The package body.

Return type:

None

DepartPackageBody(body)[source]

Write the end of a package body.

Parameters:

body (PackageBody) – The package body.

Return type:

None

VisitPackageInstantiation(instantiation)[source]

Write the reserved word package, the identifier and the reserved words is new of a package instantiation.

Format: package fifo_byte is new work.fifo … ;

Parameters:

instantiation (PackageInstantiation) – The package instantiation.

Return type:

None

DepartPackageInstantiation(instantiation)[source]

Write the semicolon ending a package instantiation.

Parameters:

instantiation (PackageInstantiation) – The package instantiation.

Return type:

None

VisitEntity(entity)[source]

Write the header of an entity declaration; its generic and port clauses and its declared items are indented.

Format: entity counter is … end entity counter;

Parameters:

entity (Entity) – The entity declaration.

Return type:

None

DepartEntity(entity)[source]

Write the end of an entity declaration.

Parameters:

entity (Entity) – The entity declaration.

Return type:

None

VisitArchitecture(architecture)[source]

Write the reserved word architecture, the identifier and the reserved word of of an architecture body.

Format: architecture rtl of counter is … begin … end architecture rtl;

Parameters:

architecture (Architecture) – The architecture body.

Return type:

None

DepartArchitecture(architecture)[source]

Write the end of an architecture body.

Parameters:

architecture (Architecture) – The architecture body.

Return type:

None

VisitConfiguration(configuration)[source]

Write the reserved word configuration, the identifier and the reserved word of of a configuration.

Format: configuration counter_cfg of counter is … end configuration counter_cfg;

Parameters:

configuration (Configuration) – The configuration declaration.

Return type:

None

DepartConfiguration(configuration)[source]

Write the end of a configuration declaration.

Parameters:

configuration (Configuration) – The configuration declaration.

Return type:

None

VisitBlockConfiguration(configuration)[source]

Write the reserved word for of a block configuration; its nested configurations are indented.

Format: for rtl … end for;

Parameters:

configuration (BlockConfiguration) – The block configuration.

Return type:

None

DepartBlockSpecification(configuration)[source]

End the line of a block specification; the nested configurations are indented.

Parameters:

configuration (BlockConfiguration) – The block configuration.

Return type:

None

DepartBlockConfiguration(configuration)[source]

Write the end of a block configuration.

Parameters:

configuration (BlockConfiguration) – The block configuration.

Return type:

None

VisitComponentConfiguration(configuration)[source]

Write the reserved word for of a component configuration.

Format: for all : counter use entity work.counter(rtl); … end for;

Parameters:

configuration (ComponentConfiguration) – The component configuration.

Return type:

None

DepartInstantiationList(configuration)[source]

Write the colon between the instantiation list and the component name of a component configuration.

Parameters:

configuration (ComponentConfiguration) – The component configuration.

Return type:

None

DepartComponentConfiguration(configuration)[source]

Write the end of a component configuration on its own line.

Parameters:

configuration (ComponentConfiguration) – The component configuration.

Return type:

None

VisitBindingIndication(indication)[source]

Write the reserved word use of a binding indication on a new line, one indentation level deeper.

Format: use entity work.counter(rtl) … ;

Parameters:

indication (BindingIndication) – The binding indication.

Return type:

None

DepartBindingIndication(indication)[source]

Write the semicolon ending a binding indication.

Parameters:

indication (BindingIndication) – The binding indication.

Return type:

None

VisitEntityAspectEntity(aspect)[source]

Write the reserved word entity of an entity aspect naming an entity.

Format: entity work.counter(rtl)

Parameters:

aspect (EntityAspectEntity) – The entity aspect.

Return type:

None

VisitEntityAspectConfiguration(aspect)[source]

Write the reserved word configuration of an entity aspect naming a configuration.

Format: configuration work.counter_cfg

Parameters:

aspect (EntityAspectConfiguration) – The entity aspect.

Return type:

None

VisitEntityAspectOpen(aspect)[source]

Write the reserved word open of an open entity aspect.

Format: open

Parameters:

aspect (EntityAspectOpen) – The entity aspect.

Return type:

None

VisitAllInstantiationList(instantiationList)[source]

Write the reserved word all of an instantiation list.

Format: all

Parameters:

instantiationList (AllInstantiationList) – The instantiation list.

Return type:

None

VisitOthersInstantiationList(instantiationList)[source]

Write the reserved word others of an instantiation list.

Format: others

Parameters:

instantiationList (OthersInstantiationList) – The instantiation list.

Return type:

None

VisitSignalAssignment(element)[source]

Write the signal assignment delimiter (<=) between the target and the waveform of a signal assignment.

In a force assignment, the reserved word force follows.

Parameters:

element (SignalAssignmentMixin) – The signal assignment.

Return type:

None

VisitAfter(element)[source]

Write the reserved word after before the delay of a waveform element.

Parameters:

element (WaveformElement) – The waveform element.

Return type:

None

VisitSelect(element)[source]

Write the reserved word select between the selector and the target of a selected assignment.

Parameters:

element (ConcurrentSelectedSignalAssignment | SequentialSelectedVariableAssignment | SequentialSelectedSignalAssignment) – The selected assignment.

Return type:

None

VisitBar(element)[source]

Write the vertical line (|) between two choices.

Parameters:

element (SelectedWaveform | GenerateCase | SelectedExpression | Case) – The element with the choices.

Return type:

None

VisitReport(element)[source]

Write the reserved word report before the message of an assertion or report.

A report statement starts with the reserved word.

Parameters:

element (ReportStatementMixin) – The assertion or report.

Return type:

None

VisitSeverity(element)[source]

Write the reserved word severity before the severity level of an assertion or report.

Parameters:

element (ReportStatementMixin) – The assertion or report.

Return type:

None

VisitSensitivityList(process)[source]

Write the left parenthesis of the sensitivity list of a process.

Format: process (clk, rst) or process (all)

Parameters:

process (ProcessStatement) – The process.

Return type:

None

DepartSensitivityList(process)[source]

Write the right parenthesis of the sensitivity list of a process.

Parameters:

process (ProcessStatement) – The process.

Return type:

None

VisitActualParameterPart(call)[source]

Write the left parenthesis of the actual parameter part of a procedure call.

Parameters:

call (ProcedureCallMixin) – The procedure call.

Return type:

None

DepartActualParameterPart(call)[source]

Write the right parenthesis of the actual parameter part of a procedure call.

Parameters:

call (ProcedureCallMixin) – The procedure call.

Return type:

None

DepartOthersSelectedWaveform(waveform)[source]

Write the choice others of the others selected waveform.

Format: '0' when others

Parameters:

waveform (OthersSelectedWaveform) – The selected waveform.

Return type:

None

VisitIndexedChoice(choice)[source]

Enter a choice given by a value; the value is a simple expression.

Format: '0'

Parameters:

choice (IndexedChoice) – The choice.

Return type:

None

VisitProcessStatement(process)[source]

Write the label, if any, and the reserved word process of a process statement.

Format: count : process (clk) is … begin … end process count;

A process with all as sensitivity list has a single AllName without prefix in its sensitivity list.

Parameters:

process (ProcessStatement) – The process.

Return type:

None

_WriteStatementStart(statement)[source]

Write the indentation and the label, if any, of a statement.

Parameters:

statement (Statement) – The statement.

Return type:

None

DepartProcessStatement(process)[source]

Write the end of a process statement.

Parameters:

process (ProcessStatement) – The process.

Return type:

None

VisitConcurrentProcedureCall(call)[source]

Write the label, if any, of a concurrent procedure call.

Format: check(clk, rst);

Parameters:

call (ConcurrentProcedureCall) – The procedure call.

Return type:

None

DepartConcurrentProcedureCall(call)[source]

Write the semicolon ending a concurrent procedure call.

Parameters:

call (ConcurrentProcedureCall) – The procedure call.

Return type:

None

VisitConcurrentSimpleSignalAssignment(assignment)[source]

Write the label, if any, of a concurrent simple signal assignment.

Format: q <= d after 1 ns;

Parameters:

assignment (ConcurrentSimpleSignalAssignment) – The signal assignment.

Return type:

None

DepartConcurrentSimpleSignalAssignment(assignment)[source]

Write the semicolon ending a concurrent simple signal assignment.

Parameters:

assignment (ConcurrentSimpleSignalAssignment) – The signal assignment.

Return type:

None

VisitConcurrentSelectedSignalAssignment(assignment)[source]

Write the label, if any, and the reserved word with of a concurrent selected signal assignment.

Format: with sel select q <= a when '0', b when others;

Parameters:

assignment (ConcurrentSelectedSignalAssignment) – The signal assignment.

Return type:

None

DepartConcurrentSelectedSignalAssignment(assignment)[source]

Write the semicolon ending a concurrent selected signal assignment.

Parameters:

assignment (ConcurrentSelectedSignalAssignment) – The signal assignment.

Return type:

None

VisitConcurrentConditionalSignalAssignment(assignment)[source]

Write the label, if any, of a concurrent conditional signal assignment.

Format: q <= a when sel = '0' else b;

Parameters:

assignment (ConcurrentConditionalSignalAssignment) – The signal assignment.

Return type:

None

DepartConcurrentConditionalSignalAssignment(assignment)[source]

Write the semicolon ending a concurrent conditional signal assignment.

Parameters:

assignment (ConcurrentConditionalSignalAssignment) – The signal assignment.

Return type:

None

VisitConcurrentAssertStatement(assertion)[source]

Write the label, if any, and the reserved word assert of a concurrent assertion.

Format: assert BITS > 0 report "no bits" severity failure;

Parameters:

assertion (ConcurrentAssertStatement) – The assertion.

Return type:

None

DepartConcurrentAssertStatement(assertion)[source]

Write the semicolon ending a concurrent assertion.

Parameters:

assertion (ConcurrentAssertStatement) – The assertion.

Return type:

None

VisitRightParenthesis(element)[source]

Write the right parenthesis after the architecture name of an entity aspect or entity instantiation.

Parameters:

element (EntityAspectEntity | EntityInstantiation) – The element enclosing the architecture name.

Return type:

None

VisitGenerate(element)[source]

Write the reserved word generate; the body of the generate statement or branch is indented.

Parameters:

element (GenerateBranch | CaseGenerateStatement | ForGenerateStatement) – The generate statement or branch.

Return type:

None

VisitComponentInstantiation(instantiation)[source]

Write the label and the reserved word component of a component instantiation.

Format: u1 : component counter … ;

Parameters:

instantiation (ComponentInstantiation) – The component instantiation.

Raises:

VHDLWriterError – If the component instantiation has no label.

Return type:

None

DepartComponentInstantiation(instantiation)[source]

Write the semicolon ending a component instantiation.

Parameters:

instantiation (ComponentInstantiation) – The component instantiation.

Return type:

None

VisitEntityInstantiation(instantiation)[source]

Write the label and the reserved word entity of an entity instantiation.

Format: u1 : entity work.counter(rtl) … ;

Parameters:

instantiation (EntityInstantiation) – The entity instantiation.

Raises:

VHDLWriterError – If the entity instantiation has no label.

Return type:

None

DepartEntityInstantiation(instantiation)[source]

Write the semicolon ending an entity instantiation.

Parameters:

instantiation (EntityInstantiation) – The entity instantiation.

Return type:

None

VisitConfigurationInstantiation(instantiation)[source]

Write the label and the reserved word configuration of a configuration instantiation.

Format: u1 : configuration work.counter_cfg … ;

Parameters:

instantiation (ConfigurationInstantiation) – The configuration instantiation.

Raises:

VHDLWriterError – If the configuration instantiation has no label.

Return type:

None

DepartConfigurationInstantiation(instantiation)[source]

Write the semicolon ending a configuration instantiation.

Parameters:

instantiation (ConfigurationInstantiation) – The configuration instantiation.

Return type:

None

VisitConcurrentBlockStatement(block)[source]

Write the label and the reserved word block of a block statement; its header and declarations are indented.

Format: inner : block … begin … end block inner;

Parameters:

block (ConcurrentBlockStatement) – The block statement.

Raises:

VHDLWriterError – If the block statement has no label.

Return type:

None

DepartConcurrentBlockStatement(block)[source]

Write the end of a block statement.

Parameters:

block (ConcurrentBlockStatement) – The block statement.

Return type:

None

VisitIfGenerateStatement(statement)[source]

Write the label of an if-generate statement; its branches follow.

Format: gen : if BITS > 8 generate … elsif … else generate … end generate gen;

Parameters:

statement (IfGenerateStatement) – The if-generate statement.

Raises:

VHDLWriterError – If the if-generate statement has no label.

Return type:

None

DepartIfGenerateStatement(statement)[source]

Write the end of an if-generate statement.

Parameters:

statement (IfGenerateStatement) – The if-generate statement.

Return type:

None

VisitIfGenerateBranch(branch)[source]

Write the reserved word if and the alternative label, if any, of the if branch of an if-generate statement.

Parameters:

branch (IfGenerateBranch) – The generate branch.

Return type:

None

_WriteAlternativeLabel(branch)[source]

Write the alternative label, if any, of a generate branch, followed by a colon.

Parameters:

branch (GenerateBranch) – The generate branch.

Return type:

None

DepartIfGenerateBranch(branch)[source]

Leave the body of the if branch of an if-generate statement.

Parameters:

branch (IfGenerateBranch) – The generate branch.

Return type:

None

VisitElsifGenerateBranch(branch)[source]

Write the reserved word elsif and the alternative label, if any, of an elsif branch of an if-generate statement.

Parameters:

branch (ElsifGenerateBranch) – The generate branch.

Return type:

None

DepartElsifGenerateBranch(branch)[source]

Leave the body of an elsif branch of an if-generate statement.

Parameters:

branch (ElsifGenerateBranch) – The generate branch.

Return type:

None

VisitElseGenerateBranch(branch)[source]

Write the reserved word else and the alternative label, if any, of the else branch of an if-generate statement.

Parameters:

branch (ElseGenerateBranch) – The generate branch.

Return type:

None

DepartElseGenerateBranch(branch)[source]

Leave the body of the else branch of an if-generate statement.

Parameters:

branch (ElseGenerateBranch) – The generate branch.

Return type:

None

VisitCaseGenerateStatement(statement)[source]

Write the label and the reserved word case of a case-generate statement; its alternatives are indented.

Format: gen : case MODE generate … when 0 => … end generate gen;

Parameters:

statement (CaseGenerateStatement) – The case-generate statement.

Raises:

VHDLWriterError – If the case-generate statement has no label.

Return type:

None

DepartCaseGenerateStatement(statement)[source]

Write the end of a case-generate statement.

Parameters:

statement (CaseGenerateStatement) – The case-generate statement.

Return type:

None

VisitGenerateCase(case)[source]

Write the reserved word when and the alternative label, if any, of an alternative of a case-generate statement.

Format: when 1 | 2 =>

Parameters:

case (GenerateCase) – The case-generate alternative.

Return type:

None

DepartGenerateCase(case)[source]

Leave the body of an alternative of a case-generate statement.

Parameters:

case (GenerateCase) – The case-generate alternative.

Return type:

None

VisitOthersGenerateCase(case)[source]

Write the reserved words when and others of the others alternative of a case-generate statement.

Format: when others =>

Parameters:

case (OthersGenerateCase) – The case-generate alternative.

Return type:

None

DepartOthersGenerateCase(case)[source]

Leave the body of the others alternative of a case-generate statement.

Parameters:

case (OthersGenerateCase) – The case-generate alternative.

Return type:

None

VisitIndexedGenerateChoice(choice)[source]

Enter a case-generate choice given by a value; the value is a simple expression.

Format: 8

Parameters:

choice (IndexedGenerateChoice) – The choice.

Return type:

None

VisitForGenerateStatement(statement)[source]

Write the label, the reserved word for, the loop index and in of a for-generate statement.

Format: gen : for i in 0 to 3 generate … end generate gen;

Parameters:

statement (ForGenerateStatement) – The for-generate statement.

Raises:

VHDLWriterError – If the for-generate statement has no label.

Return type:

None

DepartForGenerateStatement(statement)[source]

Write the end of a for-generate statement.

Parameters:

statement (ForGenerateStatement) – The for-generate statement.

Return type:

None

VisitOn(statement)[source]

Write the reserved word on before the sensitivity list of a wait statement.

Parameters:

statement (WaitStatement) – The wait statement.

Return type:

None

VisitUntil(statement)[source]

Write the reserved word until before the condition of a wait statement.

Parameters:

statement (WaitStatement) – The wait statement.

Return type:

None

VisitFor(statement)[source]

Write the reserved word for before the timeout of a wait statement.

Parameters:

statement (WaitStatement) – The wait statement.

Return type:

None

DepartOthersSelectedExpression(expression)[source]

Write the choice others of the others selected expression.

Format: '0' when others

Parameters:

expression (OthersSelectedExpression) – The selected expression.

Return type:

None

VisitSequentialProcedureCall(call)[source]

Write the label, if any, of a procedure call.

Format: check(value, limit => 4);

Parameters:

call (SequentialProcedureCall) – The procedure call.

Return type:

None

DepartSequentialProcedureCall(call)[source]

Write the semicolon ending a procedure call.

Parameters:

call (SequentialProcedureCall) – The procedure call.

Return type:

None

VisitSequentialSimpleSignalAssignment(assignment)[source]

Write the label, if any, of a signal assignment.

Format: q <= d after 1 ns;

Parameters:

assignment (SequentialSimpleSignalAssignment) – The signal assignment.

Return type:

None

DepartSequentialSimpleSignalAssignment(assignment)[source]

Write the semicolon ending a signal assignment.

Parameters:

assignment (SequentialSimpleSignalAssignment) – The signal assignment.

Return type:

None

VisitSequentialVariableAssignment(assignment)[source]

Write the label, if any, of a variable assignment.

Format: count := count + 1;

Parameters:

assignment (SequentialVariableAssignment) – The variable assignment.

Return type:

None

DepartSequentialVariableAssignment(assignment)[source]

Write the semicolon ending a variable assignment.

Parameters:

assignment (SequentialVariableAssignment) – The variable assignment.

Return type:

None

VisitSequentialConditionalVariableAssignment(assignment)[source]

Write the label, if any, of a conditional variable assignment.

Format: v := a when sel = '0' else b;

Parameters:

assignment (SequentialConditionalVariableAssignment) – The conditional variable assignment.

Return type:

None

DepartSequentialConditionalVariableAssignment(assignment)[source]

Write the semicolon ending a conditional variable assignment.

Parameters:

assignment (SequentialConditionalVariableAssignment) – The conditional variable assignment.

Return type:

None

VisitSequentialConditionalSignalAssignment(assignment)[source]

Write the label, if any, of a conditional signal assignment.

Format: q <= a when sel = '0' else b;

Parameters:

assignment (SequentialConditionalSignalAssignment) – The conditional signal assignment.

Return type:

None

DepartSequentialConditionalSignalAssignment(assignment)[source]

Write the semicolon ending a conditional signal assignment.

Parameters:

assignment (SequentialConditionalSignalAssignment) – The conditional signal assignment.

Return type:

None

VisitSequentialSelectedVariableAssignment(assignment)[source]

Write the label, if any, and the reserved word with of a selected variable assignment.

Format: with sel select v := a when '0', b when others;

Parameters:

assignment (SequentialSelectedVariableAssignment) – The selected variable assignment.

Return type:

None

DepartSequentialSelectedVariableAssignment(assignment)[source]

Write the semicolon ending a selected variable assignment.

Parameters:

assignment (SequentialSelectedVariableAssignment) – The selected variable assignment.

Return type:

None

VisitSequentialSelectedSignalAssignment(assignment)[source]

Write the label, if any, and the reserved word with of a selected signal assignment.

Format: with sel select q <= a when '0', b when others;

Parameters:

assignment (SequentialSelectedSignalAssignment) – The selected signal assignment.

Return type:

None

DepartSequentialSelectedSignalAssignment(assignment)[source]

Write the semicolon ending a selected signal assignment.

Parameters:

assignment (SequentialSelectedSignalAssignment) – The selected signal assignment.

Return type:

None

VisitSignalForceAssignment(assignment)[source]

Write the label, if any, of a force assignment.

Format: q <= force '1';

Parameters:

assignment (SignalForceAssignment) – The force assignment.

Return type:

None

DepartSignalForceAssignment(assignment)[source]

Write the semicolon ending a force assignment.

Parameters:

assignment (SignalForceAssignment) – The force assignment.

Return type:

None

VisitSignalReleaseAssignment(assignment)[source]

Write the label, if any, of a release assignment.

Format: q <= release;

Parameters:

assignment (SignalReleaseAssignment) – The release assignment.

Return type:

None

DepartSignalReleaseAssignment(assignment)[source]

Write the reserved word release and the semicolon ending a release assignment.

Parameters:

assignment (SignalReleaseAssignment) – The release assignment.

Return type:

None

VisitSequentialReportStatement(statement)[source]

Write the label, if any, of a report statement.

Format: report "done" severity note;

Parameters:

statement (SequentialReportStatement) – The report statement.

Return type:

None

DepartSequentialReportStatement(statement)[source]

Write the semicolon ending a report statement.

Parameters:

statement (SequentialReportStatement) – The report statement.

Return type:

None

VisitSequentialAssertStatement(assertion)[source]

Write the label, if any, and the reserved word assert of an assertion.

Format: assert count < 8 report "overflow" severity error;

Parameters:

assertion (SequentialAssertStatement) – The assertion.

Return type:

None

DepartSequentialAssertStatement(assertion)[source]

Write the semicolon ending an assertion.

Parameters:

assertion (SequentialAssertStatement) – The assertion.

Return type:

None

VisitNullStatement(statement)[source]

Write a null statement.

Format: null;

Parameters:

statement (NullStatement) – The null statement.

Return type:

None

VisitReturnStatement(statement)[source]

Write the label, if any, and the reserved word return of a return statement.

Format: return count;

Parameters:

statement (ReturnStatement) – The return statement.

Return type:

None

DepartReturnStatement(statement)[source]

Write the semicolon ending a return statement.

Parameters:

statement (ReturnStatement) – The return statement.

Return type:

None

VisitWaitStatement(statement)[source]

Write the label, if any, and the reserved word wait of a wait statement.

Format: wait on clk until clk = '1' for 10 ns;

Parameters:

statement (WaitStatement) – The wait statement.

Return type:

None

DepartWaitStatement(statement)[source]

Write the semicolon ending a wait statement.

Parameters:

statement (WaitStatement) – The wait statement.

Return type:

None

VisitThen(branch)[source]

Write the reserved word then of an if or elsif branch; its statements are indented.

Parameters:

branch (IfBranch | ElsifBranch) – The branch.

Return type:

None

VisitLoop(statement)[source]

Write the reserved word loop of a loop statement; its statements are indented.

Parameters:

statement (LoopStatement) – The loop statement.

Return type:

None

VisitIfStatement(statement)[source]

Write the label, if any, of an if statement; its branches follow.

Format: if count = 0 then … elsif … else … end if;

Parameters:

statement (IfStatement) – The if statement.

Return type:

None

DepartIfStatement(statement)[source]

Write the end of an if statement.

Parameters:

statement (IfStatement) – The if statement.

Return type:

None

VisitIfBranch(branch)[source]

Write the reserved word if of the if branch of an if statement.

Parameters:

branch (IfBranch) – The branch.

Return type:

None

DepartIfBranch(branch)[source]

Leave the statements of the if branch of an if statement.

Parameters:

branch (IfBranch) – The branch.

Return type:

None

VisitElsifBranch(branch)[source]

Write the reserved word elsif of an elsif branch of an if statement.

Parameters:

branch (ElsifBranch) – The branch.

Return type:

None

DepartElsifBranch(branch)[source]

Leave the statements of an elsif branch of an if statement.

Parameters:

branch (ElsifBranch) – The branch.

Return type:

None

VisitElseBranch(branch)[source]

Write the reserved word else of the else branch of an if statement; its statements are indented.

Parameters:

branch (ElseBranch) – The branch.

Return type:

None

DepartElseBranch(branch)[source]

Leave the statements of the else branch of an if statement.

Parameters:

branch (ElseBranch) – The branch.

Return type:

None

VisitCaseStatement(statement)[source]

Write the label, if any, and the reserved word case of a case statement; its alternatives are indented.

Format: case state is … when Idle => … end case;

Parameters:

statement (CaseStatement) – The case statement.

Return type:

None

DepartCaseStatement(statement)[source]

Write the end of a case statement.

Parameters:

statement (CaseStatement) – The case statement.

Return type:

None

VisitCase(case)[source]

Write the reserved word when of an alternative of a case statement.

Format: when 1 | 2 =>

Parameters:

case (Case) – The case alternative.

Return type:

None

DepartCase(case)[source]

Leave the statements of an alternative of a case statement.

Parameters:

case (Case) – The case alternative.

Return type:

None

VisitOthersCase(case)[source]

Write the reserved words when and others of the others alternative of a case statement.

Format: when others =>

Parameters:

case (OthersCase) – The case alternative.

Return type:

None

DepartOthersCase(case)[source]

Leave the statements of the others alternative of a case statement.

Parameters:

case (OthersCase) – The case alternative.

Return type:

None

VisitEndlessLoopStatement(statement)[source]

Write the label, if any, of a loop statement without iteration scheme.

Format: loop … end loop;

Parameters:

statement (EndlessLoopStatement) – The loop statement.

Return type:

None

DepartEndlessLoopStatement(statement)[source]

Write the end of a loop statement without iteration scheme.

Parameters:

statement (EndlessLoopStatement) – The loop statement.

Return type:

None

DepartAllInstantiationList(instantiationList)

Depart from an all instantiation list.

Parameters:

instantiationList (AllInstantiationList) – The instantiation list.

Return type:

None

DepartAnonymousType(declaration)

Depart from an incomplete type declaration.

Parameters:

declaration (AnonymousType) – The incomplete type declaration.

Return type:

None

DepartAssociationItem(item)

Depart from an association item, after its actual.

Parameters:

item (AssociationItem) – The association item.

Return type:

None

DepartBitStringLiteral(literal)

Depart from a bit string literal.

Parameters:

literal (BitStringLiteral) – The bit string literal.

Return type:

None

DepartCharacterLiteral(literal)

Depart from a character literal.

Parameters:

literal (CharacterLiteral) – The character literal.

Return type:

None

DepartConditionalExpression(expression)

Depart from a conditional expression of a conditional variable assignment, after its condition.

Parameters:

expression (ConditionalExpression) – The conditional expression.

Return type:

None

DepartConditionalWaveform(waveform)

Depart from a conditional waveform, after its condition.

Parameters:

waveform (ConditionalWaveform) – The conditional waveform.

Return type:

None

DepartConstrainedArraySubtypeSymbol(symbol)

Depart from a constrained array subtype symbol, after its index constraint.

Parameters:

symbol (ConstrainedArraySubtypeSymbol) – The constrained subtype symbol.

Return type:

None

DepartConstrainedRecordSubtypeSymbol(symbol)

Depart from a constrained record subtype symbol, after its record constraint.

Parameters:

symbol (ConstrainedRecordSubtypeSymbol) – The constrained subtype symbol.

Return type:

None

DepartConstrainedScalarSubtypeSymbol(symbol)

Depart from a constrained scalar subtype symbol, after its range constraint.

Parameters:

symbol (ConstrainedScalarSubtypeSymbol) – The constrained subtype symbol.

Return type:

None

DepartDocument(document)

Depart from a document, after its last design unit.

Parameters:

document (Document) – The document.

Return type:

None

DepartEntityAspectConfiguration(aspect)

Depart from an entity aspect naming a configuration, after its configuration name.

Parameters:

aspect (EntityAspectConfiguration) – The entity aspect.

Return type:

None

DepartEntityAspectEntity(aspect)

Depart from an entity aspect naming an entity, after its architecture name.

Parameters:

aspect (EntityAspectEntity) – The entity aspect.

Return type:

None

DepartEntityAspectOpen(aspect)

Depart from an open entity aspect.

Parameters:

aspect (EntityAspectOpen) – The entity aspect.

Return type:

None

DepartEnumerationLiteral(literal)

Depart from an enumeration literal.

Parameters:

literal (EnumerationLiteral) – The enumeration literal.

Return type:

None

DepartGenericConstantInterfaceItem(item)

Depart from a generic constant, after its default expression.

Parameters:

item (GenericConstantInterfaceItem) – The generic constant.

Return type:

None

DepartGenericFunctionInterfaceItem(item)

Depart from a generic function, after its return type.

Parameters:

item (GenericFunctionInterfaceItem) – The generic function.

Return type:

None

DepartGenericProcedureInterfaceItem(item)

Depart from a generic procedure, after its parameters.

Parameters:

item (GenericProcedureInterfaceItem) – The generic procedure.

Return type:

None

DepartGenericTypeInterfaceItem(item)

Depart from a generic type.

Parameters:

item (GenericTypeInterfaceItem) – The generic type.

Return type:

None

DepartIndexedAggregateElement(element)

Depart from an aggregate element chosen by an index, after its expression.

Parameters:

element (IndexedAggregateElement) – The aggregate element chosen by an index.

Return type:

None

DepartIndexedChoice(choice)

Depart from a choice given by a value, after its value.

Parameters:

choice (IndexedChoice) – The choice.

Return type:

None

DepartIndexedGenerateChoice(choice)

Depart from a case-generate choice given by a value, after its value.

Parameters:

choice (IndexedGenerateChoice) – The choice.

Return type:

None

DepartNamedAggregateElement(element)

Depart from an aggregate element chosen by a record element name, after its expression.

Parameters:

element (NamedAggregateElement) – The aggregate element chosen by a record element name.

Return type:

None

DepartNullLiteral(literal)

Depart from a null literal.

Parameters:

literal (NullLiteral) – The null literal.

Return type:

None

DepartNullStatement(statement)

Depart from a null statement.

Parameters:

statement (NullStatement) – The null statement.

Return type:

None

DepartOpenName(name)

Depart from the reserved word open.

Parameters:

name (OpenName) – The open name.

Return type:

None

DepartOthersAggregateElement(element)

Depart from the others element of an aggregate, after its expression.

Parameters:

element (OthersAggregateElement) – The others element of an aggregate.

Return type:

None

DepartOthersInstantiationList(instantiationList)

Depart from an others instantiation list.

Parameters:

instantiationList (OthersInstantiationList) – The instantiation list.

Return type:

None

DepartParameterConstantInterfaceItem(item)

Depart from a constant parameter, after its default expression.

Parameters:

item (ParameterConstantInterfaceItem) – The constant parameter.

Return type:

None

DepartParameterFileInterfaceItem(item)

Depart from a file parameter, after its subtype.

Parameters:

item (ParameterFileInterfaceItem) – The file parameter.

Return type:

None

DepartParameterSimpleSignalInterfaceItem(item)

Depart from a signal parameter with a mode, after its default expression.

Parameters:

item (ParameterSimpleSignalInterfaceItem) – The signal parameter.

Return type:

None

DepartParameterVariableInterfaceItem(item)

Depart from a variable parameter, after its default expression.

Parameters:

item (ParameterVariableInterfaceItem) – The variable parameter.

Return type:

None

DepartParameterViewSignalInterfaceItem(item)

Depart from a signal parameter with a mode view, after its mode view indication.

Parameters:

item (ParameterViewSignalInterfaceItem) – The signal parameter.

Return type:

None

DepartPortSimpleSignalInterfaceItem(item)

Depart from a port with a mode, after its default expression.

Parameters:

item (PortSimpleSignalInterfaceItem) – The port.

Return type:

None

DepartPortViewSignalInterfaceItem(item)

Depart from a port with a mode view, after its mode view indication.

Parameters:

item (PortViewSignalInterfaceItem) – The port.

Return type:

None

DepartQualifiedExpressionAllocation(allocation)

Depart from an allocation initialized by a qualified expression, after its qualified expression.

Parameters:

allocation (QualifiedExpressionAllocation) – The allocation initialized by a qualified expression.

Return type:

None

DepartRangeConstraint(symbol)

Depart from the range constraint of a subtype indication, after its range.

Parameters:

symbol (ConstrainedScalarSubtypeSymbol) – The constrained subtype symbol.

Return type:

None

DepartRangedAggregateElement(element)

Depart from an aggregate element chosen by a range, after its expression.

Parameters:

element (RangedAggregateElement) – The aggregate element chosen by a range.

Return type:

None

DepartRangedChoice(choice)

Depart from a choice given by a range, after its range.

Parameters:

choice (RangedChoice) – The choice.

Return type:

None

DepartRangedGenerateChoice(choice)

Depart from a case-generate choice given by a range, after its range.

Parameters:

choice (RangedGenerateChoice) – The choice.

Return type:

None

DepartSelectedExpression(expression)

Depart from a selected expression of a selected variable assignment, after its last choice.

Parameters:

expression (SelectedExpression) – The selected expression.

Return type:

None

DepartSelectedWaveform(waveform)

Depart from a selected waveform, after its last choice.

Parameters:

waveform (SelectedWaveform) – The selected waveform.

Return type:

None

DepartSimpleAggregateElement(element)

Depart from a positional aggregate element, after its expression.

Parameters:

element (SimpleAggregateElement) – The positional aggregate element.

Return type:

None

DepartSimpleModeViewElement(element)

Depart from an element of a mode view with a mode.

Parameters:

element (SimpleModeViewElement) – The mode view element.

Return type:

None

DepartSimpleName(name)

Depart from a simple name.

Parameters:

name (SimpleName) – The simple name.

Return type:

None

DepartSlicedName(name)

Depart from a sliced name, after its prefix.

Parameters:

name (SlicedName) – The sliced name.

Return type:

None

DepartStringLiteral(literal)

Depart from a string literal.

Parameters:

literal (StringLiteral) – The string literal.

Return type:

None

DepartSubtypeAllocation(allocation)

Depart from an allocation of a subtype, after its subtype.

Parameters:

allocation (SubtypeAllocation) – The allocation of a subtype.

Return type:

None

DepartSymbol(symbol)

Depart from a symbol, after its name.

Parameters:

symbol (Symbol) – The symbol.

Return type:

None

DepartWaveformElement(element)

Depart from a waveform element, after its delay.

Parameters:

element (WaveformElement) – The waveform element.

Return type:

None

classmethod GetMethodsWithAttributes(predicate=None)

Return the class’ methods that carry at least one matching attribute.

Parameters:

predicate (type[TAttr] | Iterable[type[TAttr]] | None) – Optional, an attribute class, an iterable of attribute classes, or None to accept every attribute.

Return type:

dict[Callable[..., Any], tuple[Attribute, ...]]

Returns:

Dictionary of methods and the matching attributes attached to them.

Raises:
  • ValueError – If an element of parameter ‘predicate’ is not a sub-class of Attribute.

  • ValueError – If parameter ‘predicate’ is neither an attribute class nor an iterable of those.

VisitAllName(name)

Visit a selected name with suffix all, before its prefix.

Parameters:

name (AllName) – The all name.

Return type:

None

VisitAttributeName(name)

Visit an attribute name, before its prefix.

Parameters:

name (AttributeName) – The attribute name.

Return type:

None

VisitBlockSpecification(configuration)

Visit the block specification of a block configuration, before its block name.

Parameters:

configuration (BlockConfiguration) – The block configuration.

Return type:

None

VisitConditionalExpression(expression)

Visit a conditional expression of a conditional variable assignment, before its value.

Parameters:

expression (ConditionalExpression) – The conditional expression.

Return type:

None

VisitConditionalWaveform(waveform)

Visit a conditional waveform, before its waveform.

Parameters:

waveform (ConditionalWaveform) – The conditional waveform.

Return type:

None

VisitConstrainedArraySubtypeSymbol(symbol)

Visit a constrained array subtype symbol, before its name.

Parameters:

symbol (ConstrainedArraySubtypeSymbol) – The constrained subtype symbol.

Return type:

None

VisitConstrainedRecordSubtypeSymbol(symbol)

Visit a constrained record subtype symbol, before its name.

Parameters:

symbol (ConstrainedRecordSubtypeSymbol) – The constrained subtype symbol.

Return type:

None

VisitConstrainedScalarSubtypeSymbol(symbol)

Visit a constrained scalar subtype symbol, before its name.

Parameters:

symbol (ConstrainedScalarSubtypeSymbol) – The constrained subtype symbol.

Return type:

None

VisitDocument(document)

Visit a document, before its first design unit.

Parameters:

document (Document) – The document.

Return type:

None

VisitForLoopStatement(statement)[source]

Write the label, if any, the reserved word for, the loop index and in of a for-loop statement.

Format: for i in 0 to 7 loop … end loop;

Parameters:

statement (ForLoopStatement) – The loop statement.

Return type:

None

VisitIndexedName(name)

Visit an indexed name, before its prefix.

Parameters:

name (IndexedName) – The indexed name.

Return type:

None

VisitInstantiationList(configuration)

Visit the instantiation list of a component configuration, before its first label.

Parameters:

configuration (ComponentConfiguration) – The component configuration.

Return type:

None

VisitNamedAggregateElement(element)

Visit an aggregate element chosen by a record element name, before its name.

Parameters:

element (NamedAggregateElement) – The aggregate element chosen by a record element name.

Return type:

None

VisitOthersSelectedExpression(expression)

Visit the others selected expression of a selected variable assignment, before its value.

Parameters:

expression (OthersSelectedExpression) – The selected expression.

Return type:

None

VisitOthersSelectedWaveform(waveform)

Visit the others selected waveform, before its waveform.

Parameters:

waveform (OthersSelectedWaveform) – The selected waveform.

Return type:

None

VisitParenthesisName(name)

Visit a name followed by a parenthesized association list, before its prefix.

Parameters:

name (ParenthesisName) – The parenthesis name.

Return type:

None

VisitQualifiedExpression(expression)

Visit a qualified expression, before its subtype.

Parameters:

expression (QualifiedExpression) – The qualified expression.

Return type:

None

VisitRangedAggregateElement(element)

Visit an aggregate element chosen by a range, before its range.

Parameters:

element (RangedAggregateElement) – The aggregate element chosen by a range.

Return type:

None

VisitRangedChoice(choice)

Visit a choice given by a range, before its range.

Parameters:

choice (RangedChoice) – The choice.

Return type:

None

VisitRangedGenerateChoice(choice)

Visit a case-generate choice given by a range, before its range.

Parameters:

choice (RangedGenerateChoice) – The choice.

Return type:

None

VisitSelectedExpression(expression)

Visit a selected expression of a selected variable assignment, before its value.

Parameters:

expression (SelectedExpression) – The selected expression.

Return type:

None

VisitSelectedName(name)

Visit a selected name, before its prefix.

Parameters:

name (SelectedName) – The selected name.

Return type:

None

VisitSelectedWaveform(waveform)

Visit a selected waveform, before its waveform.

Parameters:

waveform (SelectedWaveform) – The selected waveform.

Return type:

None

VisitSimpleAggregateElement(element)

Visit a positional aggregate element, before its expression.

Parameters:

element (SimpleAggregateElement) – The positional aggregate element.

Return type:

None

VisitSymbol(symbol)

Visit a symbol, before its name.

Parameters:

symbol (Symbol) – The symbol.

Return type:

None

VisitTypeConversion(conversion)

Visit a type conversion, before its target subtype.

Parameters:

conversion (TypeConversion) – The type conversion.

Return type:

None

VisitWaveformElement(element)

Visit a waveform element, before its value.

Parameters:

element (WaveformElement) – The waveform element.

Return type:

None

__getstate__()

Return the object’s state for pickling, collecting every slot of the class hierarchy.

Return type:

dict[str, Any]

Returns:

Dictionary of slot names and their values.

Raises:

ExtendedTypeError – If a slot was never assigned, so it has no value to serialize.

__new__(**kwargs)
__setstate__(state)

Restore the object’s state from unpickling, requiring exactly the slots of the class hierarchy.

Parameters:

state (dict[str, Any]) – Dictionary of slot names and their values.

Raises:

ExtendedTypeError – If the given state misses a slot or carries an unexpected one.

Return type:

None

DepartForLoopStatement(statement)[source]

Write the end of a for-loop statement.

Parameters:

statement (ForLoopStatement) – The loop statement.

Return type:

None

VisitWhileLoopStatement(statement)[source]

Write the label, if any, and the reserved word while of a while-loop statement.

Format: while count < 8 loop … end loop;

Parameters:

statement (WhileLoopStatement) – The loop statement.

Return type:

None

DepartWhileLoopStatement(statement)[source]

Write the end of a while-loop statement.

Parameters:

statement (WhileLoopStatement) – The loop statement.

Return type:

None

VisitNextStatement(statement)[source]

Write the label, if any, and the reserved word next of a next statement.

Format: next when skip;

The model keeps no loop label, so none is written.

Parameters:

statement (NextStatement) – The next statement.

Return type:

None

DepartNextStatement(statement)[source]

Write the semicolon ending a next statement.

Parameters:

statement (NextStatement) – The next statement.

Return type:

None

VisitExitStatement(statement)[source]

Write the label, if any, and the reserved word exit of an exit statement.

Format: exit when done;

The model keeps no loop label, so none is written.

Parameters:

statement (ExitStatement) – The exit statement.

Return type:

None

DepartExitStatement(statement)[source]

Write the semicolon ending an exit statement.

Parameters:

statement (ExitStatement) – The exit statement.

Return type:

None