17#ifndef __ROGUE_INTERFACES_MEMORY_VARIABLE_H__
18#define __ROGUE_INTERFACES_MEMORY_VARIABLE_H__
32 #include <boost/python.hpp>
43typedef std::shared_ptr<rogue::interfaces::memory::Variable>
VariablePtr;
295 std::vector<uint32_t> bitOffset,
296 std::vector<uint32_t> bitSize,
346 std::vector<uint32_t> bitOffset,
347 std::vector<uint32_t> bitSize,
414 const std::string&
name()
const {
427 const std::string&
mode()
const {
432 const std::string&
path()
const {
551 void setUInt(uint64_t& value, int32_t index = -1);
559 void setValue(uint64_t value, int32_t index = -1) {
573 uint64_t
getUInt(int32_t index = -1);
581 void getValue(uint64_t& valueRet, int32_t index = -1) {
599 void setInt(int64_t& value, int32_t index = -1);
621 int64_t
getInt(int32_t index = -1);
629 void getValue(int64_t& valueRet, int32_t index = -1) {
647 void setBool(
bool& value, int32_t index = -1);
669 bool getBool(int32_t index = -1);
677 void getValue(
bool& valueRet, int32_t index = -1) {
695 void setString(
const std::string& value, int32_t index = -1);
703 void setValue(
const std::string& value, int32_t index = -1) {
717 std::string
getString(int32_t index = -1);
725 void getString(std::string& retString, int32_t index = -1) {
735 void getValue(std::string& valueRet, int32_t index = -1);
751 void setFloat(
float& value, int32_t index = -1);
781 void getValue(
float& valueRet, int32_t index = -1) {
799 void setDouble(
double& value, int32_t index = -1);
829 void getValue(
double& valueRet, int32_t index = -1) {
848 void setFixed(
double& value, int32_t index = -1);
860 double getFixed(int32_t index = -1);
874 public boost::python::wrapper<rogue::interfaces::memory::Variable> {
875 boost::python::object model_;
906 boost::python::object model,
907 boost::python::object listData,
927 void set(boost::python::object& value, int32_t index);
940 boost::python::object
get(int32_t index);
947 boost::python::object
toBytes(boost::python::object& value);
954 boost::python::object
fromBytes(boost::python::object& value);
982 boost::python::object
bitSize();
Memory interface block device.
Internal Boost.Python wrapper for rogue::interfaces::memory::Variable. Enables Python subclasses to o...
boost::python::object get(int32_t index)
Gets value from RemoteVariable.
boost::python::object fromBytes(boost::python::object &value)
Converts a byte representation to a Python value object.
void defQueueUpdate()
Calls the base-class queueUpdate() implementation.
void queueUpdate()
Dispatches queue update callback.
boost::python::object bitOffset()
Returns bit-offset configuration.
boost::python::object bitSize()
Returns bit-size configuration.
void updateOffset(boost::python::object &bitOffset)
Updates bit-offset definition from Python.
void set(boost::python::object &value, int32_t index)
Sets value from RemoteVariable.
boost::python::object toBytes(boost::python::object &value)
Converts a Python value object to a byte representation.
Memory variable descriptor and typed accessor facade.
void(rogue::interfaces::memory::Block::* setByteArray_)(const uint8_t *, rogue::interfaces::memory::Variable *, int32_t index)
virtual ~Variable()
Destroys the variable instance.
void getValue(bool &valueRet, int32_t index=-1)
Gets boolean value into output reference.
boost::python::object(rogue::interfaces::memory::Block::* getFuncPy_)(rogue::interfaces::memory::Variable *, int32_t index)
void setLogLevel(uint32_t level)
Sets logging level for variable's block.
void(rogue::interfaces::memory::Block::* getByteArray_)(uint8_t *, rogue::interfaces::memory::Variable *, int32_t index)
static rogue::interfaces::memory::VariablePtr create(std::string name, std::string mode, double minimum, double maximum, uint64_t offset, std::vector< uint32_t > bitOffset, std::vector< uint32_t > bitSize, bool overlapEn, bool verify, bool bulkOpEn, bool updateNotify, uint32_t modelId, bool byteReverse, bool bitReverse, uint32_t binPoint, uint32_t numValues, uint32_t valueBits, uint32_t valueStride, uint32_t retryCount)
Creates a memory variable descriptor.
int64_t(rogue::interfaces::memory::Block::* getInt_)(rogue::interfaces::memory::Variable *, int32_t index)
double getDouble(int32_t index=-1)
Gets double value.
void setValue(float value, int32_t index=-1)
Convenience alias for setFloat.
uint32_t retryCount()
Returns retry count.
uint64_t offset()
Returns variable byte offset.
void setValue(int64_t value, int32_t index=-1)
Convenience alias for setInt.
void getValue(float &valueRet, int32_t index=-1)
Gets float value into output reference.
void getValue(int64_t &valueRet, int32_t index=-1)
Gets signed integer value into output reference.
uint32_t modelId() const
Returns model ID of the variable.
bool getBool(int32_t index=-1)
Gets boolean value.
float getFloat(int32_t index=-1)
Gets float value.
void setFixed(double &value, int32_t index=-1)
Sets fixed-point value.
double(rogue::interfaces::memory::Block::* getDouble_)(rogue::interfaces::memory::Variable *, int32_t index)
const std::string & mode() const
Returns variable mode string.
uint32_t bitTotal() const
Returns total number of bits for this value.
virtual void queueUpdate()
Executes queue update callback (unused in C++).
void(rogue::interfaces::memory::Block::* setFuncPy_)(boost::python::object &, rogue::interfaces::memory::Variable *, int32_t index)
bool verifyEn()
Returns verify-enable flag.
uint32_t varBytes()
Returns variable range in bytes.
void getValue(double &valueRet, int32_t index=-1)
Gets double value into output reference.
bool bulkOpEn()
Returns bulk-operation enable flag.
void(rogue::interfaces::memory::Block::* setDouble_)(const double &, rogue::interfaces::memory::Variable *, int32_t index)
rogue::interfaces::memory::Block * block_
void read()
Performs a read operation for this variable.
float(rogue::interfaces::memory::Block::* getFloat_)(rogue::interfaces::memory::Variable *, int32_t index)
void(rogue::interfaces::memory::Block::* setUInt_)(const uint64_t &, rogue::interfaces::memory::Variable *, int32_t index)
uint64_t getUInt(int32_t index=-1)
Gets unsigned integer value.
void setFloat(float &value, int32_t index=-1)
Sets float value.
void(rogue::interfaces::memory::Block::* setFloat_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
void(rogue::interfaces::memory::Block::* setInt_)(const int64_t &, rogue::interfaces::memory::Variable *, int32_t index)
double maximum()
Returns maximum value.
int64_t getInt(int32_t index=-1)
Gets signed integer value.
double getFixed(int32_t index=-1)
Gets fixed-point value.
std::string(rogue::interfaces::memory::Block::* getString_)(rogue::interfaces::memory::Variable *, int32_t index)
double minimum()
Returns minimum value.
bool(rogue::interfaces::memory::Block::* getBool_)(rogue::interfaces::memory::Variable *, int32_t index)
void setInt(int64_t &value, int32_t index=-1)
Sets signed integer value.
bool overlapEn()
Returns overlap-enable flag.
void setByteArray(uint8_t *value, int32_t index=-1)
Sets value from a raw byte array.
std::vector< uint32_t > bitSize_
void(rogue::interfaces::memory::Block::* setFixed_)(const double &, rogue::interfaces::memory::Variable *, int32_t index)
void setDouble(double &value, int32_t index=-1)
Sets double value.
uint32_t valueBits()
Returns number of bits per value.
std::string getString(int32_t index=-1)
Gets string value.
void(rogue::interfaces::memory::Block::* setString_)(const std::string &, rogue::interfaces::memory::Variable *, int32_t index)
uint32_t byteSize() const
Returns total bytes (rounded up) for this value.
void setString(const std::string &value, int32_t index=-1)
Sets string value.
void updatePath(std::string path)
Updates the hierarchical path string for this variable.
void setUInt(uint64_t &value, int32_t index=-1)
Sets an unsigned integer value.
void setBool(bool &value, int32_t index=-1)
Sets boolean value.
void setValue(const std::string &value, int32_t index=-1)
Convenience alias for setString.
uint32_t numValues()
Returns number of values.
std::string getDumpValue(bool read)
Returns string representation of value using default converters.
void getString(std::string &retString, int32_t index=-1)
Gets string value into output reference.
void setValue(double value, int32_t index=-1)
Convenience alias for setDouble.
const std::string & path() const
Returns variable path.
void getValue(uint64_t &valueRet, int32_t index=-1)
Gets unsigned integer value into output reference.
void(rogue::interfaces::memory::Block::* setBool_)(const bool &, rogue::interfaces::memory::Variable *, int32_t index)
double(rogue::interfaces::memory::Block::* getFixed_)(rogue::interfaces::memory::Variable *, int32_t index)
void rateTest()
Runs a local throughput benchmark for variable get/set operations.
static void setup_python()
Registers Python bindings for this class.
uint32_t valueStride()
Returns byte stride per value.
void shiftOffsetDown(uint32_t shift, uint32_t minSize)
Shifts variable offset and packed bit fields downward.
const std::string & name() const
Returns variable name.
uint32_t valueBytes()
Returns number of bytes per value.
std::vector< uint32_t > bitOffset_
void setValue(bool value, int32_t index=-1)
Convenience alias for setBool.
uint64_t(rogue::interfaces::memory::Block::* getUInt_)(rogue::interfaces::memory::Variable *, int32_t index)
void setValue(uint64_t value, int32_t index=-1)
Convenience alias for setUInt.
void getByteArray(uint8_t *value, int32_t index=-1)
Gets value into a raw byte array.
std::shared_ptr< rogue::interfaces::memory::VariableWrap > VariableWrapPtr
std::shared_ptr< rogue::interfaces::memory::Variable > VariablePtr