CIRCT 22.0.0git
|
Public Member Functions | |
__init__ (self, str id) | |
wrap_cpp (cls, cpp.Type cpp_type) | |
Tuple[bool, Optional[str]] | supports_host (self) |
Tuple[bool, Optional[str]] | is_valid (self, obj) |
int | bit_width (self) |
int | max_size (self) |
bytearray | serialize (self, obj) |
Tuple[object, bytearray] | deserialize (self, bytearray data) |
str | __str__ (self) |
Public Attributes | |
cpp_type | |
Protected Member Functions | |
_init_from_cpp (self, cpp.Type cpp_type) | |
esiaccel.types.ESIType.__init__ | ( | self, | |
str | id | ||
) |
Reimplemented in esiaccel.types.VoidType, esiaccel.types.ArrayType, esiaccel.types.BitsType, esiaccel.types.IntType, esiaccel.types.UIntType, esiaccel.types.SIntType, and esiaccel.types.StructType.
Definition at line 45 of file types.py.
References esiaccel.types.ArrayType._init_from_cpp(), esiaccel.types.StructType._init_from_cpp(), and esiaccel.types.ESIType._init_from_cpp().
str esiaccel.types.ESIType.__str__ | ( | self | ) |
Reimplemented in esiaccel.types.UIntType, and esiaccel.types.SIntType.
Definition at line 95 of file types.py.
References esiaccel.types.ESIType.cpp_type.
|
protected |
Initialize instance attributes from a C++ type object.
Reimplemented in esiaccel.types.ArrayType, and esiaccel.types.StructType.
Definition at line 55 of file types.py.
Referenced by esiaccel.types.ESIType.__init__(), esiaccel.types.VoidType.__init__(), esiaccel.types.ArrayType.__init__(), esiaccel.types.BitsType.__init__(), esiaccel.types.IntType.__init__(), esiaccel.types.UIntType.__init__(), esiaccel.types.SIntType.__init__(), and esiaccel.types.StructType.__init__().
int esiaccel.types.ESIType.bit_width | ( | self | ) |
Size of this type, in bits. Negative for unbounded types.
Reimplemented in esiaccel.types.VoidType, esiaccel.types.BitsType, esiaccel.types.IntType, esiaccel.types.StructType, and esiaccel.types.ArrayType.
Definition at line 74 of file types.py.
Referenced by esiaccel.types.UIntType.is_valid(), esiaccel.types.SIntType.is_valid(), esiaccel.types.ESIType.max_size(), and esiaccel.types.ESIType.supports_host().
Tuple[object, bytearray] esiaccel.types.ESIType.deserialize | ( | self, | |
bytearray | data | ||
) |
Convert a bytearray to a Python object. Return the object and the leftover bytes.
Reimplemented in esiaccel.types.VoidType, esiaccel.types.BitsType, esiaccel.types.UIntType, esiaccel.types.SIntType, esiaccel.types.StructType, and esiaccel.types.ArrayType.
Tuple[bool, Optional[str]] esiaccel.types.ESIType.is_valid | ( | self, | |
obj | |||
) |
Is a Python object compatible with HW type? Returns either '(True, None)' if it is, or '(False, reason)' if it is not.
Reimplemented in esiaccel.types.VoidType, esiaccel.types.BitsType, esiaccel.types.UIntType, esiaccel.types.SIntType, esiaccel.types.StructType, and esiaccel.types.ArrayType.
int esiaccel.types.ESIType.max_size | ( | self | ) |
Maximum size of a value of this type, in bytes.
Definition at line 79 of file types.py.
References esiaccel.types.ESIType.bit_width(), esiaccel.types.VoidType.bit_width(), esiaccel.types.BitsType.bit_width(), esiaccel.types.IntType.bit_width(), esiaccel.types.StructType.bit_width(), and esiaccel.types.ArrayType.bit_width().
Referenced by esiaccel.types.BitsType.deserialize(), esiaccel.types.UIntType.deserialize(), esiaccel.types.SIntType.deserialize(), and esiaccel.types.BitsType.is_valid().
bytearray esiaccel.types.ESIType.serialize | ( | self, | |
obj | |||
) |
Convert a Python object to a bytearray.
Reimplemented in esiaccel.types.UIntType, esiaccel.types.SIntType, esiaccel.types.ArrayType, esiaccel.types.VoidType, esiaccel.types.StructType, and esiaccel.types.BitsType.
Tuple[bool, Optional[str]] esiaccel.types.ESIType.supports_host | ( | self | ) |
Does this type support host communication via Python? Returns either '(True, None)' if it is, or '(False, reason)' if it is not.
Definition at line 60 of file types.py.
References esiaccel.types.ESIType.bit_width(), esiaccel.types.VoidType.bit_width(), esiaccel.types.BitsType.bit_width(), esiaccel.types.IntType.bit_width(), esiaccel.types.StructType.bit_width(), and esiaccel.types.ArrayType.bit_width().
esiaccel.types.ESIType.wrap_cpp | ( | cls, | |
cpp.Type | cpp_type | ||
) |
Wrap a C++ ESI type with its corresponding Python ESI Type.
Definition at line 49 of file types.py.
References esiaccel.types.BundlePort.__new__().
esiaccel.types.ESIType.cpp_type |
Definition at line 57 of file types.py.
Referenced by esiaccel.types.ESIType.__str__(), esiaccel.types.BitsType.bit_width(), esiaccel.types.IntType.bit_width(), esiaccel.types.StructType.deserialize(), and esiaccel.types.StructType.serialize().