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

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

Loading...
Searching...
No Matches
mock_nodes.hpp
Go to the documentation of this file.
1//
2// Copyright 2019 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/rfnoc/defaults.hpp>
10#include <uhd/rfnoc/node.hpp>
11#include <uhd/rfnoc/node_accessor.hpp>
12#include <uhd/types/stream_cmd.hpp>
13#include <list>
14
15
16 namespace uhd { namespace rfnoc { namespace test {
17
18 constexpr int MAX_DECIM = 512;
19 constexpr double DEFAULT_RATE = 1e9;
20 constexpr int DEFAULT_DECIM = 1;
21
28 class mock_radio_node_t : public node_t
29{
30public:
31 mock_radio_node_t(const size_t radio_idx) : _radio_idx(radio_idx)
32 {
33 register_property(&_samp_rate_in);
34 register_property(&_samp_rate_out);
35 register_property(&_master_clock_rate);
36 register_property(&_rssi);
37
38 // Resolver for the input rate: We don't actually try and be clever, we
39 // always reset the rate back to the TX rate.
40 add_property_resolver({&_samp_rate_in},
41 {&_samp_rate_in},
42 [&samp_rate_in = _samp_rate_in,
43 &master_clock_rate = _master_clock_rate,
44 this]() {
45 UHD_LOG_INFO(get_unique_id(), " Calling resolver for `samp_rate_in'...");
46 samp_rate_in = master_clock_rate.get();
47 });
48 add_property_resolver({&_samp_rate_out}, {&_samp_rate_out}, [this]() {
49 UHD_LOG_INFO(get_unique_id(), " Calling resolver for `samp_rate_out'...");
50 if (this->disable_samp_out_resolver) {
51 _samp_rate_out = this->force_samp_out_value;
52 UHD_LOG_DEBUG(
53 get_unique_id(), "Forcing samp_rate_out to " << _samp_rate_out.get());
54 return;
55 }
56 this->_samp_rate_out = this->_master_clock_rate.get();
57 });
58 add_property_resolver({&_master_clock_rate},
59 {&_master_clock_rate, &_samp_rate_in, &_samp_rate_out},
60 [this]() {
61 UHD_LOG_INFO(
62 get_unique_id(), " Calling resolver for `master_clock_rate'...");
63 if (_master_clock_rate.get() > 150e6) {
64 _master_clock_rate = 200e6;
65 } else {
66 _master_clock_rate = 100e6;
67 }
68 _samp_rate_in = _master_clock_rate.get();
69 if (!this->disable_samp_out_resolver) {
70 _samp_rate_out = _master_clock_rate.get();
71 } else {
72 _samp_rate_out = this->force_samp_out_value;
73 UHD_LOG_DEBUG(get_unique_id(),
74 "Forcing samp_rate_out to " << _samp_rate_out.get());
75 }
76 });
77 // By depending on ALWAYS_DIRTY, this property is always updated:
78 add_property_resolver({&ALWAYS_DIRTY}, {&_rssi}, [this]() {
79 UHD_LOG_INFO(get_unique_id(), " Calling resolver for `rssi'...");
80 rssi_resolver_count++;
81 _rssi = static_cast<double>(rssi_resolver_count);
82 });
83
84
85 set_action_forwarding_policy(forwarding_policy_t::DROP);
86
87 register_action_handler(ACTION_KEY_STREAM_CMD,
88 [this](const res_source_info& src, action_info::sptr action) {
89 stream_cmd_action_info::sptr stream_cmd_action =
90 std::dynamic_pointer_cast<stream_cmd_action_info>(action);
91 UHD_ASSERT_THROW(stream_cmd_action);
92 uhd::stream_cmd_t::stream_mode_t stream_mode =
93 stream_cmd_action->stream_cmd.stream_mode;
94 RFNOC_LOG_INFO("Received stream command: " << stream_mode << " to "
95 << src.to_string()
96 << ", id==" << action->id);
97 if (stream_mode == uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS) {
98 UHD_LOG_INFO(get_unique_id(), "Starting Stream!");
99 } else if (stream_mode
100 == uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS) {
101 UHD_LOG_INFO(get_unique_id(), "Stopping Stream!");
102 } else {
103 this->last_num_samps = stream_cmd_action->stream_cmd.num_samps;
104 RFNOC_LOG_INFO("Streaming num samps: " << this->last_num_samps);
105 }
106 });
107 }
108
109 void update_fwd_policy(forwarding_policy_t policy)
110 {
111 set_action_forwarding_policy(policy);
112 }
113
114 std::string get_unique_id() const override
115 {
116 return "MOCK_RADIO" + std::to_string(_radio_idx);
117 }
118
119 size_t get_num_input_ports() const override
120 {
121 return 1;
122 }
123
124 size_t get_num_output_ports() const override
125 {
126 return 1;
127 }
128
129 // Mock overrun
130 void generate_overrun(const size_t chan)
131 {
132 auto rx_event_action =
133 rx_event_action_info::make(uhd::rx_metadata_t::ERROR_CODE_OVERFLOW);
134 post_action(res_source_info{res_source_info::OUTPUT_EDGE, chan}, rx_event_action);
135 }
136
137 // Mock underrun (note: we use tick rate 1.0 for calculating ticks from time!)
138 void generate_underrun(const size_t chan, uhd::time_spec_t time_spec)
139 {
140 auto tx_event_action = tx_event_action_info::make(
141 uhd::async_metadata_t::EVENT_CODE_UNDERFLOW, time_spec.to_ticks(1.0));
142 post_action(res_source_info{res_source_info::INPUT_EDGE, chan}, tx_event_action);
143 }
144
145 // Some public attributes that help debugging
146 size_t rssi_resolver_count = 0;
147 bool disable_samp_out_resolver = false;
148 double force_samp_out_value = 23e6;
149
150 size_t last_num_samps = 0;
151
152private:
153 const size_t _radio_idx;
154
155 property_t<double> _samp_rate_in{"samp_rate", 200e6, {res_source_info::INPUT_EDGE}};
156 property_t<double> _samp_rate_out{"samp_rate", 200e6, {res_source_info::OUTPUT_EDGE}};
157 property_t<double> _master_clock_rate{
158 "master_clock_rate", 200e6, {res_source_info::USER}};
159 property_t<double> _rssi{"rssi", 0, {res_source_info::USER}};
160};
161
168 class mock_ddc_node_t : public node_t
169{
170public:
171 mock_ddc_node_t()
172 {
173 register_property(&_samp_rate_in);
174 register_property(&_samp_rate_out);
175 register_property(&_decim);
176
177 // Resolver for _decim: This gets executed when the user directly
178 // modifies _decim. The desired behaviour is to coerce it first, then
179 // keep the input rate constant, and re-calculate the output rate.
180 add_property_resolver({&_decim},
181 {&_decim, &_samp_rate_out},
182 [&decim = _decim,
183 &samp_rate_out = _samp_rate_out,
184 &samp_rate_in = _samp_rate_in]() {
185 UHD_LOG_INFO("MOCK DDC", "Calling resolver for `decim'...");
186 decim = coerce_decim(decim.get());
187 samp_rate_out = samp_rate_in.get() / decim.get();
188 });
189 // Resolver for the input rate: We try and match decim so that the output
190 // rate is not modified. If decim needs to be coerced, only then the
191 // output rate is modified.
192 add_property_resolver({&_samp_rate_in},
193 {&_decim, &_samp_rate_out},
194 [&decim = _decim,
195 &samp_rate_out = _samp_rate_out,
196 &samp_rate_in = _samp_rate_in]() {
197 UHD_LOG_INFO("MOCK DDC", "Calling resolver for `samp_rate_in'...");
198 decim = coerce_decim(int(samp_rate_in.get() / samp_rate_out.get()));
199 samp_rate_out = samp_rate_in.get() / decim.get();
200 });
201 // Resolver for the output rate: Like the previous one, but flipped.
202 add_property_resolver({&_samp_rate_out},
203 {&_decim, &_samp_rate_in},
204 [&decim = _decim,
205 &samp_rate_out = _samp_rate_out,
206 &samp_rate_in = _samp_rate_in]() {
207 UHD_LOG_INFO("MOCK DDC", "Calling resolver for `samp_rate_out'...");
208 decim = coerce_decim(int(samp_rate_in.get() / samp_rate_out.get()));
209 samp_rate_in = samp_rate_out.get() * decim.get();
210 });
211
212 register_action_handler(ACTION_KEY_STREAM_CMD,
213 [this](const res_source_info& src, action_info::sptr action) {
214 res_source_info dst_edge{
215 res_source_info::invert_edge(src.type), src.instance};
216 stream_cmd_action_info::sptr stream_cmd_action =
217 std::dynamic_pointer_cast<stream_cmd_action_info>(action);
218 UHD_ASSERT_THROW(stream_cmd_action);
219 uhd::stream_cmd_t::stream_mode_t stream_mode =
220 stream_cmd_action->stream_cmd.stream_mode;
221 RFNOC_LOG_INFO("Received stream command: " << stream_mode << " to "
222 << src.to_string()
223 << ", id==" << action->id);
224 auto new_action = stream_cmd_action_info::make(stream_mode);
225 new_action->stream_cmd = stream_cmd_action->stream_cmd;
226 if (stream_mode == uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE
227 || stream_mode == uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_MORE) {
228 if (src.type == res_source_info::OUTPUT_EDGE) {
229 RFNOC_LOG_INFO("Multiplying num_samps by " << _decim.get());
230 new_action->stream_cmd.num_samps *= _decim.get();
231 } else {
232 RFNOC_LOG_INFO("Dividing num_samps by " << _decim.get());
233 new_action->stream_cmd.num_samps /= _decim.get();
234 }
235 }
236
237 RFNOC_LOG_INFO("Forwarding stream_cmd, num_samps is "
238 << new_action->stream_cmd.num_samps
239 << ", id==" << new_action->id);
240 post_action(dst_edge, new_action);
241 });
242 }
243
244 std::string get_unique_id() const override
245 {
246 return "MOCK_DDC";
247 }
248
249 size_t get_num_input_ports() const override
250 {
251 return 1;
252 }
253
254 size_t get_num_output_ports() const override
255 {
256 return 1;
257 }
258
259 // Simplified coercer: Let's pretend like we can hit all even rates or 1
260 // for all rates <= MAX_DECIM
261 static int coerce_decim(const int requested_decim)
262 {
263 if (requested_decim <= 1) {
264 return 1;
265 }
266 return std::min(requested_decim - (requested_decim % 2), MAX_DECIM);
267 }
268
269
270 // We make the properties global so we can inspect them, but that's not what
271 // your supposed to do. However, we do keep the underscore notation, since that's
272 // what they be called if they were in the class like they're supposed to.
273 property_t<double> _samp_rate_in{
274 "samp_rate", DEFAULT_RATE, {res_source_info::INPUT_EDGE}};
275 property_t<double> _samp_rate_out{
276 "samp_rate", DEFAULT_RATE, {res_source_info::OUTPUT_EDGE}};
277 property_t<int> _decim{"decim", DEFAULT_DECIM, {res_source_info::USER}};
278
279private:
280 // This is where you normally put the properties
281};
282
283
288 class mock_fifo_t : public node_t
289{
290public:
291 mock_fifo_t(const size_t num_ports) : _num_ports(num_ports)
292 {
293 set_prop_forwarding_policy(forwarding_policy_t::ONE_TO_ONE);
294 set_action_forwarding_policy(forwarding_policy_t::ONE_TO_ONE);
295 }
296
297 std::string get_unique_id() const override
298 {
299 return "MOCK_FIFO";
300 }
301
302 size_t get_num_input_ports() const override
303 {
304 return _num_ports;
305 }
306
307 size_t get_num_output_ports() const override
308 {
309 return _num_ports;
310 }
311
312
313private:
314 const size_t _num_ports;
315};
316
321 class mock_streamer_t : public node_t
322{
323public:
324 mock_streamer_t(const size_t num_ports) : _num_ports(num_ports)
325 {
326 set_prop_forwarding_policy(forwarding_policy_t::DROP);
327 set_action_forwarding_policy(forwarding_policy_t::DROP);
328 register_property(&_samp_rate_user);
329 register_property(&_samp_rate_in);
330 add_property_resolver({&_samp_rate_user}, {&_samp_rate_in}, [this]() {
331 UHD_LOG_INFO(get_unique_id(), "Calling resolver for `samp_rate_user'...");
332 _samp_rate_in = _samp_rate_user.get();
333 });
334 add_property_resolver({&_samp_rate_in}, {}, [this]() {
335 UHD_LOG_INFO(get_unique_id(), "Calling resolver for `samp_rate_in'...");
336 // nop
337 });
338 }
339
340 std::string get_unique_id() const override
341 {
342 return "MOCK_STREAMER";
343 }
344
345 size_t get_num_input_ports() const override
346 {
347 return _num_ports;
348 }
349
350 size_t get_num_output_ports() const override
351 {
352 return _num_ports;
353 }
354
355 void issue_stream_cmd(uhd::stream_cmd_t stream_cmd, const size_t chan)
356 {
357 auto scmd =
358 stream_cmd_action_info::make(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
359 scmd->stream_cmd = stream_cmd;
360 post_action({res_source_info::INPUT_EDGE, chan}, scmd);
361 }
362
363private:
364 property_t<double> _samp_rate_user{"samp_rate", 1e6, {res_source_info::USER}};
365 property_t<double> _samp_rate_in{"samp_rate", 1e6, {res_source_info::INPUT_EDGE}};
366 const size_t _num_ports;
367};
368
371 class mock_terminator_t : public node_t
372{
373public:
374 static size_t counter;
375
376 mock_terminator_t(const size_t num_ports,
377 const std::vector<std::string> expected_actions = {},
378 const std::string name = "MOCK_TERMINATOR")
379 : _num_ports(num_ports), _term_count(counter++), _name(name)
380 {
381 set_prop_forwarding_policy(forwarding_policy_t::DROP);
382 set_action_forwarding_policy(forwarding_policy_t::DROP);
383 for (const auto& action_key : expected_actions) {
384 RFNOC_LOG_DEBUG("Adding action handler for key " << action_key);
385 register_action_handler(
386 action_key, [this](const res_source_info& src, action_info::sptr action) {
387 RFNOC_LOG_INFO(
388 "Received action: key=" << action->key << ", id=" << action->id
389 << ", src edge=" << src.to_string());
390 received_actions.push_back(action);
391 });
392 }
393 }
394
395 std::string get_unique_id() const override
396 {
397 return _name + std::to_string(_term_count);
398 }
399
400 size_t get_num_input_ports() const override
401 {
402 return _num_ports;
403 }
404
405 size_t get_num_output_ports() const override
406 {
407 return _num_ports;
408 }
409
410 template <typename data_t>
411 void set_edge_property(const std::string& id, data_t val, res_source_info edge_info)
412 {
413 UHD_ASSERT_THROW(edge_info.type == res_source_info::INPUT_EDGE
414 || edge_info.type == res_source_info::OUTPUT_EDGE);
415 try {
416 set_property<data_t>(id, val, edge_info);
417 } catch (const uhd::lookup_error&) {
418 node_accessor_t node_accessor{};
419 auto edge_info_inverted = edge_info;
420 edge_info_inverted.type = res_source_info::invert_edge(edge_info.type);
421 property_t<data_t> new_prop(id, val, edge_info_inverted);
422 node_accessor.forward_edge_property(this, edge_info.instance, &new_prop);
423 set_property<data_t>(id, val, edge_info);
424 }
425 }
426
427 template <typename data_t>
428 data_t get_edge_property(const std::string& id, res_source_info edge_info)
429 {
430 UHD_ASSERT_THROW(edge_info.type == res_source_info::INPUT_EDGE
431 || edge_info.type == res_source_info::OUTPUT_EDGE);
432 return get_property<data_t>(id, edge_info);
433 }
434
435 void post_action(const res_source_info& edge_info, action_info::sptr action)
436 {
437 node_t::post_action(edge_info, action);
438 }
439
440 std::list<action_info::sptr> received_actions;
441
442private:
443 const size_t _num_ports;
444 const size_t _term_count;
445 const std::string _name;
446};
447size_t mock_terminator_t::counter = 0;
448
454 class mock_edge_node_t : public node_t
455{
456public:
457 using received_actions_map_t =
458 std::unordered_map<res_source_info, std::vector<action_info::sptr>>;
459
460 mock_edge_node_t(size_t input_ports,
461 size_t output_ports,
462 const std::string& name = "MOCK_EDGE_NODE")
463 : _input_ports(input_ports), _output_ports(output_ports), _name(name)
464 {
465 _in_props.reserve(_input_ports);
466 _out_props.reserve(_output_ports);
467 set_action_forwarding_policy(forwarding_policy_t::ONE_TO_ONE);
468
469 for (size_t i = 0; i < _input_ports; i++) {
470 _in_props.emplace_back(
471 property_t<int>{"prop", 0, {res_source_info::INPUT_EDGE, i}});
472 register_property(&_in_props.back());
473 }
474 for (size_t i = 0; i < _output_ports; i++) {
475 _out_props.emplace_back(
476 property_t<int>{"prop", 0, {res_source_info::OUTPUT_EDGE, i}});
477 register_property(&_out_props.back());
478 }
479
480 register_action_handler(
481 "action", [this](const res_source_info& src, action_info::sptr action) {
482 auto itr = _received_actions.find(src);
483 if (itr == _received_actions.end()) {
484 _received_actions.insert({src, {action}});
485 } else {
486 itr->second.push_back(action);
487 }
488 });
489 }
490
491 template <typename T>
492 void set_edge_property(
493 const std::string& id, const T& val, const res_source_info& rsi)
494 {
495 node_t::set_property<T>(id, val, rsi);
496 }
497
498 template <typename T>
499 T get_edge_property(const std::string& id, const res_source_info& rsi)
500 {
501 return node_t::get_property<T>(id, rsi);
502 }
503
504 size_t get_num_input_ports() const override
505 {
506 return _input_ports;
507 }
508
509 size_t get_num_output_ports() const override
510 {
511 return _output_ports;
512 }
513
514 std::string get_unique_id() const override
515 {
516 return _name;
517 }
518
519 void post_input_edge_action(action_info::sptr action, size_t port)
520 {
521 UHD_ASSERT_THROW(port < _input_ports);
522 post_action({res_source_info::INPUT_EDGE, port}, action);
523 }
524
525 void post_output_edge_action(action_info::sptr action, size_t port)
526 {
527 UHD_ASSERT_THROW(port < _output_ports);
528 post_action({res_source_info::OUTPUT_EDGE, port}, action);
529 }
530
531 const received_actions_map_t& get_received_actions_map() const
532 {
533 return _received_actions;
534 }
535
536 void clear_received_actions_map()
537 {
538 _received_actions.clear();
539 }
540
541private:
542 size_t _input_ports;
543 size_t _output_ports;
544 std::string _name;
545 std::vector<property_t<int>> _in_props;
546 std::vector<property_t<int>> _out_props;
547 received_actions_map_t _received_actions;
548};
549
553 class mock_routing_node_t : public node_t
554{
555public:
556 mock_routing_node_t(size_t input_ports, size_t output_ports)
557 : _input_ports(input_ports), _output_ports(output_ports)
558 {
559 // By default, the node will drop incoming properties and actions.
560 // Call set_property_prop_map() or set_action_forwarding_map() to
561 // configure the node to use the provided map.
562 set_prop_forwarding_policy(forwarding_policy_t::DROP);
563 set_action_forwarding_policy(forwarding_policy_t::DROP);
564 }
565
566 size_t get_num_input_ports() const override
567 {
568 return _input_ports;
569 }
570
571 size_t get_num_output_ports() const override
572 {
573 return _output_ports;
574 }
575
576 std::string get_unique_id() const override
577 {
578 return "MOCK_ROUTING_NODE";
579 }
580
581 void set_prop_forwarding_map(const node_t::forwarding_map_t& fwd_map)
582 {
583 set_prop_forwarding_policy(forwarding_policy_t::USE_MAP);
584 node_t::set_prop_forwarding_map(fwd_map);
585 }
586
587 void set_action_forwarding_map(const node_t::forwarding_map_t& fwd_map)
588 {
589 set_action_forwarding_policy(forwarding_policy_t::USE_MAP);
590 node_t::set_action_forwarding_map(fwd_map);
591 }
592
593private:
594 size_t _input_ports;
595 size_t _output_ports;
596};
597
598}}} // namespace uhd::rfnoc::test
uhd::rfnoc::node_accessor_t::forward_edge_property
void forward_edge_property(node_t *dst_node, const size_t dst_port, property_base_t *incoming_prop)
Definition node_accessor.hpp:110
uhd::rfnoc::node_t::get_property
const prop_data_t & get_property(const std::string &id, const size_t instance=0)
Definition node.ipp:53
uhd::rfnoc::node_t::register_property
void register_property(property_base_t *prop, resolve_callback_t &&clean_callback=nullptr)
uhd::rfnoc::node_t::forwarding_map_t
std::unordered_map< res_source_info, std::vector< res_source_info > > forwarding_map_t
Definition node.hpp:42
uhd::rfnoc::node_t::set_action_forwarding_policy
void set_action_forwarding_policy(forwarding_policy_t policy, const std::string &action_key="")
uhd::rfnoc::node_t::set_prop_forwarding_map
void set_prop_forwarding_map(const forwarding_map_t &map)
uhd::rfnoc::node_t::register_action_handler
void register_action_handler(const std::string &id, action_handler_t &&handler)
uhd::rfnoc::node_t::post_action
void post_action(const res_source_info &edge_info, action_info::sptr action)
uhd::rfnoc::node_t::set_property
void set_property(const std::string &id, const prop_data_t &val, const size_t instance=0)
Definition node.ipp:45
uhd::rfnoc::node_t::node_t
node_t()
uhd::rfnoc::node_t::set_action_forwarding_map
void set_action_forwarding_map(const forwarding_map_t &map)
uhd::rfnoc::node_t::forwarding_policy_t
forwarding_policy_t
Types of property/action forwarding for those not defined by the block itself.
Definition node.hpp:46
uhd::rfnoc::node_t::forwarding_policy_t::ONE_TO_ONE
@ ONE_TO_ONE
Forward the property/action to the opposite port with the same index.
Definition node.hpp:49
uhd::rfnoc::node_t::forwarding_policy_t::USE_MAP
@ USE_MAP
Forward the property based on a client-provided map.
Definition node.hpp:61
uhd::rfnoc::node_t::forwarding_policy_t::DROP
@ DROP
Property propagation ends here.
Definition node.hpp:59
uhd::rfnoc::node_t::add_property_resolver
void add_property_resolver(prop_ptrs_t &&inputs, prop_ptrs_t &&outputs, resolver_fn_t &&resolver_fn)
uhd::rfnoc::node_t::node_accessor_t
friend class node_accessor_t
Definition node.hpp:477
uhd::rfnoc::node_t::ALWAYS_DIRTY
static dirtifier_t ALWAYS_DIRTY
A dirtifyer object, useful for properties that always need updating.
Definition node.hpp:474
uhd::rfnoc::node_t::set_prop_forwarding_policy
void set_prop_forwarding_policy(forwarding_policy_t policy, const std::string &prop_id="")
uhd::rfnoc::property_t
Definition property.hpp:151
uhd::rfnoc::test::mock_ddc_node_t::_samp_rate_out
property_t< double > _samp_rate_out
Definition mock_nodes.hpp:275
uhd::rfnoc::test::mock_ddc_node_t::coerce_decim
static int coerce_decim(const int requested_decim)
Definition mock_nodes.hpp:261
uhd::rfnoc::test::mock_ddc_node_t::get_num_output_ports
size_t get_num_output_ports() const override
Definition mock_nodes.hpp:254
uhd::rfnoc::test::mock_ddc_node_t::mock_ddc_node_t
mock_ddc_node_t()
Definition mock_nodes.hpp:171
uhd::rfnoc::test::mock_ddc_node_t::_samp_rate_in
property_t< double > _samp_rate_in
Definition mock_nodes.hpp:273
uhd::rfnoc::test::mock_ddc_node_t::get_unique_id
std::string get_unique_id() const override
Return a unique identifier string for this node. In every RFNoC graph,.
Definition mock_nodes.hpp:244
uhd::rfnoc::test::mock_ddc_node_t::_decim
property_t< int > _decim
Definition mock_nodes.hpp:277
uhd::rfnoc::test::mock_ddc_node_t::get_num_input_ports
size_t get_num_input_ports() const override
Definition mock_nodes.hpp:249
uhd::rfnoc::test::mock_edge_node_t::get_received_actions_map
const received_actions_map_t & get_received_actions_map() const
Definition mock_nodes.hpp:531
uhd::rfnoc::test::mock_edge_node_t::get_edge_property
T get_edge_property(const std::string &id, const res_source_info &rsi)
Definition mock_nodes.hpp:499
uhd::rfnoc::test::mock_edge_node_t::get_num_input_ports
size_t get_num_input_ports() const override
Definition mock_nodes.hpp:504
uhd::rfnoc::test::mock_edge_node_t::mock_edge_node_t
mock_edge_node_t(size_t input_ports, size_t output_ports, const std::string &name="MOCK_EDGE_NODE")
Definition mock_nodes.hpp:460
uhd::rfnoc::test::mock_edge_node_t::post_output_edge_action
void post_output_edge_action(action_info::sptr action, size_t port)
Definition mock_nodes.hpp:525
uhd::rfnoc::test::mock_edge_node_t::get_unique_id
std::string get_unique_id() const override
Return a unique identifier string for this node. In every RFNoC graph,.
Definition mock_nodes.hpp:514
uhd::rfnoc::test::mock_edge_node_t::clear_received_actions_map
void clear_received_actions_map()
Definition mock_nodes.hpp:536
uhd::rfnoc::test::mock_edge_node_t::post_input_edge_action
void post_input_edge_action(action_info::sptr action, size_t port)
Definition mock_nodes.hpp:519
uhd::rfnoc::test::mock_edge_node_t::set_edge_property
void set_edge_property(const std::string &id, const T &val, const res_source_info &rsi)
Definition mock_nodes.hpp:492
uhd::rfnoc::test::mock_edge_node_t::get_num_output_ports
size_t get_num_output_ports() const override
Definition mock_nodes.hpp:509
uhd::rfnoc::test::mock_edge_node_t::received_actions_map_t
std::unordered_map< res_source_info, std::vector< action_info::sptr > > received_actions_map_t
Definition mock_nodes.hpp:457
uhd::rfnoc::test::mock_fifo_t::get_num_input_ports
size_t get_num_input_ports() const override
Definition mock_nodes.hpp:302
uhd::rfnoc::test::mock_fifo_t::get_num_output_ports
size_t get_num_output_ports() const override
Definition mock_nodes.hpp:307
uhd::rfnoc::test::mock_fifo_t::get_unique_id
std::string get_unique_id() const override
Return a unique identifier string for this node. In every RFNoC graph,.
Definition mock_nodes.hpp:297
uhd::rfnoc::test::mock_fifo_t::mock_fifo_t
mock_fifo_t(const size_t num_ports)
Definition mock_nodes.hpp:291
uhd::rfnoc::test::mock_radio_node_t::get_unique_id
std::string get_unique_id() const override
Return a unique identifier string for this node. In every RFNoC graph,.
Definition mock_nodes.hpp:114
uhd::rfnoc::test::mock_radio_node_t::rssi_resolver_count
size_t rssi_resolver_count
Definition mock_nodes.hpp:146
uhd::rfnoc::test::mock_radio_node_t::update_fwd_policy
void update_fwd_policy(forwarding_policy_t policy)
Definition mock_nodes.hpp:109
uhd::rfnoc::test::mock_radio_node_t::force_samp_out_value
double force_samp_out_value
Definition mock_nodes.hpp:148
uhd::rfnoc::test::mock_radio_node_t::last_num_samps
size_t last_num_samps
Definition mock_nodes.hpp:150
uhd::rfnoc::test::mock_radio_node_t::generate_underrun
void generate_underrun(const size_t chan, uhd::time_spec_t time_spec)
Definition mock_nodes.hpp:138
uhd::rfnoc::test::mock_radio_node_t::get_num_input_ports
size_t get_num_input_ports() const override
Definition mock_nodes.hpp:119
uhd::rfnoc::test::mock_radio_node_t::get_num_output_ports
size_t get_num_output_ports() const override
Definition mock_nodes.hpp:124
uhd::rfnoc::test::mock_radio_node_t::generate_overrun
void generate_overrun(const size_t chan)
Definition mock_nodes.hpp:130
uhd::rfnoc::test::mock_radio_node_t::disable_samp_out_resolver
bool disable_samp_out_resolver
Definition mock_nodes.hpp:147
uhd::rfnoc::test::mock_radio_node_t::mock_radio_node_t
mock_radio_node_t(const size_t radio_idx)
Definition mock_nodes.hpp:31
uhd::rfnoc::test::mock_routing_node_t::get_num_output_ports
size_t get_num_output_ports() const override
Definition mock_nodes.hpp:571
uhd::rfnoc::test::mock_routing_node_t::get_unique_id
std::string get_unique_id() const override
Return a unique identifier string for this node. In every RFNoC graph,.
Definition mock_nodes.hpp:576
uhd::rfnoc::test::mock_routing_node_t::get_num_input_ports
size_t get_num_input_ports() const override
Definition mock_nodes.hpp:566
uhd::rfnoc::test::mock_routing_node_t::mock_routing_node_t
mock_routing_node_t(size_t input_ports, size_t output_ports)
Definition mock_nodes.hpp:556
uhd::rfnoc::test::mock_routing_node_t::set_prop_forwarding_map
void set_prop_forwarding_map(const node_t::forwarding_map_t &fwd_map)
Definition mock_nodes.hpp:581
uhd::rfnoc::test::mock_routing_node_t::set_action_forwarding_map
void set_action_forwarding_map(const node_t::forwarding_map_t &fwd_map)
Definition mock_nodes.hpp:587
uhd::rfnoc::test::mock_streamer_t::get_num_input_ports
size_t get_num_input_ports() const override
Definition mock_nodes.hpp:345
uhd::rfnoc::test::mock_streamer_t::issue_stream_cmd
void issue_stream_cmd(uhd::stream_cmd_t stream_cmd, const size_t chan)
Definition mock_nodes.hpp:355
uhd::rfnoc::test::mock_streamer_t::get_unique_id
std::string get_unique_id() const override
Return a unique identifier string for this node. In every RFNoC graph,.
Definition mock_nodes.hpp:340
uhd::rfnoc::test::mock_streamer_t::get_num_output_ports
size_t get_num_output_ports() const override
Definition mock_nodes.hpp:350
uhd::rfnoc::test::mock_streamer_t::mock_streamer_t
mock_streamer_t(const size_t num_ports)
Definition mock_nodes.hpp:324
uhd::rfnoc::test::mock_terminator_t::post_action
void post_action(const res_source_info &edge_info, action_info::sptr action)
Definition mock_nodes.hpp:435
uhd::rfnoc::test::mock_terminator_t::mock_terminator_t
mock_terminator_t(const size_t num_ports, const std::vector< std::string > expected_actions={}, const std::string name="MOCK_TERMINATOR")
Definition mock_nodes.hpp:376
uhd::rfnoc::test::mock_terminator_t::set_edge_property
void set_edge_property(const std::string &id, data_t val, res_source_info edge_info)
Definition mock_nodes.hpp:411
uhd::rfnoc::test::mock_terminator_t::get_num_output_ports
size_t get_num_output_ports() const override
Definition mock_nodes.hpp:405
uhd::rfnoc::test::mock_terminator_t::get_num_input_ports
size_t get_num_input_ports() const override
Definition mock_nodes.hpp:400
uhd::rfnoc::test::mock_terminator_t::received_actions
std::list< action_info::sptr > received_actions
Definition mock_nodes.hpp:440
uhd::rfnoc::test::mock_terminator_t::get_unique_id
std::string get_unique_id() const override
Return a unique identifier string for this node. In every RFNoC graph,.
Definition mock_nodes.hpp:395
uhd::rfnoc::test::mock_terminator_t::get_edge_property
data_t get_edge_property(const std::string &id, res_source_info edge_info)
Definition mock_nodes.hpp:428
uhd::rfnoc::test::mock_terminator_t::counter
static size_t counter
Definition mock_nodes.hpp:374
uhd::time_spec_t
Definition time_spec.hpp:31
uhd::time_spec_t::to_ticks
long long to_ticks(const double tick_rate) const
defaults.hpp
UHD_ASSERT_THROW
#define UHD_ASSERT_THROW(code)
Definition exception.hpp:321
UHD_LOG_DEBUG
#define UHD_LOG_DEBUG(component,...)
Definition log.h:46
UHD_LOG_INFO
#define UHD_LOG_INFO(component,...)
Definition log.h:53
RFNOC_LOG_DEBUG
#define RFNOC_LOG_DEBUG(message)
Definition log.hpp:252
RFNOC_LOG_INFO
#define RFNOC_LOG_INFO(message)
Definition log.hpp:253
uhd::rfnoc::test
Definition mock_nodes.hpp:16
uhd::rfnoc::test::MAX_DECIM
constexpr int MAX_DECIM
Definition mock_nodes.hpp:18
uhd::rfnoc::test::DEFAULT_RATE
constexpr double DEFAULT_RATE
Definition mock_nodes.hpp:19
uhd::rfnoc::test::DEFAULT_DECIM
constexpr int DEFAULT_DECIM
Definition mock_nodes.hpp:20
uhd::rfnoc
Definition actions.hpp:24
uhd
Definition build_info.hpp:12
node.hpp
node_accessor.hpp
stream_cmd.hpp
uhd::async_metadata_t::EVENT_CODE_UNDERFLOW
@ EVENT_CODE_UNDERFLOW
An internal send buffer has emptied.
Definition metadata.hpp:222
uhd::lookup_error
Definition exception.hpp:59
uhd::rfnoc::action_info::sptr
std::shared_ptr< action_info > sptr
Definition actions.hpp:38
uhd::rfnoc::res_source_info
Definition res_source_info.hpp:18
uhd::rfnoc::res_source_info::instance
size_t instance
The instance of the source. For resource that is sourced by a edge, it.
Definition res_source_info.hpp:42
uhd::rfnoc::res_source_info::type
source_t type
The type of source (user or edge).
Definition res_source_info.hpp:38
uhd::rfnoc::res_source_info::INPUT_EDGE
@ INPUT_EDGE
An input edge sources this resource.
Definition res_source_info.hpp:23
uhd::rfnoc::res_source_info::OUTPUT_EDGE
@ OUTPUT_EDGE
An input edge sources this resource.
Definition res_source_info.hpp:24
uhd::rfnoc::res_source_info::USER
@ USER
The user API sources this resource.
Definition res_source_info.hpp:22
uhd::rfnoc::res_source_info::invert_edge
static source_t invert_edge(const source_t edge_direction)
Definition res_source_info.hpp:72
uhd::rfnoc::res_source_info::to_string
std::string to_string() const
Returns a string representation of the source.
Definition res_source_info.hpp:55
uhd::rfnoc::rx_event_action_info::make
static sptr make(uhd::rx_metadata_t::error_code_t error_code)
Factory function.
uhd::rfnoc::stream_cmd_action_info::sptr
std::shared_ptr< stream_cmd_action_info > sptr
Definition actions.hpp:61
uhd::rfnoc::stream_cmd_action_info::make
static sptr make(const uhd::stream_cmd_t::stream_mode_t stream_mode)
Factory function.
uhd::rfnoc::tx_event_action_info::make
static sptr make(uhd::async_metadata_t::event_code_t event_code, const boost::optional< uint64_t > &tsf)
Factory function.
uhd::rx_metadata_t::ERROR_CODE_OVERFLOW
@ ERROR_CODE_OVERFLOW
Definition metadata.hpp:131
uhd::stream_cmd_t
Definition stream_cmd.hpp:40
uhd::stream_cmd_t::stream_mode_t
stream_mode_t
Definition stream_cmd.hpp:41
uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_DONE
@ STREAM_MODE_NUM_SAMPS_AND_DONE
Definition stream_cmd.hpp:44
uhd::stream_cmd_t::STREAM_MODE_NUM_SAMPS_AND_MORE
@ STREAM_MODE_NUM_SAMPS_AND_MORE
Definition stream_cmd.hpp:45
uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS
@ STREAM_MODE_STOP_CONTINUOUS
Definition stream_cmd.hpp:43
uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS
@ STREAM_MODE_START_CONTINUOUS
Definition stream_cmd.hpp:42