13 from typing
import Dict, Optional
15 from .types
import BundlePort
16 from .
import esiCppAccel
as cpp
23 """A connection to an ESI accelerator."""
25 def __init__(self, platform: str, connection_str: str):
26 self.
cpp_accelcpp_accel = cpp.AcceleratorConnection(ctxt, platform, connection_str)
29 """Get and parse the accelerator manifest."""
43 """Represents either the top level or an instance of a hardware module."""
45 def __init__(self, parent: Optional[
"HWModule"], cpp_hwmodule: cpp.HWModule):
50 def children(self) -> Dict[cpp.AppID, "Instance"]:
53 for name, inst
in self.
cpp_hwmodulecpp_hwmodule.children.items()
57 def ports(self) -> Dict[cpp.AppID, BundlePort]:
60 for name, port
in self.
cpp_hwmodulecpp_hwmodule.ports.items()
65 """Subclass of `HWModule` which represents a submodule instance. Adds an
66 AppID, which the top level doesn't have or need."""
68 def __init__(self, parent: Optional[
"HWModule"], cpp_instance: cpp.Instance):
69 super().
__init__(parent, cpp_instance)
70 self.
cpp_hwmodulecpp_hwmodule: cpp.Instance = cpp_instance
73 def id(self) -> cpp.AppID:
78 """Root of the accelerator design hierarchy."""
80 def __init__(self, cpp_accelerator: cpp.Accelerator):
81 super().
__init__(
None, cpp_accelerator)
cpp.MMIO get_service_mmio(self)
def __init__(self, str platform, str connection_str)
cpp.SysInfo sysinfo(self)
cpp.Manifest manifest(self)
"Accelerator" build_accelerator(self)
def __init__(self, cpp.Accelerator cpp_accelerator)
Dict[cpp.AppID, BundlePort] ports(self)
Dict[cpp.AppID, "Instance"] children(self)
def __init__(self, Optional["HWModule"] parent, cpp.HWModule cpp_hwmodule)
def __init__(self, Optional["HWModule"] parent, cpp.Instance cpp_instance)