From 132acad52654a72d638faeaed8dc1488d5b1fe15 Mon Sep 17 00:00:00 2001 From: Eric Kunze Date: Wed, 10 Apr 2024 16:54:16 -0700 Subject: Add allowed profiles for each extension Each extension can contain a list of profiles that it works with. Signed-off-by: Eric Kunze Change-Id: I7cf2ad0c57fc8a36500212b7d554a8153fc2efe5 --- tools/genspec.py | 6 ++++-- tools/tosa.py | 6 ++++-- tosa.xml | 29 ++++++++++++++++++++++------- tosa.xsd | 3 +++ 4 files changed, 33 insertions(+), 11 deletions(-) diff --git a/tools/genspec.py b/tools/genspec.py index bae11cc..7710c07 100755 --- a/tools/genspec.py +++ b/tools/genspec.py @@ -137,10 +137,11 @@ class TOSASpecAsciidocGenerator: # Generate profile table with open(os.path.join(outdir, "profile_extensions.adoc"), "w") as f: f.write("|===\n") - f.write("|Name|Description|Specification Status\n\n") + f.write("|Name|Description|Allowed profiles|Specification Status\n\n") for profile_extension in self.spec.profile_extensions: f.write( f"|{profile_extension.name}|{profile_extension.description}" + f"|{','.join(profile_extension.profiles)}" f"|{profile_extension.status}\n" ) f.write("|===\n") @@ -199,7 +200,8 @@ class TOSASpecAsciidocGenerator: for pext in self.spec.profile_extensions: f.write(f"==== {pext.name} extension\n") f.write(f"{pext.description}\n\n") - f.write(f"Status: {pext.status}\n") + 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") for op in sorted(all_operators, key=lambda o: o.name): diff --git a/tools/tosa.py b/tools/tosa.py index e70b297..016aba6 100644 --- a/tools/tosa.py +++ b/tools/tosa.py @@ -41,10 +41,11 @@ class TOSAProfile: class TOSAProfileExtension: - def __init__(self, name, description, status): + def __init__(self, name, description, status, profiles): self.name = name self.description = description self.status = status + self.profiles = profiles self.ops = [] @@ -155,7 +156,8 @@ class TOSASpec: name = ext.get("name") description = ext.get("description") status = ext.get("status") - return TOSAProfileExtension(name, description, status) + profiles = [x.text for x in ext] + return TOSAProfileExtension(name, description, status, profiles) def __load_level(self, level): name = level.get("name") diff --git a/tosa.xml b/tosa.xml index be25eca..f95b09c 100644 --- a/tosa.xml +++ b/tosa.xml @@ -7,13 +7,28 @@ - - - - - - - + + BI + + + BI + + + MI + + + MI + + + MI + + + MI + + + BI + MI + No level diff --git a/tosa.xsd b/tosa.xsd index dec20eb..d5d7dca 100644 --- a/tosa.xsd +++ b/tosa.xsd @@ -147,6 +147,9 @@ + + + -- cgit v1.2.1