@science-corporation/synapse 2.0.0 → 2.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -0
- package/dist/api/api.d.ts +5047 -2381
- package/dist/api/api.js +12917 -6374
- package/dist/api/api.js.map +1 -1
- package/dist/api/proto.json +969 -451
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -5
- package/dist/config.js.map +1 -1
- package/dist/device.d.ts +0 -1
- package/dist/device.d.ts.map +1 -1
- package/dist/device.js +1 -5
- package/dist/device.js.map +1 -1
- package/dist/nodes/index.d.ts +0 -2
- package/dist/nodes/index.d.ts.map +1 -1
- package/dist/nodes/index.js +1 -5
- package/dist/nodes/index.js.map +1 -1
- package/package.json +3 -2
- package/src/api/api.d.ts +5047 -2381
- package/src/api/api.js +13466 -6537
- package/src/api/proto.json +969 -451
- package/src/config.ts +1 -5
- package/src/device.ts +1 -5
- package/src/nodes/index.ts +0 -2
- package/synapse-api/README.md +1 -1
- package/synapse-api/api/app.proto +55 -0
- package/synapse-api/api/channel.proto +15 -1
- package/synapse-api/api/datatype.proto +97 -1
- package/synapse-api/api/device.proto +65 -0
- package/synapse-api/api/node.proto +19 -18
- package/synapse-api/api/nodes/application.proto +24 -0
- package/synapse-api/api/nodes/broadband_source.proto +1 -0
- package/synapse-api/api/nodes/disk_writer.proto +17 -0
- package/synapse-api/api/nodes/optical_stimulation.proto +29 -0
- package/synapse-api/api/nodes/signal_config.proto +2 -0
- package/synapse-api/api/performance.proto +29 -0
- package/synapse-api/api/query.proto +8 -0
- package/synapse-api/api/status.proto +6 -1
- package/synapse-api/api/synapse.proto +8 -31
- package/synapse-api/api/tap.proto +35 -0
- package/synapse-api/api/time.proto +53 -0
- package/dist/demo.d.ts +0 -2
- package/dist/demo.d.ts.map +0 -1
- package/dist/demo.js +0 -285
- package/dist/demo.js.map +0 -1
- package/dist/nodes/stream_in.d.ts +0 -15
- package/dist/nodes/stream_in.d.ts.map +0 -1
- package/dist/nodes/stream_in.js +0 -66
- package/dist/nodes/stream_in.js.map +0 -1
- package/dist/nodes/stream_out.d.ts +0 -23
- package/dist/nodes/stream_out.d.ts.map +0 -1
- package/dist/nodes/stream_out.js +0 -105
- package/dist/nodes/stream_out.js.map +0 -1
- package/src/demo.ts +0 -325
- package/src/nodes/stream_in.ts +0 -78
- package/src/nodes/stream_out.ts +0 -109
- package/synapse-api/api/nodes/stream_in.proto +0 -14
- package/synapse-api/api/nodes/stream_out.proto +0 -42
package/src/config.ts
CHANGED
|
@@ -8,8 +8,6 @@ import SpectralFilter from "./nodes/spectral_filter";
|
|
|
8
8
|
import SpikeBinner from "./nodes/spike_binner";
|
|
9
9
|
import SpikeDetector from "./nodes/spike_detector";
|
|
10
10
|
import SpikeSource from "./nodes/spike_source";
|
|
11
|
-
import StreamIn from "./nodes/stream_in";
|
|
12
|
-
import StreamOut from "./nodes/stream_out";
|
|
13
11
|
import { Status, StatusCode } from "./utils/status";
|
|
14
12
|
|
|
15
13
|
type Connection = [number, number];
|
|
@@ -21,9 +19,7 @@ const kNodeTypeObjectMap = {
|
|
|
21
19
|
[synapse.NodeType.kOpticalStimulation]: OpticalStimulation,
|
|
22
20
|
[synapse.NodeType.kSpectralFilter]: SpectralFilter,
|
|
23
21
|
[synapse.NodeType.kSpikeBinner]: SpikeBinner,
|
|
24
|
-
[synapse.NodeType.kSpikeDetector]: SpikeDetector
|
|
25
|
-
[synapse.NodeType.kStreamIn]: StreamIn,
|
|
26
|
-
[synapse.NodeType.kStreamOut]: StreamOut,
|
|
22
|
+
[synapse.NodeType.kSpikeDetector]: SpikeDetector
|
|
27
23
|
};
|
|
28
24
|
|
|
29
25
|
class Config {
|
package/src/device.ts
CHANGED
|
@@ -11,7 +11,6 @@ const kSynapseService = "synapse.SynapseDevice";
|
|
|
11
11
|
class Device {
|
|
12
12
|
rpc: any | null = null;
|
|
13
13
|
channel: Channel | null = null;
|
|
14
|
-
sockets: synapse.INodeSocket[] = [];
|
|
15
14
|
|
|
16
15
|
constructor(public uri: string) {
|
|
17
16
|
const { status, client } = create(protos, kSynapseService)(uri, credentials.createInsecure());
|
|
@@ -48,8 +47,6 @@ class Device {
|
|
|
48
47
|
} else if (!res) {
|
|
49
48
|
reject(new Status(err.code, "failed to get device info: " + err.message));
|
|
50
49
|
} else {
|
|
51
|
-
const { sockets } = res.status;
|
|
52
|
-
this.sockets = sockets || [];
|
|
53
50
|
resolve({ status: new Status(), response: res });
|
|
54
51
|
}
|
|
55
52
|
});
|
|
@@ -168,11 +165,10 @@ class Device {
|
|
|
168
165
|
}
|
|
169
166
|
|
|
170
167
|
_handleStatusResponse(status: synapse.IStatus): Status {
|
|
171
|
-
const { code, message
|
|
168
|
+
const { code, message } = status;
|
|
172
169
|
if (code !== synapse.StatusCode.kOk) {
|
|
173
170
|
return fromDeviceStatus({ code, message });
|
|
174
171
|
} else {
|
|
175
|
-
this.sockets = sockets || [];
|
|
176
172
|
return new Status();
|
|
177
173
|
}
|
|
178
174
|
}
|
package/src/nodes/index.ts
CHANGED
|
@@ -6,7 +6,5 @@ export { default as SpectralFilter } from "./spectral_filter";
|
|
|
6
6
|
export { default as SpikeBinner } from "./spike_binner";
|
|
7
7
|
export { default as SpikeDetector } from "./spike_detector";
|
|
8
8
|
export { default as SpikeSource } from "./spike_source";
|
|
9
|
-
export { default as StreamIn } from "./stream_in";
|
|
10
|
-
export { default as StreamOut } from "./stream_out";
|
|
11
9
|
|
|
12
10
|
export type * from "../api/api";
|
package/synapse-api/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The Synapse Protocol defines a standard interface for interacting with a wide range of possible neural interface devices.
|
|
4
4
|
|
|
5
|
-
Synapse uses gRPC for its control plane API and
|
|
5
|
+
Synapse uses gRPC for its control plane API and Taps for streaming data. Read the full Synapse protocol docs [here](https://science.xyz/docs/d/synapse/index).
|
|
6
6
|
|
|
7
7
|
# Python Installation
|
|
8
8
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package synapse;
|
|
4
|
+
|
|
5
|
+
import "api/status.proto";
|
|
6
|
+
import "api/performance.proto";
|
|
7
|
+
import "api/device.proto";
|
|
8
|
+
|
|
9
|
+
import "google/protobuf/struct.proto";
|
|
10
|
+
|
|
11
|
+
message AppManifest {
|
|
12
|
+
// Your application name
|
|
13
|
+
string name = 1;
|
|
14
|
+
|
|
15
|
+
// JSON Schema for validating configuration
|
|
16
|
+
google.protobuf.Struct config_schema = 2;
|
|
17
|
+
|
|
18
|
+
// DeviceConfiguration describing the signal chain/device config
|
|
19
|
+
DeviceConfiguration device_config = 3;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
message PackageMetadata {
|
|
23
|
+
// the package name
|
|
24
|
+
// e.g. synapse-example-app_0.1.0_arm64.deb
|
|
25
|
+
string name = 1;
|
|
26
|
+
|
|
27
|
+
// The version of the package to be uploaded
|
|
28
|
+
string version = 2;
|
|
29
|
+
|
|
30
|
+
// Package size, in bytes
|
|
31
|
+
uint64 size = 3;
|
|
32
|
+
|
|
33
|
+
// sha256 of the package, for verification
|
|
34
|
+
string sha256_sum = 4;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message AppPackageChunk {
|
|
38
|
+
// The first chunk is the metadata, with subsequent chunks being the file to install
|
|
39
|
+
oneof data {
|
|
40
|
+
PackageMetadata metadata = 1;
|
|
41
|
+
bytes file_chunk = 2;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
message AppDeployResponse {
|
|
46
|
+
StatusCode status = 1;
|
|
47
|
+
|
|
48
|
+
// Informational messages
|
|
49
|
+
string message = 2;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
message AppPerformanceSummary {
|
|
53
|
+
uint64 timestamp_ns = 1;
|
|
54
|
+
repeated FunctionProfile function_profiles = 2;
|
|
55
|
+
}
|
|
@@ -2,8 +2,22 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package synapse;
|
|
4
4
|
|
|
5
|
+
enum ChannelType {
|
|
6
|
+
ELECTRODE = 0;
|
|
7
|
+
GPIO = 1;
|
|
8
|
+
}
|
|
9
|
+
|
|
5
10
|
message Channel {
|
|
6
11
|
uint32 id = 1;
|
|
7
12
|
uint32 electrode_id = 2;
|
|
8
13
|
uint32 reference_id = 3;
|
|
9
|
-
|
|
14
|
+
ChannelType type = 4;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
message ChannelRange {
|
|
18
|
+
ChannelType type = 1;
|
|
19
|
+
uint32 count = 2;
|
|
20
|
+
// Optional: for non-contiguous channels (e.g., GPIO), specifies which
|
|
21
|
+
// channel ids are included, in order. Empty for contiguous
|
|
22
|
+
repeated uint32 channel_ids = 3;
|
|
23
|
+
}
|
|
@@ -2,6 +2,9 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package synapse;
|
|
4
4
|
|
|
5
|
+
import "google/protobuf/struct.proto";
|
|
6
|
+
import "api/channel.proto";
|
|
7
|
+
|
|
5
8
|
enum DataType {
|
|
6
9
|
kDataTypeUnknown = 0;
|
|
7
10
|
kAny = 1;
|
|
@@ -10,4 +13,97 @@ enum DataType {
|
|
|
10
13
|
kTimestamps = 4;
|
|
11
14
|
kImage = 5;
|
|
12
15
|
kWaveforms = 6;
|
|
13
|
-
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
// A simple tensor with timestamped data
|
|
19
|
+
message Tensor {
|
|
20
|
+
// Timestamp in ns since the unix epoch
|
|
21
|
+
uint64 timestamp_ns = 1;
|
|
22
|
+
|
|
23
|
+
// Shape of the tensor
|
|
24
|
+
// The number of values should equal to the product of the dimensions
|
|
25
|
+
// e.g. shape = [2, 3] => 2 rows, 3 columns
|
|
26
|
+
repeated int32 shape = 2;
|
|
27
|
+
|
|
28
|
+
// Expected data type to parse out
|
|
29
|
+
enum DType {
|
|
30
|
+
DT_INVALID = 0;
|
|
31
|
+
DT_FLOAT = 1;
|
|
32
|
+
DT_DOUBLE = 2;
|
|
33
|
+
DT_UINT8 = 3;
|
|
34
|
+
DT_UINT16 = 4;
|
|
35
|
+
DT_UINT32 = 5;
|
|
36
|
+
DT_UINT64 = 6;
|
|
37
|
+
DT_INT8 = 7;
|
|
38
|
+
DT_INT16 = 8;
|
|
39
|
+
DT_INT32 = 9;
|
|
40
|
+
DT_INT64 = 10;
|
|
41
|
+
DT_BOOL = 11;
|
|
42
|
+
}
|
|
43
|
+
DType dtype = 3;
|
|
44
|
+
|
|
45
|
+
enum Endianness {
|
|
46
|
+
TENSOR_LITTLE_ENDIAN = 0;
|
|
47
|
+
TENSOR_BIG_ENDIAN = 1;
|
|
48
|
+
}
|
|
49
|
+
// We default to little because that covers most of the use cases
|
|
50
|
+
Endianness endianness = 4;
|
|
51
|
+
|
|
52
|
+
// Data, stored in a flat array, see shape to reconstruct
|
|
53
|
+
// e.g. shape: [1, 3] would be:
|
|
54
|
+
// [10.0, 20.0, 30.0]
|
|
55
|
+
bytes data = 5;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
// A sample of all of the channels at a specific timepoint
|
|
59
|
+
message BroadbandFrame {
|
|
60
|
+
// Monotonic timestamp when this frame was recorded based on the sampling rate
|
|
61
|
+
// At the start of a recording, the unix steady clock is recorded
|
|
62
|
+
// This timestamp is being calculated by
|
|
63
|
+
// start_timestamp_ns + (current_seq_num - start_seq_num) * 1e9 / sample_rate
|
|
64
|
+
uint64 timestamp_ns = 1;
|
|
65
|
+
|
|
66
|
+
// Monotonically increasing sequence number
|
|
67
|
+
// useful to detect missed or dropped frames
|
|
68
|
+
uint64 sequence_number = 2;
|
|
69
|
+
|
|
70
|
+
// The actual frame data, indexed by channel id
|
|
71
|
+
repeated sint32 frame_data = 3;
|
|
72
|
+
|
|
73
|
+
// Used for reconstructing multiple frames
|
|
74
|
+
uint32 sample_rate_hz = 4;
|
|
75
|
+
|
|
76
|
+
// When empty, all frame_data entries are electrode channels (legacy behavior).
|
|
77
|
+
// Describes contiguous ranges of channel types in frame_data, in order.
|
|
78
|
+
// Example:
|
|
79
|
+
// [{type: ELECTRODE}, count: 64, {type:GPIO, count:3, channel_ids:[0, 2, 5]}]
|
|
80
|
+
// This means frame_data[0..63] are electrodes, frame_data[64..66] are GPIO lines 0, 2, 5
|
|
81
|
+
repeated ChannelRange channel_ranges = 5;
|
|
82
|
+
|
|
83
|
+
// For legacy reasons, and syncing with other parts of the system, the current
|
|
84
|
+
// steady clock in unix time as reported by the system
|
|
85
|
+
// e.g. std::chrono::steady_clock::now().time_since_epoch()
|
|
86
|
+
uint64 unix_timestamp_ns = 6;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
message Timeseries {
|
|
90
|
+
// An identifier for the channel of data from which the timeseries was recorded.
|
|
91
|
+
uint32 id = 1;
|
|
92
|
+
|
|
93
|
+
// Represents a single sample of data at a specific timepoint
|
|
94
|
+
message Datapoint {
|
|
95
|
+
uint64 timestamp_ns = 1; // Timestamp of the recorded sample in ns since the unix epoch.
|
|
96
|
+
sint32 sample = 2; // The actual sample value.
|
|
97
|
+
}
|
|
98
|
+
repeated Datapoint datapoints = 2; // Collection of datapoints for this timeseries.
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// A tensor with associated metadata
|
|
102
|
+
message AnnotatedTensor {
|
|
103
|
+
// The tensor type
|
|
104
|
+
Tensor tensor = 1;
|
|
105
|
+
|
|
106
|
+
// Generic metadata associated with the tensor
|
|
107
|
+
// e.g. pipeline latencies
|
|
108
|
+
map<string, google.protobuf.Value> metadata = 2;
|
|
109
|
+
}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package synapse;
|
|
4
|
+
|
|
5
|
+
import "api/node.proto";
|
|
6
|
+
import "api/status.proto";
|
|
7
|
+
import "api/time.proto";
|
|
8
|
+
|
|
9
|
+
message Peripheral {
|
|
10
|
+
enum Type {
|
|
11
|
+
kUnknown = 0;
|
|
12
|
+
kBroadbandSource = 1;
|
|
13
|
+
kElectricalStimulation = 2;
|
|
14
|
+
kOpticalStimulation = 3;
|
|
15
|
+
kSpikeSource = 4;
|
|
16
|
+
}
|
|
17
|
+
string name = 1;
|
|
18
|
+
string vendor = 2;
|
|
19
|
+
uint32 peripheral_id = 3;
|
|
20
|
+
Type type = 4;
|
|
21
|
+
string address = 5;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
message DeviceInfo {
|
|
25
|
+
string name = 1;
|
|
26
|
+
string serial = 2;
|
|
27
|
+
uint32 synapse_version = 3;
|
|
28
|
+
uint32 firmware_version = 4;
|
|
29
|
+
Status status = 5;
|
|
30
|
+
repeated Peripheral peripherals = 6;
|
|
31
|
+
DeviceConfiguration configuration = 7;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
message DeviceConfiguration {
|
|
35
|
+
repeated NodeConfig nodes = 1;
|
|
36
|
+
repeated NodeConnection connections = 2;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
// Device settings that are configurable by the user
|
|
41
|
+
message DeviceSettings {
|
|
42
|
+
string name = 1;
|
|
43
|
+
TimeSource time_source = 2;
|
|
44
|
+
|
|
45
|
+
// If configurable, the desired FPGA clock frequency in hz
|
|
46
|
+
uint32 fpga_clock_freq_hz = 3;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
message GetSettingsQuery {
|
|
50
|
+
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
message GetSettingsResponse {
|
|
54
|
+
DeviceSettings settings = 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
message UpdateDeviceSettingsRequest {
|
|
58
|
+
// If a field isn't populated, it will not be changed
|
|
59
|
+
DeviceSettings settings = 1;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
message UpdateDeviceSettingsResponse {
|
|
63
|
+
Status status = 1;
|
|
64
|
+
DeviceSettings updated_settings = 2;
|
|
65
|
+
}
|
|
@@ -2,22 +2,22 @@ syntax = "proto3";
|
|
|
2
2
|
|
|
3
3
|
package synapse;
|
|
4
4
|
|
|
5
|
-
import "api/datatype.proto";
|
|
6
5
|
import "api/nodes/broadband_source.proto";
|
|
7
6
|
import "api/nodes/electrical_stimulation.proto";
|
|
8
7
|
import "api/nodes/optical_stimulation.proto";
|
|
9
8
|
import "api/nodes/spike_detector.proto";
|
|
10
9
|
import "api/nodes/spectral_filter.proto";
|
|
11
|
-
import "api/nodes/stream_out.proto";
|
|
12
|
-
import "api/nodes/stream_in.proto";
|
|
13
10
|
import "api/nodes/disk_writer.proto";
|
|
14
11
|
import "api/nodes/spike_source.proto";
|
|
15
12
|
import "api/nodes/spike_binner.proto";
|
|
13
|
+
import "api/nodes/application.proto";
|
|
16
14
|
|
|
17
15
|
enum NodeType {
|
|
18
16
|
kNodeTypeUnknown = 0;
|
|
19
|
-
kStreamIn = 1;
|
|
20
|
-
kStreamOut = 2;
|
|
17
|
+
// kStreamIn = 1;
|
|
18
|
+
// kStreamOut = 2;
|
|
19
|
+
reserved 1, 2;
|
|
20
|
+
|
|
21
21
|
kBroadbandSource = 3;
|
|
22
22
|
kElectricalStimulation = 4;
|
|
23
23
|
kOpticalStimulation = 5;
|
|
@@ -26,14 +26,18 @@ enum NodeType {
|
|
|
26
26
|
kSpectralFilter = 8;
|
|
27
27
|
kDiskWriter = 9;
|
|
28
28
|
kSpikeBinner = 10;
|
|
29
|
+
kApplication = 11;
|
|
29
30
|
}
|
|
30
31
|
|
|
31
32
|
message NodeConfig {
|
|
32
33
|
NodeType type = 1;
|
|
33
34
|
uint32 id = 2;
|
|
35
|
+
|
|
36
|
+
// StreamOutConfig stream_out = 3;
|
|
37
|
+
// StreamInConfig stream_in = 4;
|
|
38
|
+
reserved 3, 4;
|
|
39
|
+
|
|
34
40
|
oneof config {
|
|
35
|
-
StreamOutConfig stream_out = 3;
|
|
36
|
-
StreamInConfig stream_in = 4;
|
|
37
41
|
BroadbandSourceConfig broadband_source = 5;
|
|
38
42
|
ElectricalStimulationConfig electrical_stimulation = 6;
|
|
39
43
|
OpticalStimulationConfig optical_stimulation = 8;
|
|
@@ -42,17 +46,23 @@ message NodeConfig {
|
|
|
42
46
|
DiskWriterConfig disk_writer = 11;
|
|
43
47
|
SpikeSourceConfig spike_source = 12;
|
|
44
48
|
SpikeBinnerConfig spike_binner = 13;
|
|
49
|
+
ApplicationNodeConfig application = 14;
|
|
45
50
|
}
|
|
46
51
|
}
|
|
47
52
|
|
|
48
53
|
message NodeStatus {
|
|
49
54
|
NodeType type = 1;
|
|
50
55
|
uint32 id = 2;
|
|
56
|
+
|
|
57
|
+
// StreamOutStatus stream_out = 3;
|
|
58
|
+
// StreamInStatus stream_in = 5;
|
|
59
|
+
reserved 3, 5;
|
|
51
60
|
oneof status {
|
|
52
|
-
StreamOutStatus stream_out = 3;
|
|
53
61
|
BroadbandSourceStatus broadband_source = 4;
|
|
54
|
-
StreamInStatus stream_in = 5;
|
|
55
62
|
ElectricalStimulationStatus electrical_stimulation = 6;
|
|
63
|
+
ApplicationNodeStatus application = 7;
|
|
64
|
+
OpticalStimulationStatus optical_stimulation = 8;
|
|
65
|
+
DiskWriterStatus disk_writer = 10;
|
|
56
66
|
}
|
|
57
67
|
}
|
|
58
68
|
|
|
@@ -60,12 +70,3 @@ message NodeConnection {
|
|
|
60
70
|
uint32 src_node_id = 1;
|
|
61
71
|
uint32 dst_node_id = 2;
|
|
62
72
|
}
|
|
63
|
-
|
|
64
|
-
message NodeSocket {
|
|
65
|
-
uint32 node_id = 1;
|
|
66
|
-
string bind = 2;
|
|
67
|
-
DataType data_type = 3;
|
|
68
|
-
NodeType type = 4;
|
|
69
|
-
string label = 5;
|
|
70
|
-
repeated uint32 shape = 6;
|
|
71
|
-
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package synapse;
|
|
4
|
+
|
|
5
|
+
import "google/protobuf/struct.proto";
|
|
6
|
+
|
|
7
|
+
message ApplicationNodeConfig {
|
|
8
|
+
// Your application name, it should match what is deployed
|
|
9
|
+
string name = 1;
|
|
10
|
+
|
|
11
|
+
// Application specific configuration, will be loaded by
|
|
12
|
+
// the custom application during runtime
|
|
13
|
+
map<string, google.protobuf.Value> parameters = 2;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
message ApplicationNodeStatus {
|
|
17
|
+
string name = 1;
|
|
18
|
+
|
|
19
|
+
// Is the application started and running?
|
|
20
|
+
bool running = 2;
|
|
21
|
+
|
|
22
|
+
// If the application failed to start, what were the logs
|
|
23
|
+
string error_logs = 3;
|
|
24
|
+
}
|
|
@@ -5,3 +5,20 @@ package synapse;
|
|
|
5
5
|
message DiskWriterConfig {
|
|
6
6
|
string filename = 1;
|
|
7
7
|
}
|
|
8
|
+
|
|
9
|
+
message DiskWriterStatus {
|
|
10
|
+
// The output path of the file on the path of the sftp directory
|
|
11
|
+
string output_path = 1;
|
|
12
|
+
|
|
13
|
+
// How many bytes has been written for this file?
|
|
14
|
+
uint64 bytes_written = 2;
|
|
15
|
+
|
|
16
|
+
// Are we currently writing or are we stopped?
|
|
17
|
+
bool is_writing = 3;
|
|
18
|
+
|
|
19
|
+
// How many bytes are available for us to use
|
|
20
|
+
uint64 available_disk_space_bytes = 4;
|
|
21
|
+
|
|
22
|
+
// Current write performance for this node, megabits/sec
|
|
23
|
+
float current_bitrate_mbps = 5;
|
|
24
|
+
}
|
|
@@ -8,4 +8,33 @@ message OpticalStimulationConfig {
|
|
|
8
8
|
uint32 bit_width = 3;
|
|
9
9
|
uint32 frame_rate = 4;
|
|
10
10
|
float gain = 5;
|
|
11
|
+
|
|
12
|
+
// Instruct the FPGA to send out a 1xN vector
|
|
13
|
+
// where N is the number of LEDs with each Axon frame
|
|
14
|
+
bool send_receipts = 6;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// Core frame type for LED array optical stimulation
|
|
18
|
+
message OpticalStimFrame {
|
|
19
|
+
uint64 frame_id = 1;
|
|
20
|
+
uint64 sequence_number = 2;
|
|
21
|
+
uint64 timestamp_ns = 3;
|
|
22
|
+
|
|
23
|
+
// Frame dimensions
|
|
24
|
+
uint32 rows = 4;
|
|
25
|
+
uint32 columns = 5;
|
|
26
|
+
|
|
27
|
+
// Normalized pixel intensities (0.0 - 1.0)
|
|
28
|
+
// Row major ordering
|
|
29
|
+
// 0.0 is completely off, 1.0 is completely on
|
|
30
|
+
repeated float intensity = 6;
|
|
31
|
+
|
|
32
|
+
// For passive displays, this represents the row on time
|
|
33
|
+
// For active, this represents frame on time
|
|
34
|
+
uint64 duration_us = 7;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
message OpticalStimulationStatus {
|
|
38
|
+
// How many frames have we written?
|
|
39
|
+
uint64 frames_written = 1;
|
|
11
40
|
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package synapse;
|
|
4
|
+
|
|
5
|
+
// Statistics about the performance of a function call or block of computation
|
|
6
|
+
message FunctionProfile {
|
|
7
|
+
string name = 1;
|
|
8
|
+
|
|
9
|
+
// How often has this been called
|
|
10
|
+
uint64 call_count = 2;
|
|
11
|
+
|
|
12
|
+
// What was the minimal time it took for this function to execute
|
|
13
|
+
uint64 min_duration_ns = 3;
|
|
14
|
+
|
|
15
|
+
// Maximum execution for this function
|
|
16
|
+
uint64 max_duration_ns = 4;
|
|
17
|
+
|
|
18
|
+
// Average (mean) of this function over all samples
|
|
19
|
+
uint64 average_duration_ns = 5;
|
|
20
|
+
|
|
21
|
+
// Median execution time over all samples
|
|
22
|
+
uint64 median_duration_ns = 6;
|
|
23
|
+
|
|
24
|
+
// p99 duration
|
|
25
|
+
uint64 p99_duration_ns = 7;
|
|
26
|
+
|
|
27
|
+
// The last measurement duration
|
|
28
|
+
uint64 latest_duration_ns = 8;
|
|
29
|
+
}
|
|
@@ -4,6 +4,8 @@ package synapse;
|
|
|
4
4
|
|
|
5
5
|
import "api/channel.proto";
|
|
6
6
|
import "api/status.proto";
|
|
7
|
+
import "api/tap.proto";
|
|
8
|
+
import "api/device.proto";
|
|
7
9
|
|
|
8
10
|
message SampleQuery {
|
|
9
11
|
repeated Channel channels = 1;
|
|
@@ -46,12 +48,16 @@ message QueryRequest {
|
|
|
46
48
|
kImpedance = 1;
|
|
47
49
|
kSample = 2;
|
|
48
50
|
kSelfTest = 3;
|
|
51
|
+
kListTaps = 4;
|
|
52
|
+
kGetSettings = 5;
|
|
49
53
|
}
|
|
50
54
|
QueryType query_type = 1;
|
|
51
55
|
oneof query {
|
|
52
56
|
ImpedanceQuery impedance_query = 2;
|
|
53
57
|
SampleQuery sample_query = 3;
|
|
54
58
|
SelfTestQuery self_test_query = 4;
|
|
59
|
+
ListTapsQuery list_taps_query = 5;
|
|
60
|
+
GetSettingsQuery get_settings_query = 6;
|
|
55
61
|
}
|
|
56
62
|
}
|
|
57
63
|
|
|
@@ -67,6 +73,8 @@ message QueryResponse {
|
|
|
67
73
|
oneof response {
|
|
68
74
|
ImpedanceResponse impedance_response = 3;
|
|
69
75
|
SelfTestResponse self_test_response = 4;
|
|
76
|
+
ListTapsResponse list_taps_response = 5;
|
|
77
|
+
GetSettingsResponse get_settings_response = 6;
|
|
70
78
|
}
|
|
71
79
|
}
|
|
72
80
|
|
|
@@ -41,8 +41,13 @@ message Status {
|
|
|
41
41
|
string message = 1;
|
|
42
42
|
StatusCode code = 2;
|
|
43
43
|
DeviceState state = 3;
|
|
44
|
-
repeated NodeSocket sockets = 4;
|
|
44
|
+
// repeated NodeSocket sockets = 4;
|
|
45
|
+
reserved 4;
|
|
45
46
|
DevicePower power = 5;
|
|
46
47
|
DeviceStorage storage = 6;
|
|
47
48
|
SignalChainStatus signal_chain = 7;
|
|
49
|
+
|
|
50
|
+
// If the device supports a time sync server (see time.proto)
|
|
51
|
+
// Then the UDP echo server will be available at this port
|
|
52
|
+
uint32 time_sync_port = 8; // Port number (0-65535) for the UDP time sync server
|
|
48
53
|
}
|
|
@@ -3,41 +3,13 @@ syntax = "proto3";
|
|
|
3
3
|
package synapse;
|
|
4
4
|
|
|
5
5
|
import "google/protobuf/empty.proto";
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
import "api/query.proto";
|
|
8
8
|
import "api/status.proto";
|
|
9
9
|
import "api/files.proto";
|
|
10
10
|
import "api/logging.proto";
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
enum Type {
|
|
14
|
-
kUnknown = 0;
|
|
15
|
-
kBroadbandSource = 1;
|
|
16
|
-
kElectricalStimulation = 2;
|
|
17
|
-
kOpticalStimulation = 3;
|
|
18
|
-
kSpikeSource = 4;
|
|
19
|
-
}
|
|
20
|
-
string name = 1;
|
|
21
|
-
string vendor = 2;
|
|
22
|
-
uint32 peripheral_id = 3;
|
|
23
|
-
Type type = 4;
|
|
24
|
-
string address = 5;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
message DeviceInfo {
|
|
28
|
-
string name = 1;
|
|
29
|
-
string serial = 2;
|
|
30
|
-
uint32 synapse_version = 3;
|
|
31
|
-
uint32 firmware_version = 4;
|
|
32
|
-
Status status = 5;
|
|
33
|
-
repeated Peripheral peripherals = 6;
|
|
34
|
-
DeviceConfiguration configuration = 7;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
message DeviceConfiguration {
|
|
38
|
-
repeated NodeConfig nodes = 1;
|
|
39
|
-
repeated NodeConnection connections = 2;
|
|
40
|
-
}
|
|
11
|
+
import "api/app.proto";
|
|
12
|
+
import "api/device.proto";
|
|
41
13
|
|
|
42
14
|
service SynapseDevice {
|
|
43
15
|
rpc Info(google.protobuf.Empty) returns (DeviceInfo) {}
|
|
@@ -47,10 +19,15 @@ service SynapseDevice {
|
|
|
47
19
|
rpc Query(QueryRequest) returns (QueryResponse) {}
|
|
48
20
|
rpc StreamQuery(StreamQueryRequest) returns (stream StreamQueryResponse) {}
|
|
49
21
|
|
|
22
|
+
rpc DeployApp(stream AppPackageChunk) returns (stream AppDeployResponse) {}
|
|
23
|
+
|
|
50
24
|
rpc ListFiles(google.protobuf.Empty) returns (ListFilesResponse) {}
|
|
51
25
|
rpc WriteFile(WriteFileRequest) returns (WriteFileResponse) {}
|
|
52
26
|
rpc ReadFile(ReadFileRequest) returns (stream ReadFileResponse) {}
|
|
53
27
|
rpc DeleteFile(DeleteFileRequest) returns (DeleteFileResponse) {}
|
|
28
|
+
|
|
54
29
|
rpc GetLogs(LogQueryRequest) returns (LogQueryResponse) {}
|
|
55
30
|
rpc TailLogs(TailLogsRequest) returns (stream LogEntry) {}
|
|
31
|
+
|
|
32
|
+
rpc UpdateDeviceSettings(UpdateDeviceSettingsRequest) returns (UpdateDeviceSettingsResponse) {}
|
|
56
33
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package synapse;
|
|
4
|
+
|
|
5
|
+
enum TapType {
|
|
6
|
+
TAP_TYPE_UNSPECIFIED = 0;
|
|
7
|
+
|
|
8
|
+
// The tap will be producing data
|
|
9
|
+
TAP_TYPE_PRODUCER = 1;
|
|
10
|
+
|
|
11
|
+
// The tap type will be consuming data
|
|
12
|
+
TAP_TYPE_CONSUMER = 2;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
message TapConnection {
|
|
16
|
+
// Unique name id for this tap
|
|
17
|
+
string name = 1;
|
|
18
|
+
|
|
19
|
+
// What is the zmq endpoint to connect to
|
|
20
|
+
string endpoint = 2;
|
|
21
|
+
|
|
22
|
+
// What is the protobuf message to expect over this
|
|
23
|
+
string message_type = 3;
|
|
24
|
+
|
|
25
|
+
// Is this tap meant to be producing or consuming
|
|
26
|
+
TapType tap_type = 4;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
message ListTapsQuery {
|
|
30
|
+
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message ListTapsResponse {
|
|
34
|
+
repeated TapConnection taps = 1;
|
|
35
|
+
}
|