aboutsummaryrefslogtreecommitdiff
path: root/python/serializer/tosa_serializer.py
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2022-06-09 21:27:36 +0000
committerEric Kunze <eric.kunze@arm.com>2022-06-13 15:22:10 +0000
commite659640eeb35a48f16d84825b335580368ec06f1 (patch)
tree67efbf6b8a6560c9ecb2426792ec243cc54e809b /python/serializer/tosa_serializer.py
parentae906de847e225cd0ae44f25bb21fc228707bc4d (diff)
downloadserialization_lib-e659640eeb35a48f16d84825b335580368ec06f1.tar.gz
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 <eric.kunze@arm.com> Change-Id: I1cd4a9cc78e898ba5015e29be1c65cb640dd6a00
Diffstat (limited to 'python/serializer/tosa_serializer.py')
-rw-r--r--python/serializer/tosa_serializer.py6
1 files changed, 5 insertions, 1 deletions
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):