Skip to content

Commit

Permalink
Add initial auto-generation support for streaming APIs (#1114)
Browse files Browse the repository at this point in the history
* adding support for sideband streaming

* updating grpc-sideband submodule to latest

* adding data_moniker source and generated files to Integration and System test runners

* Initial auto-generation

* update grpc-streaming_type

* adding sideband_address to the server_config.json

* adding the sideband_streaming functionality under a feature toggle

* Fix some format changes

* adding RT specific scheduling under feature toggle

* Fixing some build issues

* include copy at top

* resolve minor comments

* add feature toggle helper

* fixing minor comments

* resolving comments

* review comments

* review comments

* update filter streaming functions

* use streaming_functions_to_generate

* move define_streaming_api_body under else block

* Resolve merge conflicts

* fix build

* resolve comments

* remove unused functions

* delete[] array

* use vector instead of raw array

* Fix indentation

* include boolean functions

* Revert "include boolean functions"

This reverts commit c2464b0.

* fix indentation

* Add boolean functions

* Move RegisterMonikerEndpoints inside of driver specific registrar

* remove unused code

* revert register_all_services.cpp.mako

---------

Co-authored-by: sagrahar <[email protected]>
  • Loading branch information
amehra-ni and asumit authored Nov 12, 2024
1 parent 44fde0f commit 6e312a2
Show file tree
Hide file tree
Showing 18 changed files with 4,088 additions and 77 deletions.
446 changes: 446 additions & 0 deletions generated/nifpga/nifpga.proto

Large diffs are not rendered by default.

657 changes: 657 additions & 0 deletions generated/nifpga/nifpga_client.cpp

Large diffs are not rendered by default.

36 changes: 36 additions & 0 deletions generated/nifpga/nifpga_client.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,27 @@ GetFifoPropertyU64Response get_fifo_property_u64(const StubPtr& stub, const nide
GetFpgaViStateResponse get_fpga_vi_state(const StubPtr& stub, const nidevice_grpc::Session& session);
OpenResponse open(const StubPtr& stub, const std::string& bitfile, const std::string& signature, const std::string& resource, const simple_variant<OpenAttribute, std::int32_t>& attribute, const nidevice_grpc::SessionInitializationBehavior& initialization_behavior = nidevice_grpc::SESSION_INITIALIZATION_BEHAVIOR_UNSPECIFIED);
ReadArrayBoolResponse read_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
BeginReadArrayBoolResponse begin_read_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadArrayDblResponse read_array_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadArrayI16Response read_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
BeginReadArrayI16Response begin_read_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadArrayI32Response read_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
BeginReadArrayI32Response begin_read_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadArrayI64Response read_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
BeginReadArrayI64Response begin_read_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadArrayI8Response read_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
BeginReadArrayI8Response begin_read_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadArraySglResponse read_array_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadArrayU16Response read_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
BeginReadArrayU16Response begin_read_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadArrayU32Response read_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
BeginReadArrayU32Response begin_read_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadArrayU64Response read_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
BeginReadArrayU64Response begin_read_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadArrayU8Response read_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
BeginReadArrayU8Response begin_read_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator, const pb::uint32& size);
ReadBoolResponse read_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
BeginReadBoolResponse begin_read_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReadDblResponse read_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReadFifoBoolResponse read_fifo_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& number_of_elements, const pb::uint32& timeout);
ReadFifoDblResponse read_fifo_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& number_of_elements, const pb::uint32& timeout);
Expand All @@ -63,14 +73,22 @@ ReadFifoU32Response read_fifo_u32(const StubPtr& stub, const nidevice_grpc::Sess
ReadFifoU64Response read_fifo_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& number_of_elements, const pb::uint32& timeout);
ReadFifoU8Response read_fifo_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& number_of_elements, const pb::uint32& timeout);
ReadI16Response read_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
BeginReadI16Response begin_read_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReadI32Response read_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
BeginReadI32Response begin_read_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReadI64Response read_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
BeginReadI64Response begin_read_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReadI8Response read_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
BeginReadI8Response begin_read_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReadSglResponse read_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReadU16Response read_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
BeginReadU16Response begin_read_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReadU32Response read_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
BeginReadU32Response begin_read_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReadU64Response read_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
BeginReadU64Response begin_read_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReadU8Response read_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
BeginReadU8Response begin_read_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& indicator);
ReleaseFifoElementsResponse release_fifo_elements(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const pb::uint32& elements);
ResetResponse reset(const StubPtr& stub, const nidevice_grpc::Session& session);
RunResponse run(const StubPtr& stub, const nidevice_grpc::Session& session, const simple_variant<RunAttribute, pb::uint32>& attribute);
Expand All @@ -83,17 +101,27 @@ StopFifoResponse stop_fifo(const StubPtr& stub, const nidevice_grpc::Session& se
UnreserveFifoResponse unreserve_fifo(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo);
WaitOnIrqsResponse wait_on_irqs(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& irqs, const pb::uint32& timeout);
WriteArrayBoolResponse write_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<bool>& array);
BeginWriteArrayBoolResponse begin_write_array_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteArrayDblResponse write_array_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<double>& array);
WriteArrayI16Response write_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<pb::int32>& array);
BeginWriteArrayI16Response begin_write_array_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteArrayI32Response write_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<pb::int32>& array);
BeginWriteArrayI32Response begin_write_array_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteArrayI64Response write_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<pb::int64>& array);
BeginWriteArrayI64Response begin_write_array_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteArrayI8Response write_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<pb::int32>& array);
BeginWriteArrayI8Response begin_write_array_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteArraySglResponse write_array_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<float>& array);
WriteArrayU16Response write_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<pb::uint32>& array);
BeginWriteArrayU16Response begin_write_array_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteArrayU32Response write_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<pb::uint32>& array);
BeginWriteArrayU32Response begin_write_array_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteArrayU64Response write_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<pb::uint64>& array);
BeginWriteArrayU64Response begin_write_array_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteArrayU8Response write_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const std::vector<pb::uint32>& array);
BeginWriteArrayU8Response begin_write_array_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteBoolResponse write_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const bool& value);
BeginWriteBoolResponse begin_write_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteDblResponse write_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const double& value);
WriteFifoBoolResponse write_fifo_bool(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const std::vector<bool>& data, const pb::uint32& timeout);
WriteFifoDblResponse write_fifo_dbl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const std::vector<double>& data, const pb::uint32& timeout);
Expand All @@ -107,14 +135,22 @@ WriteFifoU32Response write_fifo_u32(const StubPtr& stub, const nidevice_grpc::Se
WriteFifoU64Response write_fifo_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const std::vector<pb::uint64>& data, const pb::uint32& timeout);
WriteFifoU8Response write_fifo_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& fifo, const std::vector<pb::uint32>& data, const pb::uint32& timeout);
WriteI16Response write_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int32& value);
BeginWriteI16Response begin_write_i16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteI32Response write_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int32& value);
BeginWriteI32Response begin_write_i32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteI64Response write_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int64& value);
BeginWriteI64Response begin_write_i64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteI8Response write_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::int32& value);
BeginWriteI8Response begin_write_i8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteSglResponse write_sgl(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const float& value);
WriteU16Response write_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint32& value);
BeginWriteU16Response begin_write_u16(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteU32Response write_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint32& value);
BeginWriteU32Response begin_write_u32(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteU64Response write_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint64& value);
BeginWriteU64Response begin_write_u64(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);
WriteU8Response write_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control, const pb::uint32& value);
BeginWriteU8Response begin_write_u8(const StubPtr& stub, const nidevice_grpc::Session& session, const pb::uint32& control);

} // namespace nifpga_grpc::experimental::client

Expand Down
Loading

0 comments on commit 6e312a2

Please sign in to comment.