From e6c07c8f97f84706e0105ec659462d262283dd95 Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Tue, 16 Apr 2024 18:08:08 -0700 Subject: Add version_added to each op_profile Allows for future tools to take action on which version the operator/profile first appears. Signed-off-by: Eric Kunze Change-Id: If0358c8b189f8b2aa11cde3379076c0cc28bf17d --- tools/genspec.py | 13 +- tools/tosa.py | 8 +- tosa.xml | 820 +++++++++++++++++++++++++++---------------------------- tosa.xsd | 1 + 4 files changed, 426 insertions(+), 416 deletions(-) diff --git a/tools/genspec.py b/tools/genspec.py index 7710c07..38babec 100755 --- a/tools/genspec.py +++ b/tools/genspec.py @@ -188,12 +188,14 @@ class TOSASpecAsciidocGenerator: f.write(f"{profile.description}\n\n") f.write(f"Status: {profile.status}\n") f.write("|===\n") - f.write("|Operator|mode\n\n") + f.write("|Operator|Mode|Version Added\n\n") for op in sorted(all_operators, key=lambda o: o.name): if op.typesupports: for tysup in op.typesupports: if profile.name in tysup.profiles: - f.write(f"|{op.name}|{tysup.mode}\n") + f.write( + f"|{op.name}|{tysup.mode}|{tysup.version_added}\n" + ) f.write("|===\n") f.write("=== Profile Extensions\n") @@ -203,7 +205,7 @@ class TOSASpecAsciidocGenerator: f.write(f"Status: {pext.status}\n\n") f.write(f"Compatible profiles: {', '.join(pext.profiles)}\n\n") f.write("|===\n") - f.write("|Operator|mode|note\n\n") + f.write("|Operator|Mode|Version Added|Note\n\n") for op in sorted(all_operators, key=lambda o: o.name): if op.typesupports: for tysup in op.typesupports: @@ -216,7 +218,10 @@ class TOSASpecAsciidocGenerator: note = f"If {m[2]} is also supported" else: note = f"If {m[1]} is also supported" - f.write(f"|{op.name}|{tysup.mode}|{note}\n") + f.write( + f"|{op.name}|{tysup.mode}|" + f"{tysup.version_added}|{note}\n" + ) f.write("|===\n") diff --git a/tools/tosa.py b/tools/tosa.py index 016aba6..a0e4ddb 100644 --- a/tools/tosa.py +++ b/tools/tosa.py @@ -89,10 +89,11 @@ class TOSAOperatorArgument: class TOSAOperatorDataTypeSupport: - def __init__(self, mode, tymap, profiles=None): + def __init__(self, mode, tymap, version_added, profiles): self.mode = mode self.tymap = tymap self.profiles = profiles + self.version_added = version_added class TOSAOperator: @@ -195,6 +196,7 @@ class TOSASpec: for tysup in op.findall("typesupport"): tsmode = tysup.get("mode") tsmap = {} + version_added = tysup.get("version_added") profiles = tysup.findall("op_profile") tsprofiles = [] for p in profiles: @@ -208,7 +210,9 @@ class TOSASpec: tsprofiles.append(tsp_name) for ty in types: tsmap[ty] = tysup.get(ty) - typesupports.append(TOSAOperatorDataTypeSupport(tsmode, tsmap, tsprofiles)) + typesupports.append( + TOSAOperatorDataTypeSupport(tsmode, tsmap, version_added, tsprofiles) + ) return TOSAOperator(name, args, types, typesupports) def __load_operator_argument(self, arg, op_name): diff --git a/tosa.xml b/tosa.xml index f95b09c..0cd791e 100644 --- a/tosa.xml +++ b/tosa.xml @@ -57,25 +57,25 @@ - + - + - + - + - + - + - + @@ -127,28 +127,28 @@ - + - + - + - + - + - + - + - + @@ -219,31 +219,31 @@ - + - + - + - + - + - + - + - + - + @@ -317,31 +317,31 @@ - + - + - + - + - + - + - + - + - + @@ -411,31 +411,31 @@ - + - + - + - + - + - + - + - + - + @@ -476,7 +476,7 @@ - + @@ -514,25 +514,25 @@ - + - + - + - + - + - + - + @@ -564,28 +564,28 @@ - + - + - + - + - + - + - + - + @@ -624,25 +624,25 @@ - + - + - + - + - + - + - + @@ -675,7 +675,7 @@ - + @@ -741,31 +741,31 @@ - + - + - + - + - + - + - + - + - + @@ -795,19 +795,19 @@ - + - + - + - + - + @@ -827,13 +827,13 @@ - + - + - + @@ -853,13 +853,13 @@ - + - + - + @@ -879,13 +879,13 @@ - + - + - + @@ -911,17 +911,17 @@ - + - + - + - + @@ -949,13 +949,13 @@ - + - + - + @@ -979,13 +979,13 @@ - + - + - + @@ -1009,13 +1009,13 @@ - + - + - + @@ -1039,13 +1039,13 @@ - + - + - + @@ -1069,7 +1069,7 @@ - + @@ -1094,7 +1094,7 @@ - + @@ -1119,15 +1119,15 @@ - + - + - + @@ -1152,15 +1152,15 @@ - + - + - + @@ -1185,7 +1185,7 @@ - + @@ -1210,7 +1210,7 @@ - + @@ -1235,16 +1235,16 @@ - + - + - + - + @@ -1268,16 +1268,16 @@ - + - + - + - + @@ -1306,23 +1306,23 @@ - + - + - + - + - + - + @@ -1346,13 +1346,13 @@ - + - + - + @@ -1376,17 +1376,17 @@ - + - + - + - + @@ -1413,10 +1413,10 @@ - + - + @@ -1438,16 +1438,16 @@ - + - + - + - + @@ -1467,13 +1467,13 @@ - + - + - + @@ -1493,13 +1493,13 @@ - + - + - + @@ -1519,7 +1519,7 @@ - + @@ -1539,13 +1539,13 @@ - + - + - + @@ -1565,13 +1565,13 @@ - + - + - + @@ -1591,13 +1591,13 @@ - + - + - + @@ -1617,13 +1617,13 @@ - + - + - + @@ -1643,7 +1643,7 @@ - + @@ -1673,22 +1673,22 @@ - + - + - + - + - + - + @@ -1708,13 +1708,13 @@ - + - + - + @@ -1734,13 +1734,13 @@ - + - + - + @@ -1770,26 +1770,26 @@ - + - + - + - + - + - + - + @@ -1809,13 +1809,13 @@ - + - + - + @@ -1842,16 +1842,16 @@ - + - + - + - + @@ -1876,16 +1876,16 @@ - + - + - + - + @@ -1910,16 +1910,16 @@ - + - + - + - + @@ -1944,7 +1944,7 @@ - + @@ -1968,7 +1968,7 @@ - + @@ -1992,22 +1992,22 @@ - + - + - + - + - + - + @@ -2030,22 +2030,22 @@ - + - + - + - + - + - + @@ -2068,13 +2068,13 @@ - + - + - + @@ -2098,16 +2098,16 @@ - + - + - + - + @@ -2133,32 +2133,32 @@ - + - + - + - + - + - + - + - + - + @@ -2187,32 +2187,32 @@ - + - + - + - + - + - + - + - + - + @@ -2236,32 +2236,32 @@ - + - + - + - + - + - + - + - + - + @@ -2285,32 +2285,32 @@ - + - + - + - + - + - + - + - + - + @@ -2339,32 +2339,32 @@ used. - + - + - + - + - + - + - + - + - + @@ -2388,32 +2388,32 @@ used. - + - + - + - + - + - + - + - + - + @@ -2437,32 +2437,32 @@ used. - + - + - + - + - + - + - + - + - + @@ -2487,28 +2487,28 @@ used. - + - + - + - + - + - + - + - + @@ -2535,28 +2535,28 @@ used. - + - + - + - + - + - + - + - + @@ -2597,25 +2597,25 @@ used. - + - + - + - + - + - + - + @@ -2638,142 +2638,142 @@ used. - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -2830,40 +2830,40 @@ used. - + - + - + - + - + - + - + - + - + - + - + - + @@ -2884,37 +2884,37 @@ used. - + - + - + - + - + - + - + - + - + - + - + @@ -2933,37 +2933,37 @@ used. - + - + - + - + - + - + - + - + - + - + - + @@ -2993,7 +2993,7 @@ used. - + @@ -3023,7 +3023,7 @@ used. - + @@ -3047,7 +3047,7 @@ used. - + @@ -3078,13 +3078,13 @@ used. - + - + - + @@ -3104,13 +3104,13 @@ used. - + - + - + @@ -3130,13 +3130,13 @@ used. - + - + - + @@ -3158,7 +3158,7 @@ used. - + @@ -3176,7 +3176,7 @@ used. - + @@ -3194,7 +3194,7 @@ used. - + @@ -3218,32 +3218,32 @@ used. - + - + - + - + - + - + - + - + - + @@ -3263,7 +3263,7 @@ used. - + @@ -3284,7 +3284,7 @@ used. - + @@ -3305,7 +3305,7 @@ used. - + diff --git a/tosa.xsd b/tosa.xsd index d5d7dca..e8ce657 100644 --- a/tosa.xsd +++ b/tosa.xsd @@ -289,6 +289,7 @@ + -- cgit v1.2.1