SpiNNFrontEndCommon 7.1.1
Common support code for user-facing front end systems.
Loading...
Searching...
No Matches
eieio.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2019 The University of Manchester
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * https://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
20
21#ifndef INCLUDE_FEC_EIEIO_H
22#define INCLUDE_FEC_EIEIO_H
23
24#include <common-typedefs.h>
25
39
54
55// Bitfields go from LSB to MSB; SpiNNaker is little-endian, and making them all
56// use uint16_t as a base type means that we know they'll all be in the same
57// memory slot (which they will fit into).
58//
59// https://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.faqs/ka10202.html
60// https://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491e/Babjddhe.html
61//
62// THIS IS NOT PORTABLE TO NON-SPINNAKER!
63
66 struct {
68 uint16_t count : 8;
69 // Padding
70 uint16_t : 2;
72 uint16_t packet_type : 2;
74 uint16_t payload_is_timestamp : 1;
76 uint16_t apply_payload_prefix : 1;
79 uint16_t prefix_upper : 1;
81 uint16_t apply_prefix : 1;
82 };
83 struct {
85 uint16_t packet_command : 14;
87 uint16_t packet_class : 2;
88 };
89 uint16_t overall_value;
90};
91
103
105typedef enum {
106 PREFIX_TYPE_LOWER_HALF_WORD,
107 PREFIX_TYPE_UPPER_HALF_WORD
109
110#endif //INCLUDE_FEC_EIEIO_H
Data type definitions for SpiNNaker Neuron-modelling.
eieio_bit_masks
Definition eieio.h:44
@ APPLY_PAYLOAD_PREFIX_MASK
eieio_header_bitfields::apply_payload_prefix
Definition eieio.h:47
@ PACKET_CLASS_MASK
eieio_header_bitfields::packet_class
Definition eieio.h:51
@ COUNT_MASK
eieio_header_bitfields::count
Definition eieio.h:50
@ PREFIX_UPPER_MASK
eieio_header_bitfields::prefix_upper
Definition eieio.h:46
@ PACKET_TYPE_MASK
eieio_header_bitfields::packet_type
Definition eieio.h:49
@ PAYLOAD_IS_TIMESTAMP_MASK
eieio_header_bitfields::payload_is_timestamp
Definition eieio.h:48
@ PACKET_COMMAND_MASK
eieio_header_bitfields::packet_command
Definition eieio.h:52
@ APPLY_PREFIX_MASK
eieio_header_bitfields::apply_prefix
Definition eieio.h:45
eieio_prefix_types
The EIEIO prefix types.
Definition eieio.h:105
eieio_bit_offsets
Definition eieio.h:29
@ PACKET_CLASS
eieio_header_bitfields::packet_class
Definition eieio.h:36
@ COUNT
eieio_header_bitfields::count
Definition eieio.h:35
@ PAYLOAD_IS_TIMESTAMP
eieio_header_bitfields::payload_is_timestamp
Definition eieio.h:33
@ PACKET_COMMAND
eieio_header_bitfields::packet_command
Definition eieio.h:37
@ PACKET_TYPE
eieio_header_bitfields::packet_type
Definition eieio.h:34
@ APPLY_PAYLOAD_PREFIX
eieio_header_bitfields::apply_payload_prefix
Definition eieio.h:32
@ APPLY_PREFIX
eieio_header_bitfields::apply_prefix
Definition eieio.h:30
@ PREFIX_UPPER
eieio_header_bitfields::prefix_upper
Definition eieio.h:31
eieio_data_message_types
The EIEIO basic message types.
Definition eieio.h:93
@ KEY_16_BIT
Message is just a key, 16 bits long.
Definition eieio.h:95
@ KEY_32_BIT
Message is just a key, 32 bits long.
Definition eieio.h:99
@ KEY_PAYLOAD_32_bIT
Message is a key and a payload, each 32 bits long.
Definition eieio.h:101
@ KEY_PAYLOAD_16_BIT
Message is a key and a payload, each 16 bits long.
Definition eieio.h:97
The header of an EIEIO packet.
Definition eieio.h:65
static bool apply_prefix
If a prefix should be applied.