Skip to content

soc

zeus.device.soc

Abstraction layer for SoC devices.

The main function of this module is get_soc, which returns a SoC Manager object specific to the platform.

get_soc

get_soc()

Initialize and return a singleton monolithic SoC monitoring object.

The function returns a SoC management object that aims to abstract underlying SoC monitoring functionalities.

Currently supported SoC devices
  • Apple Silicon

If no SoC monitor object can be initialized, a ZeusSoCInitError exception will be raised.

Source code in zeus/device/soc/__init__.py
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
def get_soc() -> SoC:
    """Initialize and return a singleton monolithic SoC monitoring object.

    The function returns a SoC management object that aims to abstract underlying SoC monitoring
    functionalities.

    Currently supported SoC devices:
        - Apple Silicon

    If no SoC monitor object can be initialized, a `ZeusSoCInitError` exception will be raised.
    """
    global _soc
    if _soc is not None:
        return _soc

    # --- Apple Silicon ---
    if apple_silicon_is_available():
        with suppress(ZeusAppleInitError):
            _soc = AppleSilicon()

    # For additional SoC's, add more initialization attempts.

    if _soc is None:
        raise ZeusSoCInitError("No observable SoC was found on the current machine.")
    return _soc