rogue
Loading...
Searching...
No Matches
Block.h
Go to the documentation of this file.
1
17#ifndef __ROGUE_INTERFACES_MEMORY_BLOCK_H__
18#define __ROGUE_INTERFACES_MEMORY_BLOCK_H__
19#include "rogue/Directives.h"
20
21#include <stdint.h>
22
23#include <memory>
24#include <string>
25#include <thread>
26#include <vector>
27
29
30#ifndef NO_PYTHON
31 #include <boost/python.hpp>
32#endif
33
34namespace rogue {
35namespace interfaces {
36namespace memory {
37
38#ifndef NO_PYTHON
39
40// Template function to convert a python list to a C++ std::vector
41template <typename T>
42inline std::vector<T> py_list_to_std_vector(const boost::python::object& iterable) {
43 return std::vector<T>(boost::python::stl_input_iterator<T>(iterable), boost::python::stl_input_iterator<T>());
44}
45
46// Template function to convert a c++ std::vector to a python list
47template <class T>
48inline boost::python::list std_vector_to_py_list(std::vector<T> vector) {
49 typename std::vector<T>::iterator iter;
50 boost::python::list list;
51 for (iter = vector.begin(); iter != vector.end(); ++iter) {
52 list.append(*iter);
53 }
54 return list;
55}
56
57// Template function to convert a python object to a c++ type with checking
58template <typename T>
59inline T py_object_convert(const boost::python::object& obj) {
60 boost::python::extract<T> ret(obj);
61
62 if (!ret.check())
63 return (T)0;
64 else
65 return ret;
66}
67
68#endif
69
70// Forward declaration
71class Variable;
72
96class Block : public Master {
97 protected:
98 // Mutex
99 std::mutex mtx_;
100
101 // Path
102 std::string path_;
103
104 // Mode
105 std::string mode_;
106
107 // Bulk Enable
109
110 // Block level update enable
112
113 // Persistant Block Verify Enable
115
116 // Verify Requred After Write, transiant
118
119 // Verify transaction in progress
121
122 // verifyBase byte, transiant
123 uint32_t verifyBase_;
124
125 // verify Size, transiant
126 uint32_t verifySize_;
127
128 // Block data
129 uint8_t* blockData_;
130
131 // Verify data
132 uint8_t* verifyData_;
133
134 // Verify Mask
135 uint8_t* verifyMask_;
136
137 // Verify Block
138 uint8_t* verifyBlock_;
139
140 // Expected data snapshot for verify comparison (captured at write time)
142
143 // Block size
144 uint32_t size_;
145
146 // Block offset
147 uint64_t offset_;
148
149 // Update Flag, transiant
151
152 // Block python transactions flag
154
155 // Block logging
156 std::shared_ptr<rogue::Logging> bLog_;
157
158 // Variable list
159 std::vector<std::shared_ptr<rogue::interfaces::memory::Variable>> variables_;
160
161 // Enable flag
163
164 // Stale flag
165 bool stale_;
166
167 // Retry count
168 uint32_t retryCount_;
169
170#ifndef NO_PYTHON
171
172 // Call variable update for all variables
173 void varUpdate();
174
175#endif
176
177 // byte reverse
178 static inline void reverseBytes(uint8_t* data, uint32_t byteSize);
179
181 // Byte array set/get helpers
183
184 // Set data from pointer to internal staged memory
185 void setBytes(const uint8_t* data, rogue::interfaces::memory::Variable* var, uint32_t index);
186
187 // Get data to pointer from internal block or staged memory
188 void getBytes(uint8_t* data, rogue::interfaces::memory::Variable* var, uint32_t index);
189
190 // Custom init function called after addVariables
191 virtual void customInit();
192
193 // Custom cleanup function called before delete
194 virtual void customClean();
195
196 public:
210 static std::shared_ptr<rogue::interfaces::memory::Block> create(uint64_t offset, uint32_t size);
211
212 // Setup class for use in python
213 static void setup_python();
214
225 Block(uint64_t offset, uint32_t size);
226
227 // Destroy the Block
228 virtual ~Block();
229
237 std::string path();
238
247 std::string mode();
248
256 bool bulkOpEn();
257
265 void setEnable(bool enable);
266
272 void setLogLevel(uint32_t level) {
273 bLog_->setLevel(level);
274 }
275
283 uint64_t offset();
284
294 uint64_t address();
295
303 uint32_t size();
304
306 bool blockPyTrans();
307
308 private:
318 void intStartTransaction(uint32_t type,
319 bool forceWr,
320 bool check,
322 int32_t index);
323
324 public:
334 void startTransaction(uint32_t type,
335 bool forceWr,
336 bool check,
338 int32_t index = -1);
339
340#ifndef NO_PYTHON
341
353 void startTransactionPy(uint32_t type,
354 bool forceWr,
355 bool check,
356 std::shared_ptr<rogue::interfaces::memory::Variable> var,
357 int32_t index);
358
359#endif
360
366 bool checkTransaction();
367
368#ifndef NO_PYTHON
369
378 void checkTransactionPy();
379
380#endif
381
388 void write(rogue::interfaces::memory::Variable* var, int32_t index = -1);
389
396 void read(rogue::interfaces::memory::Variable* var, int32_t index = -1);
397
405 void addVariables(std::vector<std::shared_ptr<rogue::interfaces::memory::Variable>> variables);
406
407#ifndef NO_PYTHON
408
414 void addVariablesPy(boost::python::object variables);
415
416#endif
417
419 std::vector<std::shared_ptr<rogue::interfaces::memory::Variable>> variables();
420
421#ifndef NO_PYTHON
422
428 boost::python::object variablesPy();
429
430#endif
431
437 void rateTest();
438
440 // Python functions
442
443#ifndef NO_PYTHON
444
457 void setPyFunc(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
458
471 boost::python::object getPyFunc(rogue::interfaces::memory::Variable* var, int32_t index);
472
473#endif
474
476 // Raw Bytes
478
479#ifndef NO_PYTHON
480
492 void setByteArrayPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
493
505 boost::python::object getByteArrayPy(rogue::interfaces::memory::Variable* var, int32_t index);
506
507#endif
508
520 void setByteArray(const uint8_t* value, rogue::interfaces::memory::Variable* var, int32_t index);
521
533 void getByteArray(uint8_t* value, rogue::interfaces::memory::Variable* var, int32_t index);
534
536 // Unsigned int
538
539#ifndef NO_PYTHON
540
552 void setUIntPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
553
565 boost::python::object getUIntPy(rogue::interfaces::memory::Variable* var, int32_t index);
566
567#endif
568
580 void setUInt(const uint64_t& value, rogue::interfaces::memory::Variable* var, int32_t index);
581
593 uint64_t getUInt(rogue::interfaces::memory::Variable* var, int32_t index);
594
596 // Int
598
599#ifndef NO_PYTHON
600
612 void setIntPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
613
625 boost::python::object getIntPy(rogue::interfaces::memory::Variable* var, int32_t index);
626
627#endif
628
640 void setInt(const int64_t& value, rogue::interfaces::memory::Variable* var, int32_t index);
641
653 int64_t getInt(rogue::interfaces::memory::Variable* var, int32_t index);
654
656 // Bool
658
659#ifndef NO_PYTHON
660
670 void setBoolPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
671
681 boost::python::object getBoolPy(rogue::interfaces::memory::Variable* var, int32_t index);
682
683#endif
684
694 void setBool(const bool& value, rogue::interfaces::memory::Variable* var, int32_t index);
695
705 bool getBool(rogue::interfaces::memory::Variable* var, int32_t index);
706
708 // String
710
711#ifndef NO_PYTHON
712
720 void setStringPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
721
729 boost::python::object getStringPy(rogue::interfaces::memory::Variable* var, int32_t index);
730
731#endif
732
740 void setString(const std::string& value, rogue::interfaces::memory::Variable* var, int32_t index);
741
749 std::string getString(rogue::interfaces::memory::Variable* var, int32_t index);
750
758 void getString(rogue::interfaces::memory::Variable* var, std::string& valueRet, int32_t index);
759
767 void getValue(rogue::interfaces::memory::Variable* var, std::string& valueRet, int32_t index) {
768 getString(var, valueRet, index);
769 }
770
772 // Float
774
775#ifndef NO_PYTHON
776
784 void setFloatPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
785
793 boost::python::object getFloatPy(rogue::interfaces::memory::Variable* var, int32_t index);
794
795#endif
796
804 void setFloat(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
805
813 float getFloat(rogue::interfaces::memory::Variable* var, int32_t index);
814
816 // Float16 (half-precision)
818
819#ifndef NO_PYTHON
820
828 void setFloat16Py(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
829
837 boost::python::object getFloat16Py(rogue::interfaces::memory::Variable* var, int32_t index);
838
839#endif
840
848 void setFloat16(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
849
857 float getFloat16(rogue::interfaces::memory::Variable* var, int32_t index);
858
860 // Float8 (E4M3)
862
863#ifndef NO_PYTHON
864
872 void setFloat8Py(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
873
881 boost::python::object getFloat8Py(rogue::interfaces::memory::Variable* var, int32_t index);
882
883#endif
884
892 void setFloat8(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
893
901 float getFloat8(rogue::interfaces::memory::Variable* var, int32_t index);
902
904 // BFloat16 (Brain Float 16)
906
907#ifndef NO_PYTHON
908
916 void setBFloat16Py(boost::python::object& value,
917 rogue::interfaces::memory::Variable* var, int32_t index);
918
926 boost::python::object getBFloat16Py(rogue::interfaces::memory::Variable* var, int32_t index);
927
928#endif
929
937 void setBFloat16(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
938
946 float getBFloat16(rogue::interfaces::memory::Variable* var, int32_t index);
947
949 // TensorFloat32 (NVIDIA TF32)
951
952#ifndef NO_PYTHON
953
961 void setTensorFloat32Py(boost::python::object& value,
962 rogue::interfaces::memory::Variable* var, int32_t index);
963
971 boost::python::object getTensorFloat32Py(rogue::interfaces::memory::Variable* var, int32_t index);
972
973#endif
974
982 void setTensorFloat32(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
983
991 float getTensorFloat32(rogue::interfaces::memory::Variable* var, int32_t index);
992
994 // Float6 (E3M2)
996
997#ifndef NO_PYTHON
998
1006 void setFloat6Py(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
1007
1015 boost::python::object getFloat6Py(rogue::interfaces::memory::Variable* var, int32_t index);
1016
1017#endif
1018
1026 void setFloat6(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
1027
1035 float getFloat6(rogue::interfaces::memory::Variable* var, int32_t index);
1036
1038 // Float4 (E2M1)
1040
1041#ifndef NO_PYTHON
1042
1050 void setFloat4Py(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
1051
1059 boost::python::object getFloat4Py(rogue::interfaces::memory::Variable* var, int32_t index);
1060
1061#endif
1062
1070 void setFloat4(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
1071
1079 float getFloat4(rogue::interfaces::memory::Variable* var, int32_t index);
1080
1082 // Double
1084
1085#ifndef NO_PYTHON
1086
1094 void setDoublePy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
1095
1103 boost::python::object getDoublePy(rogue::interfaces::memory::Variable* var, int32_t index);
1104
1105#endif
1106
1114 void setDouble(const double& value, rogue::interfaces::memory::Variable* var, int32_t index);
1115
1123 double getDouble(rogue::interfaces::memory::Variable* var, int32_t index);
1124
1126 // Fixed Point
1128
1129#ifndef NO_PYTHON
1130
1138 void setFixedPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
1139
1147 boost::python::object getFixedPy(rogue::interfaces::memory::Variable* var, int32_t index);
1148
1149#endif
1150
1158 void setFixed(const double& value, rogue::interfaces::memory::Variable* var, int32_t index);
1159
1167 double getFixed(rogue::interfaces::memory::Variable* var, int32_t index);
1168
1176 void setUFixed(const double& value, rogue::interfaces::memory::Variable* var, int32_t index);
1177
1185 double getUFixed(rogue::interfaces::memory::Variable* var, int32_t index);
1186};
1187
1189typedef std::shared_ptr<rogue::interfaces::memory::Block> BlockPtr;
1190
1191} // namespace memory
1192} // namespace interfaces
1193} // namespace rogue
1194
1195#endif
Memory interface block device.
Definition Block.h:96
void setString(const std::string &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets string variable data from C++ input.
Definition Block.cpp:1557
boost::python::object getPyFunc(rogue::interfaces::memory::Variable *var, int32_t index)
Gets variable data using a Python callback/value conversion.
Definition Block.cpp:836
boost::python::object getTensorFloat32Py(rogue::interfaces::memory::Variable *var, int32_t index)
Gets TensorFloat32 variable data as Python output.
Definition Block.cpp:2524
void setDoublePy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets double variable data from Python input.
Definition Block.cpp:2865
uint32_t size()
Returns block size in bytes.
Definition Block.cpp:165
boost::python::object getStringPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets string variable data as Python output.
Definition Block.cpp:1535
void addVariablesPy(boost::python::object variables)
Adds variables to this block (Python API).
Definition Block.cpp:618
void setBoolPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets boolean variable data from Python input.
Definition Block.cpp:1380
double getDouble(rogue::interfaces::memory::Variable *var, int32_t index)
Gets double variable data as C++ output.
Definition Block.cpp:2999
float getFloat16(rogue::interfaces::memory::Variable *var, int32_t index)
Gets half-precision float variable data as C++ output.
Definition Block.cpp:2150
float getFloat(rogue::interfaces::memory::Variable *var, int32_t index)
Gets float variable data as C++ output.
Definition Block.cpp:1726
float getFloat8(rogue::interfaces::memory::Variable *var, int32_t index)
Gets 8-bit E4M3 float variable data as C++ output.
Definition Block.cpp:2290
void setUInt(const uint64_t &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets unsigned-integer variable data from C++ input.
Definition Block.cpp:1122
boost::python::object variablesPy()
Returns the variable list associated with this block (Python API).
Definition Block.cpp:633
void setFixed(const double &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets fixed-point variable data from C++ input.
Definition Block.cpp:3147
void setDouble(const double &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets double variable data from C++ input.
Definition Block.cpp:2985
void setFloat4Py(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets 4-bit E2M1 float variable data from Python input.
Definition Block.cpp:2725
void setFloat6(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets 6-bit E3M2 float variable data from C++ input.
Definition Block.cpp:2694
void setPyFunc(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets variable data using a Python callback/value.
Definition Block.cpp:780
void setFloat8(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets 8-bit E4M3 float variable data from C++ input.
Definition Block.cpp:2274
boost::python::object getFloat6Py(rogue::interfaces::memory::Variable *var, int32_t index)
Gets 6-bit E3M2 float variable data as Python output.
Definition Block.cpp:2664
std::vector< std::shared_ptr< rogue::interfaces::memory::Variable > > variables()
Returns the variable list associated with this block (C++ API).
Definition Block.cpp:626
boost::python::object getBFloat16Py(rogue::interfaces::memory::Variable *var, int32_t index)
Gets BFloat16 variable data as Python output.
Definition Block.cpp:2384
bool checkTransaction()
Checks transaction result in C++ mode.
Definition Block.cpp:365
float getFloat4(rogue::interfaces::memory::Variable *var, int32_t index)
Gets 4-bit E2M1 float variable data as C++ output.
Definition Block.cpp:2850
void setFloat4(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets 4-bit E2M1 float variable data from C++ input.
Definition Block.cpp:2834
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.
Definition Block.cpp:287
void write(rogue::interfaces::memory::Variable *var, int32_t index=-1)
Issues write/verify/check sequence from C++.
Definition Block.cpp:430
std::vector< std::shared_ptr< rogue::interfaces::memory::Variable > > variables_
Definition Block.h:159
void setFloat8Py(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets 8-bit E4M3 float variable data from Python input.
Definition Block.cpp:2165
void setFloatPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets float variable data from Python input.
Definition Block.cpp:1592
void getBytes(uint8_t *data, rogue::interfaces::memory::Variable *var, uint32_t index)
Definition Block.cpp:727
boost::python::object getUIntPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets unsigned-integer variable data as Python output.
Definition Block.cpp:1055
boost::python::object getIntPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets signed-integer variable data as Python output.
Definition Block.cpp:1280
bool bulkOpEn()
Returns whether this block participates in bulk operations.
Definition Block.cpp:143
boost::python::object getDoublePy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets double variable data as Python output.
Definition Block.cpp:2954
void setFloat(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets float variable data from C++ input.
Definition Block.cpp:1712
std::string path()
Returns the path of the block in the device tree.
Definition Block.cpp:133
void setUIntPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets unsigned-integer variable data from Python input.
Definition Block.cpp:928
void getValue(rogue::interfaces::memory::Variable *var, std::string &valueRet, int32_t index)
Alias to getString(var, valueRet, index).
Definition Block.h:767
void setFloat16Py(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets half-precision float variable data from Python input.
Definition Block.cpp:2012
void setBFloat16Py(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets BFloat16 variable data from Python input.
Definition Block.cpp:2305
void read(rogue::interfaces::memory::Variable *var, int32_t index=-1)
Issues read/check sequence from C++.
Definition Block.cpp:437
void setStringPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets string variable data from Python input.
Definition Block.cpp:1515
void setInt(const int64_t &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets signed-integer variable data from C++ input.
Definition Block.cpp:1345
bool blockPyTrans()
Returns whether Python transaction callbacks are blocked.
Definition Block.cpp:170
boost::python::object getFloat4Py(rogue::interfaces::memory::Variable *var, int32_t index)
Gets 4-bit E2M1 float variable data as Python output.
Definition Block.cpp:2804
boost::python::object getBoolPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets boolean variable data as Python output.
Definition Block.cpp:1467
void setIntPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets signed-integer variable data from Python input.
Definition Block.cpp:1151
bool getBool(rogue::interfaces::memory::Variable *var, int32_t index)
Gets boolean variable data as C++ output.
Definition Block.cpp:1500
float getBFloat16(rogue::interfaces::memory::Variable *var, int32_t index)
Gets BFloat16 variable data as C++ output.
Definition Block.cpp:2430
std::string mode()
Returns the block access mode.
Definition Block.cpp:138
uint64_t getUInt(rogue::interfaces::memory::Variable *var, int32_t index)
Gets unsigned-integer variable data as C++ output.
Definition Block.cpp:1136
float getTensorFloat32(rogue::interfaces::memory::Variable *var, int32_t index)
Gets TensorFloat32 variable data as C++ output.
Definition Block.cpp:2570
double getFixed(rogue::interfaces::memory::Variable *var, int32_t index)
Gets fixed-point variable data as C++ output.
Definition Block.cpp:3177
void setBFloat16(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets BFloat16 variable data from C++ input.
Definition Block.cpp:2414
void setBytes(const uint8_t *data, rogue::interfaces::memory::Variable *var, uint32_t index)
Definition Block.cpp:652
boost::python::object getFloat8Py(rogue::interfaces::memory::Variable *var, int32_t index)
Gets 8-bit E4M3 float variable data as Python output.
Definition Block.cpp:2244
void setEnable(bool enable)
Sets the block enable state.
Definition Block.cpp:148
int64_t getInt(rogue::interfaces::memory::Variable *var, int32_t index)
Gets signed-integer variable data as C++ output.
Definition Block.cpp:1360
void setByteArray(const uint8_t *value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets variable data from C++ byte array input.
Definition Block.cpp:912
double getUFixed(rogue::interfaces::memory::Variable *var, int32_t index)
Gets unsigned fixed-point variable data as C++ output.
Definition Block.cpp:3233
float getFloat6(rogue::interfaces::memory::Variable *var, int32_t index)
Gets 6-bit E3M2 float variable data as C++ output.
Definition Block.cpp:2710
static void reverseBytes(uint8_t *data, uint32_t byteSize)
Definition Block.cpp:640
uint64_t offset()
Returns the local offset of this block.
Definition Block.cpp:155
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.
Definition Block.cpp:323
boost::python::object getFloatPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets float variable data as Python output.
Definition Block.cpp:1681
void checkTransactionPy()
Checks transaction result.
Definition Block.cpp:421
void setByteArrayPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets variable data from Python byte-array-like input.
Definition Block.cpp:870
void setFloat6Py(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets 6-bit E3M2 float variable data from Python input.
Definition Block.cpp:2585
void setFloat16(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets half-precision float variable data from C++ input.
Definition Block.cpp:2134
void setTensorFloat32Py(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets TensorFloat32 variable data from Python input.
Definition Block.cpp:2445
void setBool(const bool &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets boolean variable data from C++ input.
Definition Block.cpp:1494
std::shared_ptr< rogue::Logging > bLog_
Definition Block.h:156
void setTensorFloat32(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets TensorFloat32 variable data from C++ input.
Definition Block.cpp:2554
boost::python::object getFloat16Py(rogue::interfaces::memory::Variable *var, int32_t index)
Gets half-precision float variable data as Python output.
Definition Block.cpp:2103
uint64_t address()
Returns the full address of this block.
Definition Block.cpp:160
boost::python::object getFixedPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets fixed-point variable data as Python output.
Definition Block.cpp:3111
void getByteArray(uint8_t *value, rogue::interfaces::memory::Variable *var, int32_t index)
Gets variable data into a C++ byte array buffer.
Definition Block.cpp:917
void addVariables(std::vector< std::shared_ptr< rogue::interfaces::memory::Variable > > variables)
Adds variables to this block (C++ API).
Definition Block.cpp:458
boost::python::object getByteArrayPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets variable data as a Python byte-array-like object.
Definition Block.cpp:889
void setLogLevel(uint32_t level)
Sets logging verbosity level for this block.
Definition Block.h:272
std::string getString(rogue::interfaces::memory::Variable *var, int32_t index)
Gets string variable data as C++ output.
Definition Block.cpp:1568
void setUFixed(const double &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets unsigned fixed-point variable data from C++ input.
Definition Block.cpp:3198
void rateTest()
Runs block rate-test helper for performance testing.
Definition Block.cpp:3251
void setFixedPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets fixed-point variable data from Python input.
Definition Block.cpp:3014
Master endpoint for memory transactions.
Definition Master.h:50
static std::shared_ptr< rogue::interfaces::memory::Master > create()
Creates a memory master instance.
Definition Master.cpp:44
Memory variable descriptor and typed accessor facade.
Definition Variable.h:62
boost::python::list std_vector_to_py_list(std::vector< T > vector)
Definition Block.h:48
T py_object_convert(const boost::python::object &obj)
Definition Block.h:59
std::shared_ptr< rogue::interfaces::memory::Block > BlockPtr
Shared pointer alias for Block.
Definition Block.h:1189
std::vector< T > py_list_to_std_vector(const boost::python::object &iterable)
Definition Block.h:42