#define DEVICETYPE_TRIV2 (0x40000) /** VD/SR-NPU 2020 */
/** TODO: there will be other device variants */
#define DEVICETYPE_MASK (0xFFFF0000)
+#define DEVICEGROUP_MASK (0x0000FF00)
+#define DEVICEVERSION_MASK (0x000000FF)
+
+#define DEVICEGROUP_SOCIP (0x00000100)
/**
* @brief Represents an "opened" single NPU device (e.g., TRIV2).
/**
* @brief Description of npu device types.
+ * @note The enum format is
+ * 0b|0000 0000|0000 0000|
+ * 0b|dev group| version |
*/
typedef enum {
NPUCOND_CONN_UNKNOWN = DEVICETYPE_TRIV2,
/* TRIV2 */
- NPUCOND_TRIV2_CONN_UNKNOWN = (DEVICETYPE_TRIV2 | 0),
- NPUCOND_TRIV2_CONN_SOCIP = (DEVICETYPE_TRIV2 | 2),
+ NPUCOND_TRIV2_CONN_UNKNOWN = (DEVICETYPE_TRIV2 | 3),
+ NPUCOND_TRIV2_CONN_SOCIP = (NPUCOND_TRIV2_CONN_UNKNOWN | DEVICEGROUP_SOCIP),
+ NPUCOND_TRIV24_CONN_UNKNOWN = (DEVICETYPE_TRIV2 | 4),
+ NPUCOND_TRIV24_CONN_SOCIP = (NPUCOND_TRIV24_CONN_UNKNOWN | DEVICEGROUP_SOCIP),
/* deprecated */
NPUCOND_TRIV_CONN_UNKNOWN = (DEVICETYPE_TRIV | 0),
NPUCOND_TRIV_CONN_SOCIP = (DEVICETYPE_TRIV | 2),
/** @brief Trinity Vision2 (TRIV2) class */
class TrinityVision2 : public Device {
public:
- TrinityVision2 (int id) : Device (NPUCOND_TRIV2_CONN_SOCIP, id) {}
+ TrinityVision2 (int id) : Device (NPUCOND_TRIV23_CONN_SOCIP, id) {}
~TrinityVision2 () {}
static size_t manipulateData (const Model *model, uint32_t idx, bool is_input, void *dst,
#include <iostream>
#define TAG _N94
-#define MAX_EMUL_DEVICES (3)
-#define DEFAULT_DSPM_SIZE (128 * 1024) /* 128 KiB */
+#define MAX_EMUL_DEVICES (4)
+#define TRIV23_DEFAULT_DSPM_SIZE (128 * 1024) /* 128 KiB */
+#define TRIV24_DEFAULT_DSPM_SIZE (256 * 1024) /* 128 KiB */
#define RESERVED_DSPM_SIZE (64 * 1024) /* 64 KiB */
#define ENVNAME_DSPM_SIZE ("MRPSIM_SPM_SIZE")
return -EINVAL;
}
- *dspm = DEFAULT_DSPM_SIZE;
+ *dspm = TRIV23_DEFAULT_DSPM_SIZE;
char *dspm_str = getenv (ENVNAME_DSPM_SIZE);
if (dspm_str != NULL) {