CIRCT 24.0.0git
Loading...
Searching...
No Matches
esiaccel.types.SIntType Class Reference
Inheritance diagram for esiaccel.types.SIntType:
Collaboration diagram for esiaccel.types.SIntType:

Public Member Functions

 __init__ (self, str id, int width)
Tuple[bool, Optional[str]] is_valid (self, obj)
str __str__ (self)
bytearray serialize (self, int obj)
Tuple[int, bytearray] deserialize (self, bytearray data)
Public Member Functions inherited from esiaccel.types.IntType
 __init__ (self, str id, int width)
Public Member Functions inherited from esiaccel.types.ESIType
 __init__ (self, str id)
 wrap_cpp (cls, cpp.Type cpp_type)
str id (self)
Tuple[bool, Optional[str]] supports_host (self)
int bit_width (self)
int max_size (self)
int __hash__ (self)
bool __eq__ (self, other)
str __str__ (self)

Additional Inherited Members

Public Attributes inherited from esiaccel.types.ESIType
 cpp_type = cpp_type
str id
Protected Member Functions inherited from esiaccel.types.ESIType
 _init_from_cpp (self, cpp.Type cpp_type)

Detailed Description

Definition at line 267 of file types.py.

Constructor & Destructor Documentation

◆ __init__()

esiaccel.types.SIntType.__init__ ( self,
str id,
int width )

Definition at line 269 of file types.py.

References esiaccel.types.ESIType._init_from_cpp().

Member Function Documentation

◆ __str__()

str esiaccel.types.SIntType.__str__ ( self)

Definition at line 283 of file types.py.

◆ deserialize()

Tuple[int, bytearray] esiaccel.types.SIntType.deserialize ( self,
bytearray data )
Convert a bytearray to a Python object. Return the object and the
leftover bytes.

Reimplemented from esiaccel.types.ESIType.

Definition at line 289 of file types.py.

References esiaccel.types.ESIType.bit_width(), esiaccel.types.UIntType.bit_width, esiaccel.types.BitsType.max_size, max_size, and esiaccel.types.UIntType.max_size.

◆ is_valid()

Tuple[bool, Optional[str]] esiaccel.types.SIntType.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 from esiaccel.types.ESIType.

Definition at line 272 of file types.py.

References esiaccel.types.ESIType.bit_width(), and esiaccel.types.UIntType.bit_width.

◆ serialize()

bytearray esiaccel.types.SIntType.serialize ( self,
int obj )
Convert a Python object to a bytearray.

Reimplemented from esiaccel.types.ESIType.

Definition at line 286 of file types.py.


The documentation for this class was generated from the following file: