Skip to content

Base Type

Basic Types.

DOCME

  • :any:Type - Base Class for all Types
  • :any:AScalarType - Base Class for all Single Value Types
  • :any:VecType - Base Class for all vector-mapped Scalars.
  • :any:CompositeType - Base class for all assembling Types.

BaseType

Bases: Object

Base Class for all Types.

doc property

doc

Documentation.

bits property

bits

Size in Bits.

This method has to be overwritten.

is_connectable

is_connectable(other)

Check For Valid Connection To other.

This method has to be overwritten.

cast

cast(other)

How to cast an input of type self from a value of type other.

self = cast(other)

__getitem__ abstractmethod

__getitem__(slice_)

Return Sliced Variant.

BaseScalarType

Bases: BaseType

Base Type For All Native Types.

AScalarType

Bases: BaseScalarType, Light

Abstract Type For All Native Types.

bits property

bits

Size in Bits.

check

check(value, what='Value')

Check if value can be handled by type`.

import ucdp as u atype = u.AScalarType() atype.check(1) 1

encode

encode(value, usedefault=False)

Encode Value.

import ucdp as u atype = u.AScalarType() atype.encode(1) 1

get_hex

get_hex(value=None)

Return Hex Value.

import ucdp as u u.AScalarType().get_hex()

__getitem__

__getitem__(slice_)

Return Sliced Variant.

import ucdp as u u.AScalarType()[4] Traceback (most recent call last): ... ValueError: Cannot slice (4) from AScalarType()

AVecType

Bases: AScalarType

Base Class for all Vector Types.

slice_ property

slice_

Slice.

ACompositeType

Bases: BaseType

Base Class For All Composite Types.