From 3081fc90256ece01d96817230ab6c9b6c475409b Mon Sep 17 00:00:00 2001 From: "Stratmann, Philipp" Date: Wed, 13 Dec 2023 15:03:21 +0100 Subject: [PATCH 1/2] 32bit receiver --- src/lava/proc/receiver/process.py | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/src/lava/proc/receiver/process.py b/src/lava/proc/receiver/process.py index 52e2679a4..7ece4b6d2 100644 --- a/src/lava/proc/receiver/process.py +++ b/src/lava/proc/receiver/process.py @@ -1,4 +1,4 @@ -# Copyright (C) 2022 Intel Corporation +# Copyright (C) 2022-2023 Intel Corporation # SPDX-License-Identifier: BSD-3-Clause # See: https://spdx.org/licenses/ @@ -30,3 +30,29 @@ def __init__(self, *, super().__init__(shape=shape, name=name, log_config=log_config) self.a_in = InPort(shape=shape) self.payload = Var(shape=shape, init=0) + +class Receiver32Bit(AbstractProcess): + """Process saving input messages as a payload variable. For up to 32bit + payload. + + Parameters + ---------- + shape : tuple(int) + Shape of the population of process units. + name : str + Name of the Process. Default is 'Process_ID', where ID is an + integer value that is determined automatically. + log_config : LogConfig + Configuration options for logging. + """ + + def __init__(self, *, + shape: ty.Tuple[int, ...] = (1,), + name: ty.Optional[str] = None, + log_config: ty.Optional[LogConfig] = None) -> None: + super().__init__(shape=shape, name=name, log_config=log_config) + self.a_in = InPort(shape=shape) + + # Total payload = (payload_first_byte << 24) + payload_last_bytes + self.payload_last_bytes = Var(shape=shape, init=0) + self.payload_first_byte = Var(shape=shape, init=0) From 4ee79561cadd234416475bb89cea206ccf5f4b1f Mon Sep 17 00:00:00 2001 From: "Stratmann, Philipp" Date: Tue, 23 Jan 2024 15:13:47 +0100 Subject: [PATCH 2/2] linting --- src/lava/proc/receiver/process.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lava/proc/receiver/process.py b/src/lava/proc/receiver/process.py index 7ece4b6d2..d49b4e92f 100644 --- a/src/lava/proc/receiver/process.py +++ b/src/lava/proc/receiver/process.py @@ -31,6 +31,7 @@ def __init__(self, *, self.a_in = InPort(shape=shape) self.payload = Var(shape=shape, init=0) + class Receiver32Bit(AbstractProcess): """Process saving input messages as a payload variable. For up to 32bit payload.