USRP Hardware Driver and USRP Manual  Version: 3.13.0.HEAD-0-gf114cfa0
UHD and USRP Manual
soft_register.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2014 Ettus Research LLC
3 // Copyright 2018 Ettus Research, a National Instruments Company
4 //
5 // SPDX-License-Identifier: GPL-3.0-or-later
6 //
7 
8 #ifndef INCLUDED_UHD_UTILS_SOFT_REGISTER_HPP
9 #define INCLUDED_UHD_UTILS_SOFT_REGISTER_HPP
10 
11 #include <stdint.h>
12 #include <boost/noncopyable.hpp>
13 #include <uhd/types/wb_iface.hpp>
14 #include <uhd/exception.hpp>
16 #include <boost/thread/mutex.hpp>
17 #include <boost/thread/locks.hpp>
18 #include <boost/unordered_map.hpp>
19 #include <boost/tokenizer.hpp>
20 #include <boost/foreach.hpp>
21 #include <list>
22 
37 //==================================================================
38 // Soft Register Definition
39 //==================================================================
40 
41 #define UHD_DEFINE_SOFT_REG_FIELD(name, width, shift) \
42  static const uhd::soft_reg_field_t name = (((shift & 0xFF) << 8) | (width & 0xFF))
43 
44 namespace uhd {
45 
46 //TODO: These hints were added to boost 1.53.
47 
49 UHD_INLINE bool likely(bool expr)
50 {
51 #ifdef __GNUC__
52  return __builtin_expect(expr, true);
53 #else
54  return expr;
55 #endif
56  }
57 
59 UHD_INLINE bool unlikely(bool expr)
60 {
61 #ifdef __GNUC__
62  return __builtin_expect(expr, false);
63 #else
64  return expr;
65 #endif
66 }
67 
75 typedef uint32_t soft_reg_field_t;
76 
77 namespace soft_reg_field {
78  UHD_INLINE size_t width(const soft_reg_field_t field) {
79  return (field & 0xFF);
80  }
81 
82  UHD_INLINE size_t shift(const soft_reg_field_t field) {
83  return ((field >> 8) & 0xFF);
84  }
85 
86  template<typename data_t>
87  UHD_INLINE data_t mask(const soft_reg_field_t field) {
88  constexpr data_t ONE = static_cast<data_t>(1);
89  constexpr data_t ALL_ONES = ~static_cast<data_t>(0);
90  //Behavior for the left shift operation is undefined in C++
91  //if the shift amount is >= bitwidth of the datatype
92  //So we treat that as a special case with a branch predicition hint
93  if (likely((sizeof(data_t)*8) != width(field))) {
94  return ((ONE<<width(field))-ONE)<<shift(field);
95  } else {
96  return ALL_ONES<<shift(field);
97  }
98  }
99 }
100 
101 class soft_register_base : public boost::noncopyable {
102 public:
103  virtual ~soft_register_base() {}
104 
105  virtual void initialize(wb_iface& iface, bool sync = false) = 0;
106  virtual void flush() = 0;
107  virtual void refresh() = 0;
108  virtual size_t get_bitwidth() = 0;
109  virtual bool is_readable() = 0;
110  virtual bool is_writable() = 0;
111 
115  template <typename soft_reg_t>
116  UHD_INLINE static soft_reg_t& cast(soft_register_base& reg) {
117  soft_reg_t* ptr = dynamic_cast<soft_reg_t*>(&reg);
118  if (ptr) {
119  return *ptr;
120  } else {
121  throw uhd::type_error("failed to cast register to specified type");
122  }
123  }
124 };
125 
127 
133 template<typename reg_data_t, bool readable, bool writable>
135 public:
136  typedef boost::shared_ptr< soft_register_t<reg_data_t, readable, writable> > sptr;
137 
138  //Reserved field. Represents all bits in the register.
139  UHD_DEFINE_SOFT_REG_FIELD(REGISTER, sizeof(reg_data_t)*8, 0); //[WIDTH-1:0]
140 
145  wb_iface::wb_addr_type wr_addr,
146  wb_iface::wb_addr_type rd_addr,
147  soft_reg_flush_mode_t mode = ALWAYS_FLUSH):
148  _iface(NULL), _wr_addr(wr_addr), _rd_addr(rd_addr), _soft_copy(0), _flush_mode(mode)
149  {}
150 
155  explicit soft_register_t(
157  soft_reg_flush_mode_t mode = ALWAYS_FLUSH):
158  _iface(NULL), _wr_addr(addr), _rd_addr(addr), _soft_copy(0), _flush_mode(mode)
159  {}
160 
166  UHD_INLINE void initialize(wb_iface& iface, bool sync = false)
167  {
168  _iface = &iface;
169 
170  //Synchronize with hardware. For RW register, flush THEN refresh.
171  if (sync && writable) flush();
172  if (sync && readable) refresh();
173  }
174 
180  UHD_INLINE void set(const soft_reg_field_t field, const reg_data_t value)
181  {
182  _soft_copy = (_soft_copy & ~soft_reg_field::mask<reg_data_t>(field)) |
183  ((value << soft_reg_field::shift(field)) & soft_reg_field::mask<reg_data_t>(field));
184  }
185 
190  UHD_INLINE reg_data_t get(const soft_reg_field_t field)
191  {
192  return (_soft_copy & soft_reg_field::mask<reg_data_t>(field)) >> soft_reg_field::shift(field);
193  }
194 
199  {
200  if (writable && _iface) {
201  //If optimized flush then poke only if soft copy is dirty
202  //If flush mode is ALWAYS, the dirty flag should get optimized
203  //out by the compiler because it is never read
204  if (_flush_mode == ALWAYS_FLUSH || _soft_copy.is_dirty()) {
205  if (get_bitwidth() <= 16) {
206  _iface->poke16(_wr_addr, static_cast<uint16_t>(_soft_copy));
207  } else if (get_bitwidth() <= 32) {
208  _iface->poke32(_wr_addr, static_cast<uint32_t>(_soft_copy));
209  } else if (get_bitwidth() <= 64) {
210  _iface->poke64(_wr_addr, static_cast<uint64_t>(_soft_copy));
211  } else {
212  throw uhd::not_implemented_error("soft_register only supports up to 64 bits.");
213  }
214  _soft_copy.mark_clean();
215  }
216  } else {
217  throw uhd::not_implemented_error("soft_register is not writable or uninitialized.");
218  }
219  }
220 
225  {
226  if (readable && _iface) {
227  if (get_bitwidth() <= 16) {
228  _soft_copy = static_cast<reg_data_t>(_iface->peek16(_rd_addr));
229  } else if (get_bitwidth() <= 32) {
230  _soft_copy = static_cast<reg_data_t>(_iface->peek32(_rd_addr));
231  } else if (get_bitwidth() <= 64) {
232  _soft_copy = static_cast<reg_data_t>(_iface->peek64(_rd_addr));
233  } else {
234  throw uhd::not_implemented_error("soft_register only supports up to 64 bits.");
235  }
236  _soft_copy.mark_clean();
237  } else {
238  throw uhd::not_implemented_error("soft_register is not readable or uninitialized.");
239  }
240  }
241 
245  UHD_INLINE void write(const soft_reg_field_t field, const reg_data_t value)
246  {
247  set(field, value);
248  flush();
249  }
250 
254  UHD_INLINE reg_data_t read(const soft_reg_field_t field)
255  {
256  refresh();
257  return get(field);
258  }
259 
264  {
265  static const size_t BITS_IN_BYTE = 8;
266  return sizeof(reg_data_t) * BITS_IN_BYTE;
267  }
268 
273  {
274  return readable;
275  }
276 
281  {
282  return writable;
283  }
284 
285 private:
286  wb_iface* _iface;
287  const wb_iface::wb_addr_type _wr_addr;
288  const wb_iface::wb_addr_type _rd_addr;
289  dirty_tracked<reg_data_t> _soft_copy;
290  const soft_reg_flush_mode_t _flush_mode;
291 };
292 
297 template<typename reg_data_t, bool readable, bool writable>
298 class UHD_API soft_register_sync_t : public soft_register_t<reg_data_t, readable, writable> {
299 public:
300  typedef boost::shared_ptr< soft_register_sync_t<reg_data_t, readable, writable> > sptr;
301 
303  wb_iface::wb_addr_type wr_addr,
304  wb_iface::wb_addr_type rd_addr,
305  soft_reg_flush_mode_t mode = ALWAYS_FLUSH):
306  soft_register_t<reg_data_t, readable, writable>(wr_addr, rd_addr, mode), _mutex()
307  {}
308 
311  soft_reg_flush_mode_t mode = ALWAYS_FLUSH):
312  soft_register_t<reg_data_t, readable, writable>(addr, mode), _mutex()
313  {}
314 
315  UHD_INLINE void initialize(wb_iface& iface, bool sync = false)
316  {
317  boost::lock_guard<boost::mutex> lock(_mutex);
319  }
320 
321  UHD_INLINE void set(const soft_reg_field_t field, const reg_data_t value)
322  {
323  boost::lock_guard<boost::mutex> lock(_mutex);
325  }
326 
327  UHD_INLINE reg_data_t get(const soft_reg_field_t field)
328  {
329  boost::lock_guard<boost::mutex> lock(_mutex);
331  }
332 
334  {
335  boost::lock_guard<boost::mutex> lock(_mutex);
337  }
338 
340  {
341  boost::lock_guard<boost::mutex> lock(_mutex);
343  }
344 
345  UHD_INLINE void write(const soft_reg_field_t field, const reg_data_t value)
346  {
347  boost::lock_guard<boost::mutex> lock(_mutex);
349  }
350 
351  UHD_INLINE reg_data_t read(const soft_reg_field_t field)
352  {
353  boost::lock_guard<boost::mutex> lock(_mutex);
355  }
356 
357 private:
358  boost::mutex _mutex;
359 };
360 
361 /*
362  * Register Shortcut Formats:
363  * - soft_reg<bits>_<mode>_t: Soft register object with an unsynchronized soft-copy.
364  * Thread unsafe but lightweight. Mostly const propagated.
365  * - soft_reg<bits>_<mode>_sync_t: Soft register object with a synchronized soft-copy.
366  * Thread safe but with memory/speed overhead.
367  * where:
368  * - <bits> = {16, 32 or 64}
369  * - <mode> = {wo(write-only), rw(read-write) or ro(read-only)}
370  *
371  */
372 
373 //16-bit shortcuts
380 //32-bit shortcuts
387 //64-bit shortcuts
394 
395 
396 /*
397  * Usage example
398  *
399  //===Define bit width, RW mode, and synchronization using base class===
400  class example_reg_t : public soft_reg32_wo_sync_t (or soft_reg32_wo_t) {
401  public:
402  //===Define all the fields===
403  UHD_DEFINE_SOFT_REG_FIELD(FIELD0, 1, 0); //[0]
404  UHD_DEFINE_SOFT_REG_FIELD(FIELD1, 15, 1); //[15:1]
405  UHD_DEFINE_SOFT_REG_FIELD(FIELD2, 16, 16); //[31:16]
406 
407  example_reg_t(): //ctor with no args
408  soft_reg32_wo_t(SR_CORE_EXAMPLE_REG_OFFSET)) //===Bind to offset===
409  {
410  //===Set Initial values===
411  set(FIELD0, 0);
412  set(FIELD1, 1);
413  set(FIELD2, 0xFFFF);
414  }
415  }; //===Full register definition encapsulated in one class===
416 
417  void main() {
418  example_reg_t reg_obj;
419  reg_obj.initialize(iface);
420  reg_obj.write(example_reg_t::FIELD2, 0x1234);
421 
422  example_reg_t::sptr reg_sptr = boost::make_shared<example_reg_t>();
423  reg_obj->initialize(iface);
424  reg_obj->write(example_reg_t::FIELD2, 0x1234);
425  }
426 */
427 }
428 
429 //==================================================================
430 // Soft Register Map and Database Definition
431 //==================================================================
432 
433 namespace uhd {
434 
436 public:
437  typedef boost::shared_ptr<soft_regmap_accessor_t> sptr;
438 
440  virtual soft_register_base& lookup(const std::string& path) const = 0;
441  virtual std::vector<std::string> enumerate() const = 0;
442  virtual const std::string& get_name() const = 0;
443 };
444 
455 class UHD_API soft_regmap_t : public soft_regmap_accessor_t, public boost::noncopyable {
456 public:
457  soft_regmap_t(const std::string& name) : _name(name) {}
458  virtual ~soft_regmap_t() {};
459 
463  virtual UHD_INLINE const std::string& get_name() const { return _name; }
464 
471  void initialize(wb_iface& iface, bool sync = false) {
472  boost::lock_guard<boost::mutex> lock(_mutex);
473  BOOST_FOREACH(soft_register_base* reg, _reglist) {
474  reg->initialize(iface, sync);
475  }
476  }
477 
483  void flush() {
484  boost::lock_guard<boost::mutex> lock(_mutex);
485  BOOST_FOREACH(soft_register_base* reg, _reglist) {
486  reg->flush();
487  }
488  }
489 
495  void refresh() {
496  boost::lock_guard<boost::mutex> lock(_mutex);
497  BOOST_FOREACH(soft_register_base* reg, _reglist) {
498  reg->refresh();
499  }
500  }
501 
506  virtual soft_register_base& lookup(const std::string& name) const {
507  regmap_t::const_iterator iter = _regmap.find(name);
508  if (iter != _regmap.end()) {
509  return *(iter->second);
510  } else {
511  throw uhd::runtime_error("register not found in map: " + name);
512  }
513  }
514 
519  virtual std::vector<std::string> enumerate() const {
520  std::vector<std::string> temp;
521  BOOST_FOREACH(const regmap_t::value_type& reg, _regmap) {
522  temp.push_back(_name + "/" + reg.first);
523  }
524  return temp;
525  }
526 
527 protected:
529  PUBLIC, //Is accessible through the soft_regmap_accessor_t interface
530  PRIVATE //Is NOT accessible through the soft_regmap_accessor_t interface
531  };
532 
536  UHD_INLINE void add_to_map(soft_register_base& reg, const std::string& name, const visibility_t visible = PRIVATE) {
537  boost::lock_guard<boost::mutex> lock(_mutex);
538  if (visible == PUBLIC) {
539  //Only add to the map if this register is publicly visible
540  if (not _regmap.insert(regmap_t::value_type(name, &reg)).second) {
541  throw uhd::assertion_error("cannot add two registers with the same name to regmap: " + name);
542  }
543  }
544  _reglist.push_back(&reg);
545  }
546 
547 private:
548  typedef boost::unordered_map<std::string, soft_register_base*> regmap_t;
549  typedef std::list<soft_register_base*> reglist_t;
550 
551  const std::string _name;
552  regmap_t _regmap; //For lookups
553  reglist_t _reglist; //To maintain order
554  boost::mutex _mutex;
555 };
556 
557 
564 class UHD_API soft_regmap_db_t : public soft_regmap_accessor_t, public boost::noncopyable {
565 public:
566  typedef boost::shared_ptr<soft_regmap_db_t> sptr;
567 
571  soft_regmap_db_t() : _name("") {}
572 
576  soft_regmap_db_t(const std::string& name) : _name(name) {}
577 
581  const std::string& get_name() const { return _name; }
582 
586  void add(soft_regmap_t& regmap) {
587  boost::lock_guard<boost::mutex> lock(_mutex);
588  _regmaps.push_back(&regmap);
589  }
590 
594  void add(soft_regmap_db_t& db) {
595  boost::lock_guard<boost::mutex> lock(_mutex);
596  if (&db == this) {
597  throw uhd::assertion_error("cannot add regmap db to itself" + _name);
598  } else {
599  _regmap_dbs.push_back(&db);
600  }
601  }
602 
613  soft_register_base& lookup(const std::string& path) const
614  {
615  //Turn the slash separated path string into tokens
616  std::list<std::string> tokens;
617  BOOST_FOREACH(
618  const std::string& node,
619  boost::tokenizer< boost::char_separator<char> >(path, boost::char_separator<char>("/")))
620  {
621  tokens.push_back(node);
622  }
623  if ((tokens.size() > 2 && tokens.front() == _name) || //If this is a nested DB
624  (tokens.size() > 1 && _name == "")) { //If this is a top-level DB
625  if (_name != "") tokens.pop_front();
626  if (tokens.size() == 2) { //2 tokens => regmap/register path
627  BOOST_FOREACH(const soft_regmap_accessor_t* regmap, _regmaps) {
628  if (regmap->get_name() == tokens.front()) {
629  return regmap->lookup(tokens.back());
630  }
631  }
632  throw uhd::runtime_error("could not find register map: " + path);
633  } else if (not _regmap_dbs.empty()) { //>2 tokens => <1 or more dbs>/regmap/register
634  //Reconstruct path from tokens
635  std::string newpath;
636  BOOST_FOREACH(const std::string& node, tokens) {
637  newpath += ("/" + node);
638  }
639  //Dispatch path to hierarchical DB
640  BOOST_FOREACH(const soft_regmap_accessor_t* db, _regmap_dbs) {
641  try {
642  return db->lookup(newpath.substr(1));
643  } catch (std::exception&) {
644  continue;
645  }
646  }
647  }
648  }
649  throw uhd::runtime_error("could not find register: " + path);
650  }
651 
655  virtual std::vector<std::string> enumerate() const {
656  std::vector<std::string> paths;
657  BOOST_FOREACH(const soft_regmap_accessor_t* regmap, _regmaps) {
658  const std::vector<std::string>& regs = regmap->enumerate();
659  paths.insert(paths.end(), regs.begin(), regs.end());
660  }
661  BOOST_FOREACH(const soft_regmap_accessor_t* db, _regmap_dbs) {
662  const std::vector<std::string>& regs = db->enumerate();
663  paths.insert(paths.end(), regs.begin(), regs.end());
664  }
665  return paths;
666  }
667 
668 private:
669  typedef std::list<soft_regmap_accessor_t*> db_t;
670 
671  const std::string _name;
672  db_t _regmaps;
673  db_t _regmap_dbs;
674  boost::mutex _mutex;
675 };
676 
677 } //namespace uhd
678 
679 #endif /* INCLUDED_UHD_UTILS_SOFT_REGISTER_HPP */
void refresh()
Definition: soft_register.hpp:495
soft_register_sync_t< uint16_t, false, true > soft_reg16_wo_sync_t
Definition: soft_register.hpp:377
uint32_t soft_reg_field_t
Definition: soft_register.hpp:75
UHD_INLINE void flush()
Definition: soft_register.hpp:198
Definition: soft_register.hpp:126
soft_reg_flush_mode_t
Definition: soft_register.hpp:126
boost::shared_ptr< soft_register_t< reg_data_t, readable, writable > > sptr
Definition: soft_register.hpp:136
Definition: soft_register.hpp:298
virtual void flush()=0
Definition: exception.hpp:106
soft_regmap_t(const std::string &name)
Definition: soft_register.hpp:457
UHD_INLINE bool unlikely(bool expr)
hint for the branch prediction
Definition: soft_register.hpp:59
UHD_INLINE void refresh()
Definition: soft_register.hpp:224
soft_register_t< uint64_t, false, true > soft_reg64_wo_t
Definition: soft_register.hpp:388
virtual std::vector< std::string > enumerate() const
Definition: soft_register.hpp:519
soft_register_t(wb_iface::wb_addr_type addr, soft_reg_flush_mode_t mode=ALWAYS_FLUSH)
Definition: soft_register.hpp:155
#define UHD_DEFINE_SOFT_REG_FIELD(name, width, shift)
Definition: soft_register.hpp:41
soft_register_t< uint32_t, true, false > soft_reg32_ro_t
Definition: soft_register.hpp:382
UHD_INLINE size_t get_bitwidth()
Definition: soft_register.hpp:263
virtual soft_register_base & lookup(const std::string &name) const
Definition: soft_register.hpp:506
soft_register_sync_t(wb_iface::wb_addr_type addr, soft_reg_flush_mode_t mode=ALWAYS_FLUSH)
Definition: soft_register.hpp:309
UHD_INLINE bool is_writable()
Definition: soft_register.hpp:280
soft_register_sync_t< uint64_t, true, true > soft_reg64_rw_sync_t
Definition: soft_register.hpp:393
Definition: exception.hpp:91
Definition: soft_register.hpp:564
virtual std::vector< std::string > enumerate() const
Definition: soft_register.hpp:655
soft_register_sync_t< uint32_t, false, true > soft_reg32_wo_sync_t
Definition: soft_register.hpp:384
soft_register_t< uint32_t, false, true > soft_reg32_wo_t
Definition: soft_register.hpp:381
UHD_INLINE size_t width(const soft_reg_field_t field)
Definition: soft_register.hpp:78
Definition: soft_register.hpp:529
UHD_INLINE void set(const soft_reg_field_t field, const reg_data_t value)
Definition: soft_register.hpp:180
soft_regmap_db_t(const std::string &name)
Definition: soft_register.hpp:576
virtual ~soft_regmap_accessor_t()
Definition: soft_register.hpp:439
Definition: soft_register.hpp:134
UHD_INLINE reg_data_t get(const soft_reg_field_t field)
Definition: soft_register.hpp:190
Definition: build_info.hpp:14
soft_regmap_db_t()
Definition: soft_register.hpp:571
UHD_INLINE void write(const soft_reg_field_t field, const reg_data_t value)
Definition: soft_register.hpp:345
virtual std::vector< std::string > enumerate() const =0
virtual soft_register_base & lookup(const std::string &path) const =0
virtual ~soft_register_base()
Definition: soft_register.hpp:103
void flush()
Definition: soft_register.hpp:483
visibility_t
Definition: soft_register.hpp:528
UHD_INLINE void initialize(wb_iface &iface, bool sync=false)
Definition: soft_register.hpp:166
virtual void refresh()=0
boost::shared_ptr< soft_register_sync_t< reg_data_t, readable, writable > > sptr
Definition: soft_register.hpp:300
void initialize(wb_iface &iface, bool sync=false)
Definition: soft_register.hpp:471
virtual const std::string & get_name() const =0
soft_register_sync_t< uint64_t, true, false > soft_reg64_ro_sync_t
Definition: soft_register.hpp:392
virtual ~soft_regmap_t()
Definition: soft_register.hpp:458
soft_register_sync_t(wb_iface::wb_addr_type wr_addr, wb_iface::wb_addr_type rd_addr, soft_reg_flush_mode_t mode=ALWAYS_FLUSH)
Definition: soft_register.hpp:302
boost::shared_ptr< soft_regmap_accessor_t > sptr
Definition: soft_register.hpp:437
Definition: soft_register.hpp:435
UHD_INLINE bool is_readable()
Definition: soft_register.hpp:272
#define UHD_INLINE
Definition: config.h:53
UHD_INLINE void flush()
Definition: soft_register.hpp:333
UHD_INLINE reg_data_t read(const soft_reg_field_t field)
Definition: soft_register.hpp:254
soft_register_t(wb_iface::wb_addr_type wr_addr, wb_iface::wb_addr_type rd_addr, soft_reg_flush_mode_t mode=ALWAYS_FLUSH)
Definition: soft_register.hpp:144
soft_register_t< uint64_t, true, false > soft_reg64_ro_t
Definition: soft_register.hpp:389
boost::shared_ptr< soft_regmap_db_t > sptr
Definition: soft_register.hpp:566
Definition: soft_register.hpp:455
Definition: soft_register.hpp:101
soft_register_sync_t< uint32_t, true, false > soft_reg32_ro_sync_t
Definition: soft_register.hpp:385
Definition: exception.hpp:42
#define UHD_API
Definition: config.h:63
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:87
void add(soft_regmap_t &regmap)
Definition: soft_register.hpp:586
UHD_INLINE reg_data_t read(const soft_reg_field_t field)
Definition: soft_register.hpp:351
const std::string & get_name() const
Definition: soft_register.hpp:581
UHD_INLINE void refresh()
Definition: soft_register.hpp:339
soft_register_t< uint64_t, true, true > soft_reg64_rw_t
Definition: soft_register.hpp:390
UHD_INLINE void write(const soft_reg_field_t field, const reg_data_t value)
Definition: soft_register.hpp:245
soft_register_t< uint16_t, true, true > soft_reg16_rw_t
Definition: soft_register.hpp:376
Definition: exception.hpp:70
void add(soft_regmap_db_t &db)
Definition: soft_register.hpp:594
virtual void initialize(wb_iface &iface, bool sync=false)=0
soft_register_base & lookup(const std::string &path) const
Definition: soft_register.hpp:613
soft_register_sync_t< uint16_t, true, true > soft_reg16_rw_sync_t
Definition: soft_register.hpp:379
soft_register_sync_t< uint64_t, false, true > soft_reg64_wo_sync_t
Definition: soft_register.hpp:391
UHD_INLINE void initialize(wb_iface &iface, bool sync=false)
Definition: soft_register.hpp:315
soft_register_t< uint16_t, false, true > soft_reg16_wo_t
Definition: soft_register.hpp:374
UHD_INLINE bool likely(bool expr)
hint for the branch prediction
Definition: soft_register.hpp:49
soft_register_sync_t< uint32_t, true, true > soft_reg32_rw_sync_t
Definition: soft_register.hpp:386
virtual UHD_INLINE const std::string & get_name() const
Definition: soft_register.hpp:463
UHD_INLINE void add_to_map(soft_register_base &reg, const std::string &name, const visibility_t visible=PRIVATE)
Definition: soft_register.hpp:536
UHD_INLINE size_t shift(const soft_reg_field_t field)
Definition: soft_register.hpp:82
Definition: soft_register.hpp:126
uint32_t wb_addr_type
Definition: wb_iface.hpp:23
static UHD_INLINE soft_reg_t & cast(soft_register_base &reg)
Definition: soft_register.hpp:116
Definition: wb_iface.hpp:19
soft_register_t< uint16_t, true, false > soft_reg16_ro_t
Definition: soft_register.hpp:375
soft_register_sync_t< uint16_t, true, false > soft_reg16_ro_sync_t
Definition: soft_register.hpp:378
soft_register_t< uint32_t, true, true > soft_reg32_rw_t
Definition: soft_register.hpp:383