From e659640eeb35a48f16d84825b335580368ec06f1 Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Thu, 9 Jun 2022 21:27:36 +0000 Subject: Increment version to 0.25 Also insert the TOSA file identifier in the flatbuffer. Reports a warning if the identifier is not present when loading. Signed-off-by: Eric Kunze Change-Id: I1cd4a9cc78e898ba5015e29be1c65cb640dd6a00 --- python/serializer/tosa_serializer.py | 6 +++++- python/tosa/Version.py | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'python') diff --git a/python/serializer/tosa_serializer.py b/python/serializer/tosa_serializer.py index cd86777..929aebd 100644 --- a/python/serializer/tosa_serializer.py +++ b/python/serializer/tosa_serializer.py @@ -39,6 +39,10 @@ TOSA_VERSION = [ TOSA_VERSION_PATCH, TOSA_VERSION_DRAFT, ] + +# File identifier needs to be kept in sync with schema/tosa.fbs +TOSA_GRAPH_IDENTIFIER = b"\x54\x4F\x53\x41" + # With the way flatc generates its python types, there is no programatic way # to get string names for the integer types. Manually maintain a string table # here. @@ -703,7 +707,7 @@ class TosaSerializer: TosaGraph.AddBlocks(builder, fbv_bb) graph = TosaGraph.End(builder) - self.builder.Finish(graph) + self.builder.Finish(graph, TOSA_GRAPH_IDENTIFIER) return self.builder.Output() def writeJson(self, tosa_filename): diff --git a/python/tosa/Version.py b/python/tosa/Version.py index 95df414..27dea53 100644 --- a/python/tosa/Version.py +++ b/python/tosa/Version.py @@ -36,7 +36,7 @@ class Version(object): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) if o != 0: return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) - return 24 + return 25 # Version def _patch(self): @@ -54,7 +54,7 @@ class Version(object): def VersionStart(builder): builder.StartObject(4) def VersionAdd_major(builder, Major): builder.PrependInt32Slot(0, Major, 0) -def VersionAdd_minor(builder, Minor): builder.PrependInt32Slot(1, Minor, 24) +def VersionAdd_minor(builder, Minor): builder.PrependInt32Slot(1, Minor, 25) def VersionAdd_patch(builder, Patch): builder.PrependInt32Slot(2, Patch, 0) def VersionAdd_draft(builder, Draft): builder.PrependBoolSlot(3, Draft, 1) def VersionEnd(builder): return builder.EndObject() -- cgit v1.2.1