17#ifndef __ROGUE_INTERFACES_MEMORY_BLOCK_H__
18#define __ROGUE_INTERFACES_MEMORY_BLOCK_H__
31 #include <boost/python.hpp>
43 return std::vector<T>(boost::python::stl_input_iterator<T>(iterable), boost::python::stl_input_iterator<T>());
49 typename std::vector<T>::iterator iter;
50 boost::python::list list;
51 for (iter = vector.begin(); iter != vector.end(); ++iter) {
60 boost::python::extract<T> ret(obj);
153 std::shared_ptr<rogue::Logging>
bLog_;
156 std::vector<std::shared_ptr<rogue::interfaces::memory::Variable>>
variables_;
175 static inline void reverseBytes(uint8_t* data, uint32_t byteSize);
207 static std::shared_ptr<rogue::interfaces::memory::Block>
create(uint64_t
offset, uint32_t
size);
270 bLog_->setLevel(level);
315 void intStartTransaction(uint32_t type,
353 std::shared_ptr<rogue::interfaces::memory::Variable> var,
416 std::vector<std::shared_ptr<rogue::interfaces::memory::Variable>>
variables();
902typedef std::shared_ptr<rogue::interfaces::memory::Block>
BlockPtr;
Memory interface block device.
void setString(const std::string &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets string variable data from C++ input.
boost::python::object getPyFunc(rogue::interfaces::memory::Variable *var, int32_t index)
Gets variable data using a Python callback/value conversion.
void setDoublePy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets double variable data from Python input.
uint32_t size()
Returns block size in bytes.
boost::python::object getStringPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets string variable data as Python output.
void addVariablesPy(boost::python::object variables)
Adds variables to this block (Python API).
void setBoolPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets boolean variable data from Python input.
double getDouble(rogue::interfaces::memory::Variable *var, int32_t index)
Gets double variable data as C++ output.
float getFloat(rogue::interfaces::memory::Variable *var, int32_t index)
Gets float variable data as C++ output.
void setUInt(const uint64_t &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets unsigned-integer variable data from C++ input.
boost::python::object variablesPy()
Returns the variable list associated with this block (Python API).
void setFixed(const double &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets fixed-point variable data from C++ input.
void setDouble(const double &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets double variable data from C++ input.
void setPyFunc(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets variable data using a Python callback/value.
std::vector< std::shared_ptr< rogue::interfaces::memory::Variable > > variables()
Returns the variable list associated with this block (C++ API).
bool checkTransaction()
Checks transaction result in C++ mode.
virtual void customClean()
void startTransaction(uint32_t type, bool forceWr, bool check, rogue::interfaces::memory::Variable *var, int32_t index=-1)
Starts a C++ transaction for this block.
void write(rogue::interfaces::memory::Variable *var, int32_t index=-1)
Issues write/verify/check sequence from C++.
std::vector< std::shared_ptr< rogue::interfaces::memory::Variable > > variables_
void setFloatPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets float variable data from Python input.
void getBytes(uint8_t *data, rogue::interfaces::memory::Variable *var, uint32_t index)
boost::python::object getUIntPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets unsigned-integer variable data as Python output.
boost::python::object getIntPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets signed-integer variable data as Python output.
bool bulkOpEn()
Returns whether this block participates in bulk operations.
boost::python::object getDoublePy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets double variable data as Python output.
void setFloat(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets float variable data from C++ input.
virtual void customInit()
std::string path()
Returns the path of the block in the device tree.
void setUIntPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets unsigned-integer variable data from Python input.
void getValue(rogue::interfaces::memory::Variable *var, std::string &valueRet, int32_t index)
Alias to getString(var, valueRet, index).
void read(rogue::interfaces::memory::Variable *var, int32_t index=-1)
Issues read/check sequence from C++.
void setStringPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets string variable data from Python input.
void setInt(const int64_t &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets signed-integer variable data from C++ input.
bool blockPyTrans()
Returns whether Python transaction callbacks are blocked.
static void setup_python()
boost::python::object getBoolPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets boolean variable data as Python output.
void setIntPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets signed-integer variable data from Python input.
bool getBool(rogue::interfaces::memory::Variable *var, int32_t index)
Gets boolean variable data as C++ output.
std::string mode()
Returns the block access mode.
uint64_t getUInt(rogue::interfaces::memory::Variable *var, int32_t index)
Gets unsigned-integer variable data as C++ output.
double getFixed(rogue::interfaces::memory::Variable *var, int32_t index)
Gets fixed-point variable data as C++ output.
void setBytes(const uint8_t *data, rogue::interfaces::memory::Variable *var, uint32_t index)
void setEnable(bool enable)
Sets the block enable state.
int64_t getInt(rogue::interfaces::memory::Variable *var, int32_t index)
Gets signed-integer variable data as C++ output.
void setByteArray(const uint8_t *value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets variable data from C++ byte array input.
static void reverseBytes(uint8_t *data, uint32_t byteSize)
uint64_t offset()
Returns the local offset of this block.
void startTransactionPy(uint32_t type, bool forceWr, bool check, std::shared_ptr< rogue::interfaces::memory::Variable > var, int32_t index)
Starts a block transaction from Python.
boost::python::object getFloatPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets float variable data as Python output.
void checkTransactionPy()
Checks transaction result.
void setByteArrayPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets variable data from Python byte-array-like input.
void setBool(const bool &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets boolean variable data from C++ input.
std::shared_ptr< rogue::Logging > bLog_
uint64_t address()
Returns the full address of this block.
boost::python::object getFixedPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets fixed-point variable data as Python output.
void getByteArray(uint8_t *value, rogue::interfaces::memory::Variable *var, int32_t index)
Gets variable data into a C++ byte array buffer.
void addVariables(std::vector< std::shared_ptr< rogue::interfaces::memory::Variable > > variables)
Adds variables to this block (C++ API).
boost::python::object getByteArrayPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets variable data as a Python byte-array-like object.
void setLogLevel(uint32_t level)
Sets logging verbosity level for this block.
std::string getString(rogue::interfaces::memory::Variable *var, int32_t index)
Gets string variable data as C++ output.
void rateTest()
Runs block rate-test helper for performance testing.
void setFixedPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets fixed-point variable data from Python input.
Master endpoint for memory transactions.
static std::shared_ptr< rogue::interfaces::memory::Master > create()
Creates a memory master instance.
Memory variable descriptor and typed accessor facade.
boost::python::list std_vector_to_py_list(std::vector< T > vector)
T py_object_convert(const boost::python::object &obj)
std::shared_ptr< rogue::interfaces::memory::Block > BlockPtr
Shared pointer alias for Block.
std::vector< T > py_list_to_std_vector(const boost::python::object &iterable)