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;
355 std::vector<uint32_t> bitOffset,
356 std::vector<uint32_t> bitSize,
406 std::vector<uint32_t> bitOffset,
407 std::vector<uint32_t> bitSize,
474 const std::string&
name()
const {
487 const std::string&
mode()
const {
492 const std::string&
path()
const {
611 void setUInt(uint64_t& value, int32_t index = -1);
619 void setValue(uint64_t value, int32_t index = -1) {
633 uint64_t
getUInt(int32_t index = -1);
641 void getValue(uint64_t& valueRet, int32_t index = -1) {
659 void setInt(int64_t& value, int32_t index = -1);
681 int64_t
getInt(int32_t index = -1);
689 void getValue(int64_t& valueRet, int32_t index = -1) {
707 void setBool(
bool& value, int32_t index = -1);
729 bool getBool(int32_t index = -1);
737 void getValue(
bool& valueRet, int32_t index = -1) {
755 void setString(
const std::string& value, int32_t index = -1);
763 void setValue(
const std::string& value, int32_t index = -1) {
777 std::string
getString(int32_t index = -1);
785 void getString(std::string& retString, int32_t index = -1) {
795 void getValue(std::string& valueRet, int32_t index = -1);
811 void setFloat(
float& value, int32_t index = -1);
841 void getValue(
float& valueRet, int32_t index = -1) {
860 void setFloat16(
float& value, int32_t index = -1);
889 void setFloat8(
float& value, int32_t index = -1);
918 void setBFloat16(
float& value, int32_t index = -1);
976 void setFloat6(
float& value, int32_t index = -1);
1000 void setFloat4(
float& value, int32_t index = -1);
1024 void setDouble(
double& value, int32_t index = -1);
1073 void setFixed(
double& value, int32_t index = -1);
1085 double getFixed(int32_t index = -1);
1099 public boost::python::wrapper<rogue::interfaces::memory::Variable> {
1100 boost::python::object model_;
1122 boost::python::object
minimum,
1123 boost::python::object
maximum,
1126 boost::python::object
bitSize,
1131 boost::python::object model,
1132 boost::python::object listData,
1152 void set(boost::python::object& value, int32_t index);
1165 boost::python::object
get(int32_t index);
1172 boost::python::object
toBytes(boost::python::object& value);
1179 boost::python::object
fromBytes(boost::python::object& value);
1207 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.
float getFloat8(int32_t index=-1)
Gets 8-bit E4M3 float value.
float getFloat6(int32_t index=-1)
Gets 6-bit E3M2 float value.
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)
void(rogue::interfaces::memory::Block::* setFloat4_)(const float &, 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.
void(rogue::interfaces::memory::Block::* setFloat8_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
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 setTensorFloat32(float &value, int32_t index=-1)
Sets TensorFloat32 value.
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 getFloat16(int32_t index=-1)
Gets half-precision float value.
float getFloat(int32_t index=-1)
Gets float value.
void setFloat6(float &value, int32_t index=-1)
Sets 6-bit E3M2 float value.
float(rogue::interfaces::memory::Block::* getTensorFloat32_)(rogue::interfaces::memory::Variable *, int32_t index)
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.
void(rogue::interfaces::memory::Block::* setFloat6_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
void setFloat4(float &value, int32_t index=-1)
Set a C++ float value into the variable using Float4 (E2M1) conversion.
float(rogue::interfaces::memory::Block::* getBFloat16_)(rogue::interfaces::memory::Variable *, int32_t index)
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.
float(rogue::interfaces::memory::Block::* getFloat8_)(rogue::interfaces::memory::Variable *, int32_t index)
void getValue(double &valueRet, int32_t index=-1)
Gets double value into output reference.
float(rogue::interfaces::memory::Block::* getFloat16_)(rogue::interfaces::memory::Variable *, int32_t index)
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::* setBFloat16_)(const float &, 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::* setFloat16_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
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.
float getTensorFloat32(int32_t index=-1)
Gets TensorFloat32 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.
float getFloat4(int32_t index=-1)
Get the variable's value as a C++ float using Float4 (E2M1) conversion.
bool overlapEn()
Returns overlap-enable flag.
void setByteArray(uint8_t *value, int32_t index=-1)
Sets value from a raw byte array.
void setBFloat16(float &value, int32_t index=-1)
Sets BFloat16 value.
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.
float(rogue::interfaces::memory::Block::* getFloat6_)(rogue::interfaces::memory::Variable *, int32_t index)
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.
void(rogue::interfaces::memory::Block::* setTensorFloat32_)(const float &, rogue::interfaces::memory::Variable *, int32_t index)
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 setFloat16(float &value, int32_t index=-1)
Sets half-precision float value.
void rateTest()
Runs a local throughput benchmark for variable get/set operations.
float getBFloat16(int32_t index=-1)
Gets BFloat16 value.
static void setup_python()
Registers Python bindings for this class.
uint32_t valueStride()
Returns byte stride per value.
float(rogue::interfaces::memory::Block::* getFloat4_)(rogue::interfaces::memory::Variable *, int32_t index)
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 setFloat8(float &value, int32_t index=-1)
Sets 8-bit E4M3 float value.
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