28 inline operator T()
const {
return fpcptr->template scalarToCooked<T>(*
buffer); }
92 auto* basePtr =
reinterpret_cast<std::byte*
>(
buffer);
93 auto* startAddress = basePtr +
static_cast<size_t>(
pitch) * sample;
140 :
_dev(dev),
_path(module +
"/" + name),
fpc(module +
"/" + name) {
231 :
_dev(dev),
_path(module +
"/" + name) {
239 assert(c.bitOffset % 8 == 0);
241 nbytes.push_back((c.width - 1) / 8 + 1);
277 auto* seq =
reinterpret_cast<int32_t*
>(basePtr +
offsets[sequence]);
300 std::vector<FixedPointConverter<DEPRECATED_FIXEDPOINT_DEFAULT>>
fpc;
333 boost::shared_ptr<DeviceBackend>
const& backend, std::string
const& module, std::string
const& name)
The dummy device opens a mapping file instead of a device, and implements all registers defined in th...
void setWriteCallbackFunction(AddressRange addressRange, boost::function< void(void)> const &writeCallbackFunction)
std::map< uint64_t, std::vector< int32_t > > _barContents
Register accessor for accessing multiplexed 2D array registers internally of a DummyBackend implement...
DummyMultiplexedRegisterAccessor(DummyBackend *dev, std::string const &module, std::string const &name)
Constructor should normally be called in the constructor of the DummyBackend implementation.
DummyBackend * _dev
pointer to VirtualDevice
int pitch
pitch in bytes (distance between samples of the same sequence)
DummyBackend & getBackend() const
Return the backend.
RegisterPath _path
path of the register
unsigned int getNumberOfSequences()
return number of sequences
const RegisterPath & getRegisterPath() const
Return the register path.
const NumericAddressedRegisterInfo & getRegisterInfo()
DummyMultiplexedRegisterAccessor(const DummyMultiplexedRegisterAccessor &)=default
std::vector< FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > > fpc
pointer to fixed point converter
void operator=(const DummyMultiplexedRegisterAccessor &rightHandSide) const =delete
remove assignment operator since it will be confusing
unsigned int nElements
number of elements per sequence
unsigned int getNumberOfElements()
return number of elements per sequence
std::vector< uint32_t > nbytes
number of bytes per word for sequences
proxies::DummyRegisterSequence< T > operator[](unsigned int sequence)
Get or set register content by [] operators.
std::vector< uint32_t > offsets
offsets in bytes for sequences
NumericAddressedRegisterInfo registerInfo
register map information
Register accessor for accessing single word or 1D array registers internally of a DummyBackend implem...
DummyBackend * _dev
pointer to VirtualDevice
DummyRegisterAccessor(const DummyRegisterAccessor &)=default
DummyBackend & getBackend() const
Return the backend.
void operator=(const DummyRegisterAccessor &rightHandSide) const =delete
remove assignment operator since it will be confusing */
const RegisterPath & getRegisterPath() const
Return the register path.
int32_t * getElement(unsigned int index)
return element
unsigned int getNumberOfElements()
return number of elements
FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > fpc
fixed point converter
RegisterPath _path
path of the register
proxies::DummyRegisterElement< T > operator[](unsigned int index)
Get or set register content by [] operator.
proxies::DummyRegisterElement< T > getProxy(int index)
return a proxy object
DummyRegisterAccessor(DummyBackend *dev, std::string const &module, std::string const &name)
Constructor should normally be called in the constructor of the DummyBackend implementation.
const NumericAddressedRegisterInfo & getRegisterInfo()
void setWriteCallback(const std::function< void()> &writeCallback)
Set callback function which is called when the register is written to (through the normal Device inte...
std::unique_lock< std::mutex > getBufferLock()
Get a lock to safely modify the buffer in a multi-treaded environment.
NumericAddressedRegisterInfo registerInfo
register map information
Accessor for raw 32 bit integer access to the underlying memory space.
void operator=(const DummyRegisterRawAccessor &rightHandSide) const =delete
remove assignment operator since it will be confusing
DummyRegisterRawAccessor(boost::shared_ptr< DeviceBackend > const &backend, std::string const &module, std::string const &name)
int32_t * buffer
raw buffer of this accessor
unsigned int getNumberOfElements() const
return number of elements
boost::shared_ptr< DummyBackend > _backend
pointer to dummy backend
int32_t & operator[](unsigned int index)
Get or set register content by [] operator.
DummyRegisterRawAccessor(const DummyRegisterRawAccessor &)=default
NumericAddressedRegisterInfo registerInfo
register map information
std::unique_lock< std::mutex > getBufferLock()
Get a lock to safely modify the buffer.
DummyRegisterRawAccessor & operator=(int32_t rhs)
The fixed point converter provides conversion functions between a user type and up to 32 bit fixed po...
RawType toRaw(UserType cookedValue) const
Conversion function from type T to fixed point.
NumericAddressedRegisterCatalogue & _registerMap
NumericAddressedRegisterInfo getBackendRegister(const RegisterPath ®isterPathName) const override
Note: Override this function if backend has "hidden" registers which are not added to the map and hen...
uint32_t nElements
Number of elements in register.
std::vector< ChannelInfo > channels
Define per-channel information (bit interpretation etc.), 1D/scalars have exactly one entry.
uint64_t bar
Upper part of the address (name originally from PCIe, meaning now generalised)
uint32_t elementPitchBits
Distance in bits (!) between two elements (of the same channel)
uint64_t address
Lower part of the address relative to BAR, in bytes.
Class to store a register path name.
Exception thrown when a logic error has occured.
Temporary proxy class for use in the DummyRegister and DummyMultiplexedRegister classes.
DummyRegisterElement(FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > *_fpc, int _nbytes, int32_t *_buffer)
DummyRegisterElement< T > & operator=(T rhs)
assignment operator
DummyRegisterElement< T > operator++()
pre-increment operator
T operator++(int)
post-increment operator
DummyRegisterElement()
constructor when used as a base class in DummyRegister
T operator--(int)
post-decrement operator
DummyRegisterElement< T > operator--()
pre-decrement operator
FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > * fpcptr
fixed point converter to be used for this element
int32_t * buffer
raw buffer of this element
int nbytes
number of bytes per word
Temporary proxy class for sequences, used in the DummyMultiplexedRegister class.
int32_t * buffer
reference to the raw buffer (first word of the sequence)
int pitch
pitch in bytes (distance between samples of the same sequence)
DummyRegisterElement< T > operator[](unsigned int sample)
Get or set register content by [] operator.
DummyRegisterSequence(FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > *_fpc, int _nbytes, int _pitch, int32_t *_buffer)
int nbytes
number of bytes per word
FixedPointConverter< DEPRECATED_FIXEDPOINT_DEFAULT > * fpcptr
fixed point converter to be used for this sequence
void operator=(const DummyRegisterSequence &rightHandSide) const =delete
remove assignment operator since it will be confusing */
@ raw
Raw access: disable any possible conversion from the original hardware data type into the given UserT...