From: Eric Anholt Date: Mon, 23 Oct 2017 19:47:28 +0000 (-0700) Subject: broadcom/xml: Throw an #error in XML-based codegen for a >1bit bool X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=443e1984d2ce42580856489a0adb987f6af64786;p=mesa.git broadcom/xml: Throw an #error in XML-based codegen for a >1bit bool I've debugged two nasty errors now due to copy-and-pasting a bool type when writing a uint field. Make sure I don't do that again. --- diff --git a/src/broadcom/cle/gen_pack_header.py b/src/broadcom/cle/gen_pack_header.py index badcc2c587c..d458c2b1c40 100644 --- a/src/broadcom/cle/gen_pack_header.py +++ b/src/broadcom/cle/gen_pack_header.py @@ -111,6 +111,9 @@ class Field(object): self.end = self.start + int(attrs["size"]) - 1 self.type = attrs["type"] + if self.type == 'bool' and self.start != self.end: + print("#error Field {} has bool type but more than one bit of size".format(self.name)); + if "prefix" in attrs: self.prefix = safe_name(attrs["prefix"]).upper() else: