USRP Hardware Driver and USRP Manual: replay_block_control.hpp Source File

| USRP Hardware Driver and USRP Manual Version: 4.9.0.makepkg-0-g9ec1f582 UHD and USRP Manual |

Loading...
Searching...
No Matches
replay_block_control.hpp
Go to the documentation of this file.
1//
2// Copyright 2020 Ettus Research, a National Instruments Brand
3//
4// SPDX-License-Identifier: GPL-3.0-or-later
5//
6
7#pragma once
8
9#include <uhd/config.hpp>
10#include <uhd/rfnoc/noc_block_base.hpp>
11
12namespace uhd { namespace rfnoc {
13
14// doxygen tables need long long lines
15// clang-format off
110// clang-format on
111 class UHD_API replay_block_control : public noc_block_base
112{
113public:
114 RFNOC_DECLARE_BLOCK(replay_block_control)
115
116 static const uint16_t MINOR_COMPAT;
117 static const uint16_t MAJOR_COMPAT;
118
119 static const uint32_t REPLAY_ADDR_W;
120 static const uint32_t REPLAY_BLOCK_OFFSET;
121
122 static const uint32_t REG_COMPAT_ADDR;
123 static const uint32_t REG_MEM_SIZE_ADDR;
124 static const uint32_t REG_REC_RESTART_ADDR;
125 static const uint32_t REG_REC_BASE_ADDR_LO_ADDR;
126 static const uint32_t REG_REC_BASE_ADDR_HI_ADDR;
127 static const uint32_t REG_REC_BUFFER_SIZE_LO_ADDR;
128 static const uint32_t REG_REC_BUFFER_SIZE_HI_ADDR;
129 static const uint32_t REG_REC_FULLNESS_LO_ADDR;
130 static const uint32_t REG_REC_FULLNESS_HI_ADDR;
131 static const uint32_t REG_PLAY_BASE_ADDR_LO_ADDR;
132 static const uint32_t REG_PLAY_BASE_ADDR_HI_ADDR;
133 static const uint32_t REG_PLAY_BUFFER_SIZE_LO_ADDR;
134 static const uint32_t REG_PLAY_BUFFER_SIZE_HI_ADDR;
135 static const uint32_t REG_PLAY_CMD_NUM_WORDS_LO_ADDR;
136 static const uint32_t REG_PLAY_CMD_NUM_WORDS_HI_ADDR;
137 static const uint32_t REG_PLAY_CMD_TIME_LO_ADDR;
138 static const uint32_t REG_PLAY_CMD_TIME_HI_ADDR;
139 static const uint32_t REG_PLAY_CMD_ADDR;
140 static const uint32_t REG_PLAY_WORDS_PER_PKT_ADDR;
141 static const uint32_t REG_PLAY_ITEM_SIZE_ADDR;
142 static const uint32_t REG_REC_POS_LO_ADDR;
143 static const uint32_t REG_REC_POS_HI_ADDR;
144 static const uint32_t REG_PLAY_POS_LO_ADDR;
145 static const uint32_t REG_PLAY_POS_HI_ADDR;
146 static const uint32_t REG_PLAY_CMD_FIFO_SPACE_ADDR;
147
148 static const uint32_t PLAY_CMD_STOP;
149 static const uint32_t PLAY_CMD_FINITE;
150 static const uint32_t PLAY_CMD_CONTINUOUS;
151
156 static constexpr auto PLAY_CONTINUOUS{std::numeric_limits<size_t>::max()};
157
158 /**************************************************************************
159 * Replay Control API calls
160 *************************************************************************/
177 virtual void record(
178 const uint64_t offset, const uint64_t size, const size_t port = 0) = 0;
179
186 virtual void record_restart(const size_t port = 0) = 0;
187
231 virtual void play(const uint64_t offset,
232 const uint64_t size,
233 const size_t port,
234 const uhd::time_spec_t time_spec,
235 const bool repeat) = 0;
236
278 virtual void play(const uint64_t offset,
279 const uint64_t size,
280 const size_t port = 0,
281 const uhd::time_spec_t time_spec = uhd::time_spec_t(0.0),
282 const size_t iterations = 1) = 0;
283
291 virtual void stop(const size_t port = 0) = 0;
292
300 virtual uint64_t get_mem_size() const = 0;
301
306 virtual uint64_t get_word_size() const = 0;
307
308 /**************************************************************************
309 * Record State API calls
310 *************************************************************************/
316 virtual uint64_t get_record_offset(const size_t port = 0) const = 0;
317
323 virtual uint64_t get_record_size(const size_t port = 0) const = 0;
324
333 virtual uint64_t get_record_fullness(const size_t port = 0) = 0;
334
340 virtual uint64_t get_record_position(const size_t port = 0) = 0;
341
347 virtual io_type_t get_record_type(const size_t port = 0) const = 0;
348
354 virtual size_t get_record_item_size(const size_t port = 0) const = 0;
355
369 virtual bool get_record_async_metadata(
370 uhd::rx_metadata_t& metadata, const double timeout = 0.1) = 0;
371
372 /**************************************************************************
373 * Playback State API calls
374 *************************************************************************/
380 virtual uint64_t get_play_offset(const size_t port = 0) const = 0;
381
387 virtual uint64_t get_play_size(const size_t port = 0) const = 0;
388
394 virtual uint64_t get_play_position(const size_t port = 0) = 0;
395
401 virtual uint32_t get_max_items_per_packet(const size_t port = 0) const = 0;
402
410 virtual uint32_t get_max_packet_size(const size_t port = 0) const = 0;
411
417 virtual io_type_t get_play_type(const size_t port = 0) const = 0;
418
424 virtual size_t get_play_item_size(const size_t port = 0) const = 0;
425
439 virtual bool get_play_async_metadata(
440 uhd::async_metadata_t& metadata, const double timeout = 0.1) = 0;
441
442 /**************************************************************************
443 * Advanced Record Control API calls
444 *************************************************************************/
452 virtual void set_record_type(const io_type_t type, const size_t port = 0) = 0;
453
454 /**************************************************************************
455 * Advanced Playback Control API calls
456 *************************************************************************/
471 virtual void config_play(
472 const uint64_t offset, const uint64_t size, const size_t port = 0) = 0;
473
481 virtual void set_play_type(const io_type_t type, const size_t port = 0) = 0;
482
492 virtual void set_max_items_per_packet(const uint32_t ipp, const size_t port = 0) = 0;
493
502 virtual void set_max_packet_size(const uint32_t size, const size_t port = 0) = 0;
503
520 virtual void issue_stream_cmd(
521 const uhd::stream_cmd_t& stream_cmd, const size_t port = 0) = 0;
522
530 virtual void post_input_action(
531 const std::shared_ptr<uhd::rfnoc::action_info>& action, const size_t port) = 0;
532
540 virtual void post_output_action(
541 const std::shared_ptr<uhd::rfnoc::action_info>& action, const size_t port) = 0;
542};
543
544}} /* namespace uhd::rfnoc */
uhd::rfnoc::noc_block_base::noc_block_base
noc_block_base(make_args_ptr make_args)
uhd::rfnoc::replay_block_control
Definition replay_block_control.hpp:112
uhd::rfnoc::replay_block_control::REG_PLAY_BUFFER_SIZE_LO_ADDR
static const uint32_t REG_PLAY_BUFFER_SIZE_LO_ADDR
Definition replay_block_control.hpp:133
uhd::rfnoc::replay_block_control::REG_PLAY_BUFFER_SIZE_HI_ADDR
static const uint32_t REG_PLAY_BUFFER_SIZE_HI_ADDR
Definition replay_block_control.hpp:134
uhd::rfnoc::replay_block_control::REG_REC_BASE_ADDR_LO_ADDR
static const uint32_t REG_REC_BASE_ADDR_LO_ADDR
Definition replay_block_control.hpp:125
uhd::rfnoc::replay_block_control::REG_PLAY_CMD_FIFO_SPACE_ADDR
static const uint32_t REG_PLAY_CMD_FIFO_SPACE_ADDR
Definition replay_block_control.hpp:146
uhd::rfnoc::replay_block_control::REG_PLAY_CMD_ADDR
static const uint32_t REG_PLAY_CMD_ADDR
Definition replay_block_control.hpp:139
uhd::rfnoc::replay_block_control::REG_PLAY_CMD_TIME_HI_ADDR
static const uint32_t REG_PLAY_CMD_TIME_HI_ADDR
Definition replay_block_control.hpp:138
uhd::rfnoc::replay_block_control::REG_PLAY_BASE_ADDR_HI_ADDR
static const uint32_t REG_PLAY_BASE_ADDR_HI_ADDR
Definition replay_block_control.hpp:132
uhd::rfnoc::replay_block_control::REPLAY_ADDR_W
static const uint32_t REPLAY_ADDR_W
Definition replay_block_control.hpp:119
uhd::rfnoc::replay_block_control::PLAY_CMD_STOP
static const uint32_t PLAY_CMD_STOP
Definition replay_block_control.hpp:148
uhd::rfnoc::replay_block_control::REG_PLAY_BASE_ADDR_LO_ADDR
static const uint32_t REG_PLAY_BASE_ADDR_LO_ADDR
Definition replay_block_control.hpp:131
uhd::rfnoc::replay_block_control::REG_MEM_SIZE_ADDR
static const uint32_t REG_MEM_SIZE_ADDR
Definition replay_block_control.hpp:123
uhd::rfnoc::replay_block_control::set_record_type
virtual void set_record_type(const io_type_t type, const size_t port=0)=0
uhd::rfnoc::replay_block_control::post_output_action
virtual void post_output_action(const std::shared_ptr< uhd::rfnoc::action_info > &action, const size_t port)=0
uhd::rfnoc::replay_block_control::record
virtual void record(const uint64_t offset, const uint64_t size, const size_t port=0)=0
uhd::rfnoc::replay_block_control::play
virtual void play(const uint64_t offset, const uint64_t size, const size_t port=0, const uhd::time_spec_t time_spec=uhd::time_spec_t(0.0), const size_t iterations=1)=0
uhd::rfnoc::replay_block_control::REG_REC_BUFFER_SIZE_LO_ADDR
static const uint32_t REG_REC_BUFFER_SIZE_LO_ADDR
Definition replay_block_control.hpp:127
uhd::rfnoc::replay_block_control::get_play_item_size
virtual size_t get_play_item_size(const size_t port=0) const =0
uhd::rfnoc::replay_block_control::REG_REC_FULLNESS_LO_ADDR
static const uint32_t REG_REC_FULLNESS_LO_ADDR
Definition replay_block_control.hpp:129
uhd::rfnoc::replay_block_control::get_word_size
virtual uint64_t get_word_size() const =0
uhd::rfnoc::replay_block_control::get_mem_size
virtual uint64_t get_mem_size() const =0
uhd::rfnoc::replay_block_control::REG_PLAY_POS_LO_ADDR
static const uint32_t REG_PLAY_POS_LO_ADDR
Definition replay_block_control.hpp:144
uhd::rfnoc::replay_block_control::play
virtual void play(const uint64_t offset, const uint64_t size, const size_t port, const uhd::time_spec_t time_spec, const bool repeat)=0
uhd::rfnoc::replay_block_control::REG_PLAY_POS_HI_ADDR
static const uint32_t REG_PLAY_POS_HI_ADDR
Definition replay_block_control.hpp:145
uhd::rfnoc::replay_block_control::REG_PLAY_CMD_NUM_WORDS_HI_ADDR
static const uint32_t REG_PLAY_CMD_NUM_WORDS_HI_ADDR
Definition replay_block_control.hpp:136
uhd::rfnoc::replay_block_control::get_record_item_size
virtual size_t get_record_item_size(const size_t port=0) const =0
uhd::rfnoc::replay_block_control::get_play_async_metadata
virtual bool get_play_async_metadata(uhd::async_metadata_t &metadata, const double timeout=0.1)=0
uhd::rfnoc::replay_block_control::get_record_async_metadata
virtual bool get_record_async_metadata(uhd::rx_metadata_t &metadata, const double timeout=0.1)=0
uhd::rfnoc::replay_block_control::REG_REC_POS_LO_ADDR
static const uint32_t REG_REC_POS_LO_ADDR
Definition replay_block_control.hpp:142
uhd::rfnoc::replay_block_control::REPLAY_BLOCK_OFFSET
static const uint32_t REPLAY_BLOCK_OFFSET
Definition replay_block_control.hpp:120
uhd::rfnoc::replay_block_control::REG_PLAY_CMD_NUM_WORDS_LO_ADDR
static const uint32_t REG_PLAY_CMD_NUM_WORDS_LO_ADDR
Definition replay_block_control.hpp:135
uhd::rfnoc::replay_block_control::get_max_packet_size
virtual uint32_t get_max_packet_size(const size_t port=0) const =0
uhd::rfnoc::replay_block_control::REG_REC_BUFFER_SIZE_HI_ADDR
static const uint32_t REG_REC_BUFFER_SIZE_HI_ADDR
Definition replay_block_control.hpp:128
uhd::rfnoc::replay_block_control::get_play_type
virtual io_type_t get_play_type(const size_t port=0) const =0
uhd::rfnoc::replay_block_control::MAJOR_COMPAT
static const uint16_t MAJOR_COMPAT
Definition replay_block_control.hpp:117
uhd::rfnoc::replay_block_control::get_record_position
virtual uint64_t get_record_position(const size_t port=0)=0
uhd::rfnoc::replay_block_control::get_play_size
virtual uint64_t get_play_size(const size_t port=0) const =0
uhd::rfnoc::replay_block_control::post_input_action
virtual void post_input_action(const std::shared_ptr< uhd::rfnoc::action_info > &action, const size_t port)=0
uhd::rfnoc::replay_block_control::get_record_size
virtual uint64_t get_record_size(const size_t port=0) const =0
uhd::rfnoc::replay_block_control::stop
virtual void stop(const size_t port=0)=0
uhd::rfnoc::replay_block_control::config_play
virtual void config_play(const uint64_t offset, const uint64_t size, const size_t port=0)=0
uhd::rfnoc::replay_block_control::REG_REC_FULLNESS_HI_ADDR
static const uint32_t REG_REC_FULLNESS_HI_ADDR
Definition replay_block_control.hpp:130
uhd::rfnoc::replay_block_control::REG_PLAY_WORDS_PER_PKT_ADDR
static const uint32_t REG_PLAY_WORDS_PER_PKT_ADDR
Definition replay_block_control.hpp:140
uhd::rfnoc::replay_block_control::issue_stream_cmd
virtual void issue_stream_cmd(const uhd::stream_cmd_t &stream_cmd, const size_t port=0)=0
uhd::rfnoc::replay_block_control::REG_REC_RESTART_ADDR
static const uint32_t REG_REC_RESTART_ADDR
Definition replay_block_control.hpp:124
uhd::rfnoc::replay_block_control::REG_REC_BASE_ADDR_HI_ADDR
static const uint32_t REG_REC_BASE_ADDR_HI_ADDR
Definition replay_block_control.hpp:126
uhd::rfnoc::replay_block_control::get_play_offset
virtual uint64_t get_play_offset(const size_t port=0) const =0
uhd::rfnoc::replay_block_control::REG_COMPAT_ADDR
static const uint32_t REG_COMPAT_ADDR
Definition replay_block_control.hpp:122
uhd::rfnoc::replay_block_control::set_play_type
virtual void set_play_type(const io_type_t type, const size_t port=0)=0
uhd::rfnoc::replay_block_control::get_record_type
virtual io_type_t get_record_type(const size_t port=0) const =0
uhd::rfnoc::replay_block_control::PLAY_CONTINUOUS
static constexpr auto PLAY_CONTINUOUS
Definition replay_block_control.hpp:156
uhd::rfnoc::replay_block_control::PLAY_CMD_FINITE
static const uint32_t PLAY_CMD_FINITE
Definition replay_block_control.hpp:149
uhd::rfnoc::replay_block_control::REG_PLAY_ITEM_SIZE_ADDR
static const uint32_t REG_PLAY_ITEM_SIZE_ADDR
Definition replay_block_control.hpp:141
uhd::rfnoc::replay_block_control::set_max_items_per_packet
virtual void set_max_items_per_packet(const uint32_t ipp, const size_t port=0)=0
uhd::rfnoc::replay_block_control::record_restart
virtual void record_restart(const size_t port=0)=0
uhd::rfnoc::replay_block_control::MINOR_COMPAT
static const uint16_t MINOR_COMPAT
Definition replay_block_control.hpp:116
uhd::rfnoc::replay_block_control::REG_PLAY_CMD_TIME_LO_ADDR
static const uint32_t REG_PLAY_CMD_TIME_LO_ADDR
Definition replay_block_control.hpp:137
uhd::rfnoc::replay_block_control::get_play_position
virtual uint64_t get_play_position(const size_t port=0)=0
uhd::rfnoc::replay_block_control::set_max_packet_size
virtual void set_max_packet_size(const uint32_t size, const size_t port=0)=0
uhd::rfnoc::replay_block_control::REG_REC_POS_HI_ADDR
static const uint32_t REG_REC_POS_HI_ADDR
Definition replay_block_control.hpp:143
uhd::rfnoc::replay_block_control::get_record_offset
virtual uint64_t get_record_offset(const size_t port=0) const =0
uhd::rfnoc::replay_block_control::get_record_fullness
virtual uint64_t get_record_fullness(const size_t port=0)=0
uhd::rfnoc::replay_block_control::PLAY_CMD_CONTINUOUS
static const uint32_t PLAY_CMD_CONTINUOUS
Definition replay_block_control.hpp:150
uhd::rfnoc::replay_block_control::get_max_items_per_packet
virtual uint32_t get_max_items_per_packet(const size_t port=0) const =0
uhd::time_spec_t
Definition time_spec.hpp:31
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
uhd::rfnoc
Definition actions.hpp:24
uhd::rfnoc::io_type_t
std::string io_type_t
Definition defaults.hpp:32
uhd
Definition build_info.hpp:12
noc_block_base.hpp
RFNOC_DECLARE_BLOCK
#define RFNOC_DECLARE_BLOCK(CLASS_NAME)
Definition noc_block_base.hpp:22
uhd::async_metadata_t
Definition metadata.hpp:203
uhd::rx_metadata_t
Definition metadata.hpp:23
uhd::stream_cmd_t
Definition stream_cmd.hpp:40