/* size of metadata */
-/* unit size of metadata (minimal size) */
+/* @brief unit size of metadata (minimal size) */
#define NPUBIN_META_SIZE (4096)
-/* number of extended metadata */
+
+/**
+ * @deprecated valid if extended metasize < 1MB. otherwise, use 'extended_metasize' field.
+ * @brief number of extended metadata
+ */
#define NPUBIN_META_NUM_EXTENDED(magiccode) (((magiccode) >> 8) & 0xFFULL)
-/* @brief return extended metadata size of npu binary */
+/**
+ * @deprecated valid if extended metasize < 1MB. otherwise, use 'extended_metasize' field.
+ * @brief return extended metadata size of npu binary
+ */
static inline uint64_t
NPUBIN_META_EXTENDED_SIZE (uint64_t magiccode) {
uint64_t num_extended = NPUBIN_META_NUM_EXTENDED (magiccode);
return num_extended * NPUBIN_META_SIZE;
}
-/* @brief return total metadata size of npu binary, including extended data */
+/**
+ * @deprecated valid if extended metasize < 1MB. otherwise, use 'extended_metasize' field.
+ * @brief return total metadata size of npu binary, including extended data
+ */
static inline uint64_t
NPUBIN_META_TOTAL_SIZE (uint64_t magiccode) {
uint64_t size_extended = NPUBIN_META_EXTENDED_SIZE (magiccode);
* CHECK_NPUBIN(magiccode) should be true. Also, its least significant byte indicates
* the npubinfmt's version. E.g., if npubinfmt is v2, NPUBIN_VERSION(magiccode) == 2.
*
+ * CAUTION: the following descriptions for extended metadata are valid only when
+ * 'extended_metasize' field is zero. Otherwise, 'EXTENDED' bits are ignored.
+ *
* Also, the size of metadata can be extended depending on the 'EXTENDED' field. E.g.,
* if 'EXTENDED' is 0, the size of metadata is NPUBIN_META_SIZE. If it's larger than 0,
* the actual size of metadata is NPUBIN_META_SIZE + NPUBIN_META_EXTENDED_SIZE(magiccode),
/**< Size of this model, including this meta */
model_opmode type;
/**< Type of the model, consistent with model_opmode. Refer to typedef.h */
- uint32_t dummy;
- /**< FIXME: Dummy field to keep an aligned offset */
+ uint32_t extended_metasize;
+ /**< The size of extended metadata */
/**
* If input comes from host, the buffer may be filled with input data.