Lines Matching refs:attrs

280 	def __init__(self, attrs, domain, variant, parent, index_type):  argument
281 if "name" in attrs:
282 self.local_name = attrs["name"]
292 if "offsets" in attrs:
293 self.offsets = map(lambda i: "0x%08x" % int(i, 0), attrs["offsets"].split(","))
295 elif "doffsets" in attrs:
296 self.offsets = map(lambda s: "(%s)" % s , attrs["doffsets"].split(","))
299 self.offset = int(attrs["offset"], 0)
300 self.stride = int(attrs["stride"], 0)
302 if "index" in attrs:
306 self.length = int(attrs["length"], 0)
307 if "usage" in attrs:
308 self.usages = attrs["usage"].split(',')
366 def __init__(self, attrs, domain, array, bit_size): argument
367 self.name = attrs["name"]
370 self.offset = int(attrs["offset"], 0)
376 if "stride" in attrs:
377 self.stride = int(attrs["stride"], 0)
378 self.length = int(attrs["length"], 0)
464 def parse_field(self, name, attrs): argument
466 if "pos" in attrs:
467 high = low = int(attrs["pos"], 0)
468 elif "high" in attrs and "low" in attrs:
469 high = int(attrs["high"], 0)
470 low = int(attrs["low"], 0)
475 if "type" in attrs:
476 type = attrs["type"]
480 if "shr" in attrs:
481 shr = int(attrs["shr"], 0)
488 b.radix = int(attrs["radix"], 0)
494 def parse_varset(self, attrs): argument
497 if "varset" in attrs:
498 varset = self.enums[attrs["varset"]]
501 def parse_variants(self, attrs): argument
502 if not "variants" in attrs:
504 variant = attrs["variants"].split(",")[0]
508 varset = self.parse_varset(attrs)
514 def add_all_variants(self, reg, attrs, parent_variant): argument
518 variant = self.parse_variants(attrs)
601 def parse_reg(self, attrs, bit_size): argument
603 if "type" in attrs and attrs["type"] in self.bitsets:
604 bitset = self.bitsets[attrs["type"]]
606 self.current_bitset = Bitset(attrs["name"], bitset)
611 self.current_bitset = Bitset(attrs["name"], None)
613 if "type" in attrs:
614 self.parse_field(None, attrs)
616 variant = self.parse_variants(attrs)
620 self.current_reg = Reg(attrs, self.prefix(variant), self.current_array, bit_size)
627 self.add_all_variants(self.current_reg, attrs, variant)
630 if "usage" in attrs:
631 usages = attrs["usage"].split(',')
637 def start_element(self, name, attrs): argument
640 filename = attrs["file"]
643 self.current_domain = attrs["name"]
644 if "prefix" in attrs:
645 self.current_prefix = self.parse_variants(attrs)
646 self.current_prefix_type = attrs["prefix"]
650 if "varset" in attrs:
651 self.current_varset = self.enums[attrs["varset"]]
653 self.current_stripe = self.parse_variants(attrs)
656 self.current_enum = Enum(attrs["name"])
657 self.enums[attrs["name"]] = self.current_enum
661 if "value" in attrs:
662 value = int(attrs["value"], 0)
665 self.current_enum.values.append((attrs["name"], value))
667 self.parse_reg(attrs, 32)
669 self.parse_reg(attrs, 64)
672 variant = self.parse_variants(attrs)
673 index_type = self.enums[attrs["index"]] if "index" in attrs else None
674 self.current_array = Array(attrs, self.prefix(variant), variant, self.current_array, index_type)
678 self.current_bitset = Bitset(attrs["name"], None)
679 if "inline" in attrs and attrs["inline"] == "yes":
685 self.parse_field(attrs["name"], attrs)
687 self.do_validate(attrs["xsi:schemaLocation"])
689 self.copyright_year = attrs["year"]
691 self.authors.append(attrs["name"] + " <" + attrs["email"] + "> " + attrs["name"])