From e4d6a1b99337f33cfaf343005e355ef7a68b2be9 Mon Sep 17 00:00:00 2001 From: Dominic Symes Date: Fri, 4 Nov 2022 18:00:03 +0000 Subject: Add Levels defintion Add definition of Level 1.0. Signed-off-by: Dominic Symes Change-Id: I1b34ae22396f273cc5ecdf99198fdbece6e2809c --- tools/tosa.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tools/tosa.py') diff --git a/tools/tosa.py b/tools/tosa.py index 87b4f1a..2c2f8ec 100644 --- a/tools/tosa.py +++ b/tools/tosa.py @@ -9,12 +9,13 @@ class TOSAOperatorArgumentCategory: class TOSAOperatorArgument: - def __init__(self, name, description, categories, ty, shape): + def __init__(self, name, description, categories, ty, shape, levellimits): self.name = name self.description = description self.categories = categories self.type = ty self.shape = shape + self.levellimits = levellimits class TOSAOperatorDataTypeSupport: @@ -87,6 +88,11 @@ class TOSASpec: argcats = [] argtype = arg.get("type") shape = arg.get("shape") + levellimits = [] + for levellimit in arg.findall("levellimit"): + value = levellimit.get("value") + limit = levellimit.get("limit") + levellimits.append([value, limit]) cats = re.findall( r"(input|output|attribute)\(?([A-Z,]+)?\)?", arg.get("category") @@ -94,4 +100,4 @@ class TOSASpec: for cat in cats: argcats.append(TOSAOperatorArgumentCategory(cat[0], cat[1].split(","))) - return TOSAOperatorArgument(name, desc, argcats, argtype, shape) + return TOSAOperatorArgument(name, desc, argcats, argtype, shape, levellimits) -- cgit v1.2.1