summaryrefslogtreecommitdiffstats
path: root/src/broadcom/cle
diff options
context:
space:
mode:
Diffstat (limited to 'src/broadcom/cle')
-rw-r--r--src/broadcom/cle/gen_pack_header.py8
-rw-r--r--src/broadcom/cle/meson.build26
2 files changed, 16 insertions, 18 deletions
diff --git a/src/broadcom/cle/gen_pack_header.py b/src/broadcom/cle/gen_pack_header.py
index 5fde7bb07ad..df547fb5ab1 100644
--- a/src/broadcom/cle/gen_pack_header.py
+++ b/src/broadcom/cle/gen_pack_header.py
@@ -392,7 +392,7 @@ class Value(object):
self.value = int(attrs["value"])
class Parser(object):
- def __init__(self):
+ def __init__(self, ver):
self.parser = xml.parsers.expat.ParserCreate()
self.parser.StartElementHandler = self.start_element
self.parser.EndElementHandler = self.end_element
@@ -403,6 +403,7 @@ class Parser(object):
# Set of enum names we've seen.
self.enums = set()
self.registers = {}
+ self.ver = ver
def gen_prefix(self, name):
if name[0] == "_":
@@ -415,8 +416,7 @@ class Parser(object):
def start_element(self, name, attrs):
if name == "vcxml":
- self.platform = "V3D {}".format(attrs["gen"])
- self.ver = attrs["gen"].replace('.', '')
+ self.platform = "V3D {}.{}".format(self.ver[0], self.ver[1])
print(pack_header % {'license': license, 'platform': self.platform, 'guard': self.gen_guard()})
elif name in ("packet", "struct", "register"):
default_field = None
@@ -579,5 +579,5 @@ if len(sys.argv) < 2:
input_file = sys.argv[1]
-p = Parser()
+p = Parser(sys.argv[2])
p.parse(input_file)
diff --git a/src/broadcom/cle/meson.build b/src/broadcom/cle/meson.build
index b1ff8322524..a45538c986f 100644
--- a/src/broadcom/cle/meson.build
+++ b/src/broadcom/cle/meson.build
@@ -26,30 +26,28 @@ v3d_versions = [
]
v3d_xml_files = []
-foreach v: v3d_versions
- v3d_xml_files += 'v3d_packet_v@[email protected]'.format(v)
-endforeach
-
-v3d_xml_h = custom_target(
- 'v3d_xml.h',
- input : ['../../intel/genxml/gen_zipped_file.py', v3d_xml_files],
- output : 'v3d_xml.h',
- command : [prog_python2, '@INPUT@'],
- capture : true,
-)
-
v3d_xml_pack = []
-foreach f : v3d_xml_files
+foreach v : v3d_versions
+ f = 'v3d_packet_v@[email protected]'.format(v)
_name = '@0@_pack.h'.format(f.split('.')[0])
+ v3d_xml_files += f
v3d_xml_pack += custom_target(
_name,
input : ['gen_pack_header.py', f],
output : _name,
- command : [prog_python2, '@INPUT@'],
+ command : [prog_python2, '@INPUT@', '@0@'.format(v)],
capture : true,
)
endforeach
+v3d_xml_h = custom_target(
+ 'v3d_xml.h',
+ input : ['../../intel/genxml/gen_zipped_file.py', v3d_xml_files],
+ output : 'v3d_xml.h',
+ command : [prog_python2, '@INPUT@'],
+ capture : true,
+)
+
libbroadcom_cle = static_library(
['broadcom_cle', v3d_xml_h],
'v3d_decoder.c',