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
97class Block : public Master {
98 protected:
99 // Mutex
100 std::mutex mtx_;
101
102 // Path
103 std::string path_;
104
105 // Mode
106 std::string mode_;
107
108 // Bulk Enable
110
111 // Block level update enable
113
114 // Persistant Block Verify Enable
116
117 // Verify Requred After Write, transiant
119
120 // Verify transaction in progress
122
123 // verifyBase byte, transiant
124 uint32_t verifyBase_;
125
126 // verify Size, transiant
127 uint32_t verifySize_;
128
129 // Block data
130 uint8_t* blockData_;
131
132 // Verify data
133 uint8_t* verifyData_;
134
135 // Verify Mask
136 uint8_t* verifyMask_;
137
138 // Verify Block
139 uint8_t* verifyBlock_;
140
141 // Expected data snapshot for verify comparison (captured at write time)
143
144 // Block size
145 uint32_t size_;
146
147 // Block offset
148 uint64_t offset_;
149
150 // Update Flag, transiant
152
153 // Block python transactions flag
155
156 // Block logging
157 std::shared_ptr<rogue::Logging> bLog_;
158
159 // Variable list
160 std::vector<std::shared_ptr<rogue::interfaces::memory::Variable>> variables_;
161
162 // Enable flag
164
165 // Stale flag
166 bool stale_;
167
168 // Retry count
169 uint32_t retryCount_;
170
171#ifndef NO_PYTHON
172
173 // Call variable update for all variables
174 void varUpdate();
175
176#endif
177
178 // byte reverse
179 static inline void reverseBytes(uint8_t* data, uint32_t byteSize);
180
182 // Byte array set/get helpers
184
185 // Set data from pointer to internal staged memory
186 void setBytes(const uint8_t* data, rogue::interfaces::memory::Variable* var, uint32_t index);
187
188 // Get data to pointer from internal block or staged memory
189 void getBytes(uint8_t* data, rogue::interfaces::memory::Variable* var, uint32_t index);
190
191 // Custom init function called after addVariables
192 virtual void customInit();
193
194 // Custom cleanup function called before delete
195 virtual void customClean();
196
197 public:
211 static std::shared_ptr<rogue::interfaces::memory::Block> create(uint64_t offset, uint32_t size);
212
213 // Setup class for use in python
214 static void setup_python();
215
226 Block(uint64_t offset, uint32_t size);
227
228 // Destroy the Block
229 virtual ~Block();
230
238 std::string path();
239
248 std::string mode();
249
257 bool bulkOpEn();
258
266 void setEnable(bool enable);
267
273 void setLogLevel(uint32_t level) {
274 bLog_->setLevel(level);
275 }
276
284 uint64_t offset();
285
295 uint64_t address();
296
304 uint32_t size();
305
307 bool blockPyTrans();
308
309 private:
318 void intStartTransaction(uint32_t type,
319 bool forceWr,
321 int32_t index);
322
323 public:
335 void startTransaction(uint32_t type,
336 bool forceWr,
337 bool check,
339 int32_t index = -1);
340
341#ifndef NO_PYTHON
342
358 void startTransactionPy(uint32_t type,
359 bool forceWr,
360 bool check,
361 std::shared_ptr<rogue::interfaces::memory::Variable> var,
362 int32_t index);
363
364#endif
365
374 bool checkTransaction();
375
376#ifndef NO_PYTHON
377
388 void checkTransactionPy();
389
390#endif
391
398 void write(rogue::interfaces::memory::Variable* var, int32_t index = -1);
399
406 void read(rogue::interfaces::memory::Variable* var, int32_t index = -1);
407
415 void addVariables(std::vector<std::shared_ptr<rogue::interfaces::memory::Variable>> variables);
416
417#ifndef NO_PYTHON
418
424 void addVariablesPy(boost::python::object variables);
425
426#endif
427
429 std::vector<std::shared_ptr<rogue::interfaces::memory::Variable>> variables();
430
431#ifndef NO_PYTHON
432
438 boost::python::object variablesPy();
439
440#endif
441
447 void rateTest();
448
450 // Python functions
452
453#ifndef NO_PYTHON
454
467 void setPyFunc(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
468
481 boost::python::object getPyFunc(rogue::interfaces::memory::Variable* var, int32_t index);
482
483#endif
484
486 // Raw Bytes
488
489#ifndef NO_PYTHON
490
502 void setByteArrayPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
503
515 boost::python::object getByteArrayPy(rogue::interfaces::memory::Variable* var, int32_t index);
516
517#endif
518
530 void setByteArray(const uint8_t* value, rogue::interfaces::memory::Variable* var, int32_t index);
531
543 void getByteArray(uint8_t* value, rogue::interfaces::memory::Variable* var, int32_t index);
544
546 // Unsigned int
548
549#ifndef NO_PYTHON
550
562 void setUIntPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
563
575 boost::python::object getUIntPy(rogue::interfaces::memory::Variable* var, int32_t index);
576
577#endif
578
590 void setUInt(const uint64_t& value, rogue::interfaces::memory::Variable* var, int32_t index);
591
603 uint64_t getUInt(rogue::interfaces::memory::Variable* var, int32_t index);
604
606 // Int
608
609#ifndef NO_PYTHON
610
622 void setIntPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
623
635 boost::python::object getIntPy(rogue::interfaces::memory::Variable* var, int32_t index);
636
637#endif
638
650 void setInt(const int64_t& value, rogue::interfaces::memory::Variable* var, int32_t index);
651
663 int64_t getInt(rogue::interfaces::memory::Variable* var, int32_t index);
664
666 // Bool
668
669#ifndef NO_PYTHON
670
680 void setBoolPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
681
691 boost::python::object getBoolPy(rogue::interfaces::memory::Variable* var, int32_t index);
692
693#endif
694
704 void setBool(const bool& value, rogue::interfaces::memory::Variable* var, int32_t index);
705
715 bool getBool(rogue::interfaces::memory::Variable* var, int32_t index);
716
718 // String
720
721#ifndef NO_PYTHON
722
730 void setStringPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
731
739 boost::python::object getStringPy(rogue::interfaces::memory::Variable* var, int32_t index);
740
741#endif
742
750 void setString(const std::string& value, rogue::interfaces::memory::Variable* var, int32_t index);
751
759 std::string getString(rogue::interfaces::memory::Variable* var, int32_t index);
760
768 void getString(rogue::interfaces::memory::Variable* var, std::string& valueRet, int32_t index);
769
777 void getValue(rogue::interfaces::memory::Variable* var, std::string& valueRet, int32_t index) {
778 getString(var, valueRet, index);
779 }
780
782 // Float
784
785#ifndef NO_PYTHON
786
794 void setFloatPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
795
803 boost::python::object getFloatPy(rogue::interfaces::memory::Variable* var, int32_t index);
804
805#endif
806
814 void setFloat(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
815
823 float getFloat(rogue::interfaces::memory::Variable* var, int32_t index);
824
826 // Float16 (half-precision)
828
829#ifndef NO_PYTHON
830
838 void setFloat16Py(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
839
847 boost::python::object getFloat16Py(rogue::interfaces::memory::Variable* var, int32_t index);
848
849#endif
850
858 void setFloat16(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
859
867 float getFloat16(rogue::interfaces::memory::Variable* var, int32_t index);
868
870 // Float8 (E4M3)
872
873#ifndef NO_PYTHON
874
882 void setFloat8Py(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
883
891 boost::python::object getFloat8Py(rogue::interfaces::memory::Variable* var, int32_t index);
892
893#endif
894
902 void setFloat8(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
903
911 float getFloat8(rogue::interfaces::memory::Variable* var, int32_t index);
912
914 // BFloat16 (Brain Float 16)
916
917#ifndef NO_PYTHON
918
926 void setBFloat16Py(boost::python::object& value,
927 rogue::interfaces::memory::Variable* var, int32_t index);
928
936 boost::python::object getBFloat16Py(rogue::interfaces::memory::Variable* var, int32_t index);
937
938#endif
939
947 void setBFloat16(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
948
956 float getBFloat16(rogue::interfaces::memory::Variable* var, int32_t index);
957
959 // TensorFloat32 (NVIDIA TF32)
961
962#ifndef NO_PYTHON
963
971 void setTensorFloat32Py(boost::python::object& value,
972 rogue::interfaces::memory::Variable* var, int32_t index);
973
981 boost::python::object getTensorFloat32Py(rogue::interfaces::memory::Variable* var, int32_t index);
982
983#endif
984
992 void setTensorFloat32(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
993
1001 float getTensorFloat32(rogue::interfaces::memory::Variable* var, int32_t index);
1002
1004 // Float6 (E3M2)
1006
1007#ifndef NO_PYTHON
1008
1016 void setFloat6Py(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
1017
1025 boost::python::object getFloat6Py(rogue::interfaces::memory::Variable* var, int32_t index);
1026
1027#endif
1028
1036 void setFloat6(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
1037
1045 float getFloat6(rogue::interfaces::memory::Variable* var, int32_t index);
1046
1048 // Float4 (E2M1)
1050
1051#ifndef NO_PYTHON
1052
1060 void setFloat4Py(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
1061
1069 boost::python::object getFloat4Py(rogue::interfaces::memory::Variable* var, int32_t index);
1070
1071#endif
1072
1080 void setFloat4(const float& value, rogue::interfaces::memory::Variable* var, int32_t index);
1081
1089 float getFloat4(rogue::interfaces::memory::Variable* var, int32_t index);
1090
1092 // Double
1094
1095#ifndef NO_PYTHON
1096
1104 void setDoublePy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
1105
1113 boost::python::object getDoublePy(rogue::interfaces::memory::Variable* var, int32_t index);
1114
1115#endif
1116
1124 void setDouble(const double& value, rogue::interfaces::memory::Variable* var, int32_t index);
1125
1133 double getDouble(rogue::interfaces::memory::Variable* var, int32_t index);
1134
1136 // Fixed Point
1138
1139#ifndef NO_PYTHON
1140
1148 void setFixedPy(boost::python::object& value, rogue::interfaces::memory::Variable* var, int32_t index);
1149
1157 boost::python::object getFixedPy(rogue::interfaces::memory::Variable* var, int32_t index);
1158
1159#endif
1160
1168 void setFixed(const double& value, rogue::interfaces::memory::Variable* var, int32_t index);
1169
1177 double getFixed(rogue::interfaces::memory::Variable* var, int32_t index);
1178
1186 void setUFixed(const double& value, rogue::interfaces::memory::Variable* var, int32_t index);
1187
1195 double getUFixed(rogue::interfaces::memory::Variable* var, int32_t index);
1196};
1197
1199typedef std::shared_ptr<rogue::interfaces::memory::Block> BlockPtr;
1200
1201} // namespace memory
1202} // namespace interfaces
1203} // namespace rogue
1204
1205#endif
Memory interface block device.
Definition Block.h:97
void setString(const std::string &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets string variable data from C++ input.
Definition Block.cpp:1587
boost::python::object getPyFunc(rogue::interfaces::memory::Variable *var, int32_t index)
Gets variable data using a Python callback/value conversion.
Definition Block.cpp:866
boost::python::object getTensorFloat32Py(rogue::interfaces::memory::Variable *var, int32_t index)
Gets TensorFloat32 variable data as Python output.
Definition Block.cpp:2554
void setDoublePy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets double variable data from Python input.
Definition Block.cpp:2895
uint32_t size()
Returns block size in bytes.
Definition Block.cpp:166
boost::python::object getStringPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets string variable data as Python output.
Definition Block.cpp:1565
void addVariablesPy(boost::python::object variables)
Adds variables to this block (Python API).
Definition Block.cpp:619
void setBoolPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets boolean variable data from Python input.
Definition Block.cpp:1410
double getDouble(rogue::interfaces::memory::Variable *var, int32_t index)
Gets double variable data as C++ output.
Definition Block.cpp:3029
float getFloat16(rogue::interfaces::memory::Variable *var, int32_t index)
Gets half-precision float variable data as C++ output.
Definition Block.cpp:2180
float getFloat(rogue::interfaces::memory::Variable *var, int32_t index)
Gets float variable data as C++ output.
Definition Block.cpp:1756
float getFloat8(rogue::interfaces::memory::Variable *var, int32_t index)
Gets 8-bit E4M3 float variable data as C++ output.
Definition Block.cpp:2320
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:1152
boost::python::object variablesPy()
Returns the variable list associated with this block (Python API).
Definition Block.cpp:634
void setFixed(const double &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets fixed-point variable data from C++ input.
Definition Block.cpp:3177
void setDouble(const double &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets double variable data from C++ input.
Definition Block.cpp:3015
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:2755
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:2724
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:810
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:2304
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:2694
std::vector< std::shared_ptr< rogue::interfaces::memory::Variable > > variables()
Returns the variable list associated with this block (C++ API).
Definition Block.cpp:627
boost::python::object getBFloat16Py(rogue::interfaces::memory::Variable *var, int32_t index)
Gets BFloat16 variable data as Python output.
Definition Block.cpp:2414
bool checkTransaction()
Waits for pending transaction completion and checks the result.
Definition Block.cpp:366
float getFloat4(rogue::interfaces::memory::Variable *var, int32_t index)
Gets 4-bit E2M1 float variable data as C++ output.
Definition Block.cpp:2880
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:2864
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:288
void write(rogue::interfaces::memory::Variable *var, int32_t index=-1)
Issues a write/verify/wait-and-check sequence from C++.
Definition Block.cpp:431
std::vector< std::shared_ptr< rogue::interfaces::memory::Variable > > variables_
Definition Block.h:160
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:2195
void setFloatPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets float variable data from Python input.
Definition Block.cpp:1622
void getBytes(uint8_t *data, rogue::interfaces::memory::Variable *var, uint32_t index)
Definition Block.cpp:749
boost::python::object getUIntPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets unsigned-integer variable data as Python output.
Definition Block.cpp:1085
boost::python::object getIntPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets signed-integer variable data as Python output.
Definition Block.cpp:1310
bool bulkOpEn()
Returns whether this block participates in bulk operations.
Definition Block.cpp:144
boost::python::object getDoublePy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets double variable data as Python output.
Definition Block.cpp:2984
void setFloat(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets float variable data from C++ input.
Definition Block.cpp:1742
std::string path()
Returns the path of the block in the device tree.
Definition Block.cpp:134
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:958
void getValue(rogue::interfaces::memory::Variable *var, std::string &valueRet, int32_t index)
Alias to getString(var, valueRet, index).
Definition Block.h:777
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:2042
void setBFloat16Py(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets BFloat16 variable data from Python input.
Definition Block.cpp:2335
void read(rogue::interfaces::memory::Variable *var, int32_t index=-1)
Issues a read/wait-and-check sequence from C++.
Definition Block.cpp:438
void setStringPy(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets string variable data from Python input.
Definition Block.cpp:1545
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:1375
bool blockPyTrans()
Returns whether Python transaction callbacks are blocked.
Definition Block.cpp:171
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:2834
boost::python::object getBoolPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets boolean variable data as Python output.
Definition Block.cpp:1497
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:1181
bool getBool(rogue::interfaces::memory::Variable *var, int32_t index)
Gets boolean variable data as C++ output.
Definition Block.cpp:1530
float getBFloat16(rogue::interfaces::memory::Variable *var, int32_t index)
Gets BFloat16 variable data as C++ output.
Definition Block.cpp:2460
std::string mode()
Returns the block access mode.
Definition Block.cpp:139
uint64_t getUInt(rogue::interfaces::memory::Variable *var, int32_t index)
Gets unsigned-integer variable data as C++ output.
Definition Block.cpp:1166
float getTensorFloat32(rogue::interfaces::memory::Variable *var, int32_t index)
Gets TensorFloat32 variable data as C++ output.
Definition Block.cpp:2600
double getFixed(rogue::interfaces::memory::Variable *var, int32_t index)
Gets fixed-point variable data as C++ output.
Definition Block.cpp:3207
void setBFloat16(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets BFloat16 variable data from C++ input.
Definition Block.cpp:2444
void setBytes(const uint8_t *data, rogue::interfaces::memory::Variable *var, uint32_t index)
Definition Block.cpp:653
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:2274
void setEnable(bool enable)
Sets the block enable state.
Definition Block.cpp:149
int64_t getInt(rogue::interfaces::memory::Variable *var, int32_t index)
Gets signed-integer variable data as C++ output.
Definition Block.cpp:1390
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:942
double getUFixed(rogue::interfaces::memory::Variable *var, int32_t index)
Gets unsigned fixed-point variable data as C++ output.
Definition Block.cpp:3263
float getFloat6(rogue::interfaces::memory::Variable *var, int32_t index)
Gets 6-bit E3M2 float variable data as C++ output.
Definition Block.cpp:2740
static void reverseBytes(uint8_t *data, uint32_t byteSize)
Definition Block.cpp:641
uint64_t offset()
Returns the local offset of this block.
Definition Block.cpp:156
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:324
boost::python::object getFloatPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets float variable data as Python output.
Definition Block.cpp:1711
void checkTransactionPy()
Waits for pending transaction completion and checks the result.
Definition Block.cpp:422
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:900
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:2615
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:2164
void setTensorFloat32Py(boost::python::object &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets TensorFloat32 variable data from Python input.
Definition Block.cpp:2475
void setBool(const bool &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets boolean variable data from C++ input.
Definition Block.cpp:1524
std::shared_ptr< rogue::Logging > bLog_
Definition Block.h:157
void setTensorFloat32(const float &value, rogue::interfaces::memory::Variable *var, int32_t index)
Sets TensorFloat32 variable data from C++ input.
Definition Block.cpp:2584
boost::python::object getFloat16Py(rogue::interfaces::memory::Variable *var, int32_t index)
Gets half-precision float variable data as Python output.
Definition Block.cpp:2133
uint64_t address()
Returns the full address of this block.
Definition Block.cpp:161
boost::python::object getFixedPy(rogue::interfaces::memory::Variable *var, int32_t index)
Gets fixed-point variable data as Python output.
Definition Block.cpp:3141
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:947
void addVariables(std::vector< std::shared_ptr< rogue::interfaces::memory::Variable > > variables)
Adds variables to this block (C++ API).
Definition Block.cpp:459
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:919
void setLogLevel(uint32_t level)
Sets logging verbosity level for this block.
Definition Block.h:273
std::string getString(rogue::interfaces::memory::Variable *var, int32_t index)
Gets string variable data as C++ output.
Definition Block.cpp:1598
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:3228
void rateTest()
Runs block rate-test helper for performance testing.
Definition Block.cpp:3281
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:3044
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:1199
std::vector< T > py_list_to_std_vector(const boost::python::object &iterable)
Definition Block.h:42