Chris recently fixed a bunch of genxml end < start bugs, as well as
booleans that are wider than a bit. These are way too easy to write, so
asserting that the fields are sane is a good plan.
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
self.end = int(attrs["end"])
self.type = attrs["type"]
+ assert self.start <= self.end, \
+ 'field {} has end ({}) < start ({})'.format(self.name, self.end,
+ self.start)
+ if self.type == 'bool':
+ assert self.end == self.start, \
+ 'bool field ({}) is too wide'.format(self.name)
+
if "prefix" in attrs:
self.prefix = attrs["prefix"]
else: