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.
This commit is contained in:
Eric Anholt 2017-10-23 12:47:28 -07:00
parent e2f114b32b
commit 443e1984d2

View file

@ -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: