USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-gdca39145
UHD and USRP Manual
soft_register.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2014 Ettus Research LLC
3 //
4 // SPDX-License-Identifier: GPL-3.0
5 //
6 
7 #ifndef INCLUDED_UHD_UTILS_SOFT_REGISTER_HPP
8 #define INCLUDED_UHD_UTILS_SOFT_REGISTER_HPP
9 
10 #include <stdint.h>
11 #include <boost/noncopyable.hpp>
12 #include <uhd/types/wb_iface.hpp>
13 #include <uhd/exception.hpp>
15 #include <boost/thread/mutex.hpp>
16 #include <boost/thread/locks.hpp>
17 #include <boost/unordered_map.hpp>
18 #include <boost/tokenizer.hpp>
19 #include <boost/foreach.hpp>
20 #include <list>
21 
36 //==================================================================
37 // Soft Register Definition
38 //==================================================================
39 
40 #define UHD_DEFINE_SOFT_REG_FIELD(name, width, shift) \
41  static const uhd::soft_reg_field_t name = (((shift & 0xFF) << 8) | (width & 0xFF))
42 
43 namespace uhd {
44 
45 //TODO: These hints were added to boost 1.53.
46 
48 UHD_INLINE bool likely(bool expr)
49 {
50 #ifdef __GNUC__
51  return __builtin_expect(expr, true);
52 #else
53  return expr;
54 #endif
55  }
56 
58 UHD_INLINE bool unlikely(bool expr)
59 {
60 #ifdef __GNUC__
61  return __builtin_expect(expr, false);
62 #else
63  return expr;
64 #endif
65 }
66 
74 typedef uint32_t soft_reg_field_t;
75 
76 namespace soft_reg_field {
77  UHD_INLINE size_t width(const soft_reg_field_t field) {
78  return (field & 0xFF);
79  }
80 
81  UHD_INLINE size_t shift(const soft_reg_field_t field) {
82  return ((field >> 8) & 0xFF);
83  }
84 
85  template<typename data_t>
86  UHD_INLINE data_t mask(const soft_reg_field_t field) {
87  static const data_t ONE = static_cast<data_t>(1);
88  //Behavior for the left shift operation is undefined in C++
89  //if the shift amount is >= bitwidth of the datatype
90  //So we treat that as a special case with a branch predicition hint
91  if (likely((sizeof(data_t)*8) != width(field)))
92  return ((ONE<<width(field))-ONE)<<shift(field);
93  else
94  return (0-ONE)<<shift(field);
95  }
96 }
97 
98 class soft_register_base : public boost::noncopyable {
99 public:
100  virtual ~soft_register_base() {}
101 
102  virtual void initialize(wb_iface& iface, bool sync = false) = 0;
103  virtual void flush() = 0;
104  virtual void refresh() = 0;
105  virtual size_t get_bitwidth() = 0;
106  virtual bool is_readable() = 0;
107  virtual bool is_writable() = 0;
108 
112  template <typename soft_reg_t>
113  UHD_INLINE static soft_reg_t& cast(soft_register_base& reg) {
114  soft_reg_t* ptr = dynamic_cast<soft_reg_t*>(&reg);
115  if (ptr) {
116  return *ptr;
117  } else {
118  throw uhd::type_error("failed to cast register to specified type");
119  }
120  }
121 };
122 
124 
130 template<typename reg_data_t, bool readable, bool writable>
132 public:
133  typedef boost::shared_ptr< soft_register_t<reg_data_t, readable, writable> > sptr;
134 
135  //Reserved field. Represents all bits in the register.
136  UHD_DEFINE_SOFT_REG_FIELD(REGISTER, sizeof(reg_data_t)*8, 0); //[WIDTH-1:0]
137 
142  wb_iface::wb_addr_type wr_addr,
143  wb_iface::wb_addr_type rd_addr,
144  soft_reg_flush_mode_t mode = ALWAYS_FLUSH):
145  _iface(NULL), _wr_addr(wr_addr), _rd_addr(rd_addr), _soft_copy(0), _flush_mode(mode)
146  {}
147 
152  explicit soft_register_t(
154  soft_reg_flush_mode_t mode = ALWAYS_FLUSH):
155  _iface(NULL), _wr_addr(addr), _rd_addr(addr), _soft_copy(0), _flush_mode(mode)
156  {}
157 
163  UHD_INLINE void initialize(wb_iface& iface, bool sync = false)
164  {
165  _iface = &iface;
166 
167  //Synchronize with hardware. For RW register, flush THEN refresh.
168  if (sync && writable) flush();
169  if (sync && readable) refresh();
170  }
171 
177  UHD_INLINE void set(const soft_reg_field_t field, const reg_data_t value)
178  {
179  _soft_copy = (_soft_copy & ~soft_reg_field::mask<reg_data_t>(field)) |
180  ((value << soft_reg_field::shift(field)) & soft_reg_field::mask<reg_data_t>(field));
181  }
182 
187  UHD_INLINE reg_data_t get(const soft_reg_field_t field)
188  {
189  return (_soft_copy & soft_reg_field::mask<reg_data_t>(field)) >> soft_reg_field::shift(field);
190  }
191 
196  {
197  if (writable && _iface) {
198  //If optimized flush then poke only if soft copy is dirty
199  //If flush mode is ALWAYS, the dirty flag should get optimized
200  //out by the compiler because it is never read
201  if (_flush_mode == ALWAYS_FLUSH || _soft_copy.is_dirty()) {
202  if (get_bitwidth() <= 16) {
203  _iface->poke16(_wr_addr, static_cast<uint16_t>(_soft_copy));
204  } else if (get_bitwidth() <= 32) {
205  _iface->poke32(_wr_addr, static_cast<uint32_t>(_soft_copy));
206  } else if (get_bitwidth() <= 64) {
207  _iface->poke64(_wr_addr, static_cast<uint64_t>(_soft_copy));
208  } else {
209  throw uhd::not_implemented_error("soft_register only supports up to 64 bits.");
210  }
211  _soft_copy.mark_clean();
212  }
213  } else {
214  throw uhd::not_implemented_error("soft_register is not writable or uninitialized.");
215  }
216  }
217 
222  {
223  if (readable && _iface) {
224  if (get_bitwidth() <= 16) {
225  _soft_copy = static_cast<reg_data_t>(_iface->peek16(_rd_addr));
226  } else if (get_bitwidth() <= 32) {
227  _soft_copy = static_cast<reg_data_t>(_iface->peek32(_rd_addr));
228  } else if (get_bitwidth() <= 64) {
229  _soft_copy = static_cast<reg_data_t>(_iface->peek64(_rd_addr));
230  } else {
231  throw uhd::not_implemented_error("soft_register only supports up to 64 bits.");
232  }
233  _soft_copy.mark_clean();
234  } else {
235  throw uhd::not_implemented_error("soft_register is not readable or uninitialized.");
236  }
237  }
238 
242  UHD_INLINE void write(const soft_reg_field_t field, const reg_data_t value)
243  {
244  set(field, value);
245  flush();
246  }
247 
251  UHD_INLINE reg_data_t read(const soft_reg_field_t field)
252  {
253  refresh();
254  return get(field);
255  }
256 
261  {
262  static const size_t BITS_IN_BYTE = 8;
263  return sizeof(reg_data_t) * BITS_IN_BYTE;
264  }
265 
270  {
271  return readable;
272  }
273 
278  {
279  return writable;
280  }
281 
282 private:
283  wb_iface* _iface;
284  const wb_iface::wb_addr_type _wr_addr;
285  const wb_iface::wb_addr_type _rd_addr;
286  dirty_tracked<reg_data_t> _soft_copy;
287  const soft_reg_flush_mode_t _flush_mode;
288 };
289 
294 template<typename reg_data_t, bool readable, bool writable>
295 class UHD_API soft_register_sync_t : public soft_register_t<reg_data_t, readable, writable> {
296 public:
297  typedef boost::shared_ptr< soft_register_sync_t<reg_data_t, readable, writable> > sptr;
298 
300  wb_iface::wb_addr_type wr_addr,
301  wb_iface::wb_addr_type rd_addr,
302  soft_reg_flush_mode_t mode = ALWAYS_FLUSH):
303  soft_register_t<reg_data_t, readable, writable>(wr_addr, rd_addr, mode), _mutex()
304  {}
305 
308  soft_reg_flush_mode_t mode = ALWAYS_FLUSH):
309  soft_register_t<reg_data_t, readable, writable>(addr, mode), _mutex()
310  {}
311 
312  UHD_INLINE void initialize(wb_iface& iface, bool sync = false)
313  {
314  boost::lock_guard<boost::mutex> lock(_mutex);
316  }
317 
318  UHD_INLINE void set(const soft_reg_field_t field, const reg_data_t value)
319  {
320  boost::lock_guard<boost::mutex> lock(_mutex);
322  }
323 
324  UHD_INLINE reg_data_t get(const soft_reg_field_t field)
325  {
326  boost::lock_guard<boost::mutex> lock(_mutex);
328  }
329 
331  {
332  boost::lock_guard<boost::mutex> lock(_mutex);
334  }
335 
337  {
338  boost::lock_guard<boost::mutex> lock(_mutex);
340  }
341 
342  UHD_INLINE void write(const soft_reg_field_t field, const reg_data_t value)
343  {
344  boost::lock_guard<boost::mutex> lock(_mutex);
346  }
347 
348  UHD_INLINE reg_data_t read(const soft_reg_field_t field)
349  {
350  boost::lock_guard<boost::mutex> lock(_mutex);
352  }
353 
354 private:
355  boost::mutex _mutex;
356 };
357 
358 /*
359  * Register Shortcut Formats:
360  * - soft_reg<bits>_<mode>_t: Soft register object with an unsynchronized soft-copy.
361  * Thread unsafe but lightweight. Mostly const propagated.
362  * - soft_reg<bits>_<mode>_sync_t: Soft register object with a synchronized soft-copy.
363  * Thread safe but with memory/speed overhead.
364  * where:
365  * - <bits> = {16, 32 or 64}
366  * - <mode> = {wo(write-only), rw(read-write) or ro(read-only)}
367  *
368  */
369 
370 //16-bit shortcuts
377 //32-bit shortcuts
384 //64-bit shortcuts
391 
392 
393 /*
394  * Usage example
395  *
396  //===Define bit width, RW mode, and synchronization using base class===
397  class example_reg_t : public soft_reg32_wo_sync_t (or soft_reg32_wo_t) {
398  public:
399  //===Define all the fields===
400  UHD_DEFINE_SOFT_REG_FIELD(FIELD0, 1, 0); //[0]
401  UHD_DEFINE_SOFT_REG_FIELD(FIELD1, 15, 1); //[15:1]
402  UHD_DEFINE_SOFT_REG_FIELD(FIELD2, 16, 16); //[31:16]
403 
404  example_reg_t(): //ctor with no args
405  soft_reg32_wo_t(SR_CORE_EXAMPLE_REG_OFFSET)) //===Bind to offset===
406  {
407  //===Set Initial values===
408  set(FIELD0, 0);
409  set(FIELD1, 1);
410  set(FIELD2, 0xFFFF);
411  }
412  }; //===Full register definition encapsulated in one class===
413 
414  void main() {
415  example_reg_t reg_obj;
416  reg_obj.initialize(iface);
417  reg_obj.write(example_reg_t::FIELD2, 0x1234);
418 
419  example_reg_t::sptr reg_sptr = boost::make_shared<example_reg_t>();
420  reg_obj->initialize(iface);
421  reg_obj->write(example_reg_t::FIELD2, 0x1234);
422  }
423 */
424 }
425 
426 //==================================================================
427 // Soft Register Map and Database Definition
428 //==================================================================
429 
430 namespace uhd {
431 
433 public:
434  typedef boost::shared_ptr<soft_regmap_accessor_t> sptr;
435 
437  virtual soft_register_base& lookup(const std::string& path) const = 0;
438  virtual std::vector<std::string> enumerate() const = 0;
439  virtual const std::string& get_name() const = 0;
440 };
441 
452 class UHD_API soft_regmap_t : public soft_regmap_accessor_t, public boost::noncopyable {
453 public:
454  soft_regmap_t(const std::string& name) : _name(name) {}
455  virtual ~soft_regmap_t() {};
456 
460  virtual UHD_INLINE const std::string& get_name() const { return _name; }
461 
468  void initialize(wb_iface& iface, bool sync = false) {
469  boost::lock_guard<boost::mutex> lock(_mutex);
470  BOOST_FOREACH(soft_register_base* reg, _reglist) {
471  reg->initialize(iface, sync);
472  }
473  }
474 
480  void flush() {
481  boost::lock_guard<boost::mutex> lock(_mutex);
482  BOOST_FOREACH(soft_register_base* reg, _reglist) {
483  reg->flush();
484  }
485  }
486 
492  void refresh() {
493  boost::lock_guard<boost::mutex> lock(_mutex);
494  BOOST_FOREACH(soft_register_base* reg, _reglist) {
495  reg->refresh();
496  }
497  }
498 
503  virtual soft_register_base& lookup(const std::string& name) const {
504  regmap_t::const_iterator iter = _regmap.find(name);
505  if (iter != _regmap.end()) {
506  return *(iter->second);
507  } else {
508  throw uhd::runtime_error("register not found in map: " + name);
509  }
510  }
511 
516  virtual std::vector<std::string> enumerate() const {
517  std::vector<std::string> temp;
518  BOOST_FOREACH(const regmap_t::value_type& reg, _regmap) {
519  temp.push_back(_name + "/" + reg.first);
520  }
521  return temp;
522  }
523 
524 protected:
526  PUBLIC, //Is accessible through the soft_regmap_accessor_t interface
527  PRIVATE //Is NOT accessible through the soft_regmap_accessor_t interface
528  };
529 
533  UHD_INLINE void add_to_map(soft_register_base& reg, const std::string& name, const visibility_t visible = PRIVATE) {
534  boost::lock_guard<boost::mutex> lock(_mutex);
535  if (visible == PUBLIC) {
536  //Only add to the map if this register is publicly visible
537  if (not _regmap.insert(regmap_t::value_type(name, &reg)).second) {
538  throw uhd::assertion_error("cannot add two registers with the same name to regmap: " + name);
539  }
540  }
541  _reglist.push_back(&reg);
542  }
543 
544 private:
545  typedef boost::unordered_map<std::string, soft_register_base*> regmap_t;
546  typedef std::list<soft_register_base*> reglist_t;
547 
548  const std::string _name;
549  regmap_t _regmap; //For lookups
550  reglist_t _reglist; //To maintain order
551  boost::mutex _mutex;
552 };
553 
554 
561 class UHD_API soft_regmap_db_t : public soft_regmap_accessor_t, public boost::noncopyable {
562 public:
563  typedef boost::shared_ptr<soft_regmap_db_t> sptr;
564 
568  soft_regmap_db_t() : _name("") {}
569 
573  soft_regmap_db_t(const std::string& name) : _name(name) {}
574 
578  const std::string& get_name() const { return _name; }
579 
583  void add(soft_regmap_t& regmap) {
584  boost::lock_guard<boost::mutex> lock(_mutex);
585  _regmaps.push_back(&regmap);
586  }
587 
591  void add(soft_regmap_db_t& db) {
592  boost::lock_guard<boost::mutex> lock(_mutex);
593  if (&db == this) {
594  throw uhd::assertion_error("cannot add regmap db to itself" + _name);
595  } else {
596  _regmap_dbs.push_back(&db);
597  }
598  }
599 
610  soft_register_base& lookup(const std::string& path) const
611  {
612  //Turn the slash separated path string into tokens
613  std::list<std::string> tokens;
614  BOOST_FOREACH(
615  const std::string& node,
616  boost::tokenizer< boost::char_separator<char> >(path, boost::char_separator<char>("/")))
617  {
618  tokens.push_back(node);
619  }
620  if ((tokens.size() > 2 && tokens.front() == _name) || //If this is a nested DB
621  (tokens.size() > 1 && _name == "")) { //If this is a top-level DB
622  if (_name != "") tokens.pop_front();
623  if (tokens.size() == 2) { //2 tokens => regmap/register path
624  BOOST_FOREACH(const soft_regmap_accessor_t* regmap, _regmaps) {
625  if (regmap->get_name() == tokens.front()) {
626  return regmap->lookup(tokens.back());
627  }
628  }
629  throw uhd::runtime_error("could not find register map: " + path);
630  } else if (not _regmap_dbs.empty()) { //>2 tokens => <1 or more dbs>/regmap/register
631  //Reconstruct path from tokens
632  std::string newpath;
633  BOOST_FOREACH(const std::string& node, tokens) {
634  newpath += ("/" + node);
635  }
636  //Dispatch path to hierarchical DB
637  BOOST_FOREACH(const soft_regmap_accessor_t* db, _regmap_dbs) {
638  try {
639  return db->lookup(newpath.substr(1));
640  } catch (std::exception&) {
641  continue;
642  }
643  }
644  }
645  }
646  throw uhd::runtime_error("could not find register: " + path);
647  }
648 
652  virtual std::vector<std::string> enumerate() const {
653  std::vector<std::string> paths;
654  BOOST_FOREACH(const soft_regmap_accessor_t* regmap, _regmaps) {
655  const std::vector<std::string>& regs = regmap->enumerate();
656  paths.insert(paths.end(), regs.begin(), regs.end());
657  }
658  BOOST_FOREACH(const soft_regmap_accessor_t* db, _regmap_dbs) {
659  const std::vector<std::string>& regs = db->enumerate();
660  paths.insert(paths.end(), regs.begin(), regs.end());
661  }
662  return paths;
663  }
664 
665 private:
666  typedef std::list<soft_regmap_accessor_t*> db_t;
667 
668  const std::string _name;
669  db_t _regmaps;
670  db_t _regmap_dbs;
671  boost::mutex _mutex;
672 };
673 
674 } //namespace uhd
675 
676 #endif /* INCLUDED_UHD_UTILS_SOFT_REGISTER_HPP */
void refresh()
Definition: soft_register.hpp:492
soft_register_sync_t< uint16_t, false, true > soft_reg16_wo_sync_t
Definition: soft_register.hpp:374
uint32_t soft_reg_field_t
Definition: soft_register.hpp:74
UHD_INLINE void flush()
Definition: soft_register.hpp:195
Definition: soft_register.hpp:123
soft_reg_flush_mode_t
Definition: soft_register.hpp:123
boost::shared_ptr< soft_register_t< reg_data_t, readable, writable > > sptr
Definition: soft_register.hpp:133
Definition: soft_register.hpp:295
virtual void flush()=0
Definition: exception.hpp:105
soft_regmap_t(const std::string &name)
Definition: soft_register.hpp:454
UHD_INLINE bool unlikely(bool expr)
hint for the branch prediction
Definition: soft_register.hpp:58
UHD_INLINE void refresh()
Definition: soft_register.hpp:221
soft_register_t< uint64_t, false, true > soft_reg64_wo_t
Definition: soft_register.hpp:385
virtual std::vector< std::string > enumerate() const
Definition: soft_register.hpp:516
soft_register_t(wb_iface::wb_addr_type addr, soft_reg_flush_mode_t mode=ALWAYS_FLUSH)
Definition: soft_register.hpp:152
#define UHD_DEFINE_SOFT_REG_FIELD(name, width, shift)
Definition: soft_register.hpp:40
soft_register_t< uint32_t, true, false > soft_reg32_ro_t
Definition: soft_register.hpp:379
UHD_INLINE size_t get_bitwidth()
Definition: soft_register.hpp:260
virtual soft_register_base & lookup(const std::string &name) const
Definition: soft_register.hpp:503
soft_register_sync_t(wb_iface::wb_addr_type addr, soft_reg_flush_mode_t mode=ALWAYS_FLUSH)
Definition: soft_register.hpp:306
UHD_INLINE bool is_writable()
Definition: soft_register.hpp:277
soft_register_sync_t< uint64_t, true, true > soft_reg64_rw_sync_t
Definition: soft_register.hpp:390
Definition: exception.hpp:90
Definition: soft_register.hpp:561
virtual std::vector< std::string > enumerate() const
Definition: soft_register.hpp:652
soft_register_sync_t< uint32_t, false, true > soft_reg32_wo_sync_t
Definition: soft_register.hpp:381
soft_register_t< uint32_t, false, true > soft_reg32_wo_t
Definition: soft_register.hpp:378
UHD_INLINE size_t width(const soft_reg_field_t field)
Definition: soft_register.hpp:77
Definition: soft_register.hpp:526
UHD_INLINE void set(const soft_reg_field_t field, const reg_data_t value)
Definition: soft_register.hpp:177
soft_regmap_db_t(const std::string &name)
Definition: soft_register.hpp:573
virtual ~soft_regmap_accessor_t()
Definition: soft_register.hpp:436
Definition: soft_register.hpp:131
UHD_INLINE reg_data_t get(const soft_reg_field_t field)
Definition: soft_register.hpp:187
Definition: build_info.hpp:14
soft_regmap_db_t()
Definition: soft_register.hpp:568
UHD_INLINE void write(const soft_reg_field_t field, const reg_data_t value)
Definition: soft_register.hpp:342
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:100
void flush()
Definition: soft_register.hpp:480
visibility_t
Definition: soft_register.hpp:525
UHD_INLINE void initialize(wb_iface &iface, bool sync=false)
Definition: soft_register.hpp:163
virtual void refresh()=0
boost::shared_ptr< soft_register_sync_t< reg_data_t, readable, writable > > sptr
Definition: soft_register.hpp:297
void initialize(wb_iface &iface, bool sync=false)
Definition: soft_register.hpp:468
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:389
virtual ~soft_regmap_t()
Definition: soft_register.hpp:455
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:299
boost::shared_ptr< soft_regmap_accessor_t > sptr
Definition: soft_register.hpp:434
Definition: soft_register.hpp:432
UHD_INLINE bool is_readable()
Definition: soft_register.hpp:269
#define UHD_INLINE
Definition: config.h:52
UHD_INLINE void flush()
Definition: soft_register.hpp:330
UHD_INLINE reg_data_t read(const soft_reg_field_t field)
Definition: soft_register.hpp:251
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:141
soft_register_t< uint64_t, true, false > soft_reg64_ro_t
Definition: soft_register.hpp:386
boost::shared_ptr< soft_regmap_db_t > sptr
Definition: soft_register.hpp:563
Definition: soft_register.hpp:452
Definition: soft_register.hpp:98
soft_register_sync_t< uint32_t, true, false > soft_reg32_ro_sync_t
Definition: soft_register.hpp:382
Definition: exception.hpp:41
#define UHD_API
Definition: config.h:62
UHD_INLINE data_t mask(const soft_reg_field_t field)
Definition: soft_register.hpp:86
void add(soft_regmap_t &regmap)
Definition: soft_register.hpp:583
UHD_INLINE reg_data_t read(const soft_reg_field_t field)
Definition: soft_register.hpp:348
const std::string & get_name() const
Definition: soft_register.hpp:578
UHD_INLINE void refresh()
Definition: soft_register.hpp:336
soft_register_t< uint64_t, true, true > soft_reg64_rw_t
Definition: soft_register.hpp:387
UHD_INLINE void write(const soft_reg_field_t field, const reg_data_t value)
Definition: soft_register.hpp:242
soft_register_t< uint16_t, true, true > soft_reg16_rw_t
Definition: soft_register.hpp:373
Definition: exception.hpp:69
void add(soft_regmap_db_t &db)
Definition: soft_register.hpp:591
virtual void initialize(wb_iface &iface, bool sync=false)=0
soft_register_base & lookup(const std::string &path) const
Definition: soft_register.hpp:610
soft_register_sync_t< uint16_t, true, true > soft_reg16_rw_sync_t
Definition: soft_register.hpp:376
soft_register_sync_t< uint64_t, false, true > soft_reg64_wo_sync_t
Definition: soft_register.hpp:388
UHD_INLINE void initialize(wb_iface &iface, bool sync=false)
Definition: soft_register.hpp:312
soft_register_t< uint16_t, false, true > soft_reg16_wo_t
Definition: soft_register.hpp:371
UHD_INLINE bool likely(bool expr)
hint for the branch prediction
Definition: soft_register.hpp:48
soft_register_sync_t< uint32_t, true, true > soft_reg32_rw_sync_t
Definition: soft_register.hpp:383
virtual UHD_INLINE const std::string & get_name() const
Definition: soft_register.hpp:460
UHD_INLINE void add_to_map(soft_register_base &reg, const std::string &name, const visibility_t visible=PRIVATE)
Definition: soft_register.hpp:533
UHD_INLINE size_t shift(const soft_reg_field_t field)
Definition: soft_register.hpp:81
Definition: soft_register.hpp:123
uint32_t wb_addr_type
Definition: wb_iface.hpp:22
static UHD_INLINE soft_reg_t & cast(soft_register_base &reg)
Definition: soft_register.hpp:113
Definition: wb_iface.hpp:18
soft_register_t< uint16_t, true, false > soft_reg16_ro_t
Definition: soft_register.hpp:372
soft_register_sync_t< uint16_t, true, false > soft_reg16_ro_sync_t
Definition: soft_register.hpp:375
soft_register_t< uint32_t, true, true > soft_reg32_rw_t
Definition: soft_register.hpp:380