aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorEric Kunze <eric.kunze@arm.com>2024-04-16 18:08:08 -0700
committerEric Kunze <eric.kunze@arm.com>2024-04-18 21:23:44 -0700
commite6c07c8f97f84706e0105ec659462d262283dd95 (patch)
treefe377a2224b970082009bf1f0e27963d4ac8ab62 /tools
parent0e121c064e051716bdfca892b210fa52c792ac29 (diff)
downloadspecification-e6c07c8f97f84706e0105ec659462d262283dd95.tar.gz
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 <eric.kunze@arm.com> Change-Id: If0358c8b189f8b2aa11cde3379076c0cc28bf17d
Diffstat (limited to 'tools')
-rwxr-xr-xtools/genspec.py13
-rw-r--r--tools/tosa.py8
2 files changed, 15 insertions, 6 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):