Module moore_svlog::typeck [−][src]
Expand description
Type checking and computation.
This module performs type computation and type checking of a SystemVerilog
design. A large portion is dedicated to expression typing, which is the most
involved angle. However, there are also other bits and pieces that compute
types for things like ports or instances. Finally, there are functions that
map AST nodes of type kind to actual UnpackedType
s.
Expression type checking occurs in the following sequence, and through the following queries:
self_determined_type
evaluates an expression to its self-determined type, or returnsNone
if the expression requires context information to determine a type. There is alsoneed_self_determined_type
which issues a diagnostic in the latter case.operation_type
determines if an expression has an internal type under which its operation takes place. E.g. comparisons have the expanded arg. types as operation type. There is alsoneed_operation_type
.type_context
determines what type the parent of an expression imposes on the expression. In an assignment for example, this would be the left hand side’s type impose on the right hand side, and vice versa. This is the main driver for casting operations, and the rest of the compiler expects the type context to fully line up with the parent’s needs.type_of_expr
computes the type of an expression before casting.cast_type
computes the final type of an expression, ensuring that its type as returned bytype_of_expr
is castable, and deriving a cast sequenceto the
type_context`.
Structs
A type resulting from a sequence of casts.
Enums
A cast operation.
A type context imposed by a node’s surroundings.