Skip to content

Commit

Permalink
[QUBO] Solution readout via spikeIO for multi-chip support (lava-nc#820)
Browse files Browse the repository at this point in the history
* 32bit receiver

* linting

---------

Co-authored-by: Risbud, Sumedh <[email protected]>
  • Loading branch information
phstratmann and srrisbud authored Jan 26, 2024
1 parent 5aeac66 commit 4517418
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion src/lava/proc/receiver/process.py
Original file line number Diff line number Diff line change
@@ -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/

Expand Down Expand Up @@ -30,3 +30,30 @@ 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)

0 comments on commit 4517418

Please sign in to comment.