Lines Matching refs:attrs
297 def __init__(self, attrs, domain, variant, parent, index_type): argument
298 if "name" in attrs:
299 self.local_name = attrs["name"]
310 if "offsets" in attrs:
311 self.offsets = map(lambda i: "0x%08x" % int(i, 0), attrs["offsets"].split(","))
313 elif "doffsets" in attrs:
314 self.offsets = map(lambda s: "(%s)" % s , attrs["doffsets"].split(","))
317 self.offset = int(attrs["offset"], 0)
318 self.stride = int(attrs["stride"], 0)
320 if "index" in attrs:
324 self.length = int(attrs["length"], 0)
325 if "usage" in attrs:
326 self.usages = attrs["usage"].split(',')
387 def __init__(self, attrs, domain, array, bit_size): argument
388 self.name = attrs["name"]
391 self.offset = int(attrs["offset"], 0)
398 if "stride" in attrs:
399 self.stride = int(attrs["stride"], 0)
400 self.length = int(attrs["length"], 0)
492 def parse_field(self, name, attrs): argument
494 if "pos" in attrs:
495 high = low = int(attrs["pos"], 0)
496 elif "high" in attrs and "low" in attrs:
497 high = int(attrs["high"], 0)
498 low = int(attrs["low"], 0)
503 if "type" in attrs:
504 type = attrs["type"]
508 if "shr" in attrs:
509 shr = int(attrs["shr"], 0)
516 b.radix = int(attrs["radix"], 0)
522 def parse_varset(self, attrs): argument
525 if "varset" in attrs:
526 varset = self.enums[attrs["varset"]]
529 def parse_variants(self, attrs): argument
530 if "variants" not in attrs:
533 variant = attrs["variants"].split(",")[0]
534 varset = self.parse_varset(attrs)
549 def add_all_variants(self, reg, attrs, parent_variant): argument
553 variant = self.parse_variants(attrs)
633 def parse_reg(self, attrs, bit_size): argument
635 if "type" in attrs and attrs["type"] in self.bitsets:
636 bitset = self.bitsets[attrs["type"]]
638 self.current_bitset = Bitset(attrs["name"], bitset)
643 self.current_bitset = Bitset(attrs["name"], None)
645 if "type" in attrs:
646 self.parse_field(None, attrs)
648 variant = self.parse_variants(attrs)
652 self.current_reg = Reg(attrs, self.prefix(variant), self.current_array, bit_size)
660 self.add_all_variants(self.current_reg, attrs, variant)
663 if "usage" in attrs:
664 usages = attrs["usage"].split(',')
670 def start_element(self, name, attrs): argument
673 filename = attrs["file"]
676 self.current_domain = attrs["name"]
677 if "prefix" in attrs:
678 self.current_prefix = sanitize_variant(self.parse_variants(attrs))
679 self.current_prefix_type = attrs["prefix"]
683 if "varset" in attrs:
684 self.current_varset = self.enums[attrs["varset"]]
686 self.current_stripe = sanitize_variant(self.parse_variants(attrs))
689 self.current_enum = Enum(attrs["name"])
690 self.enums[attrs["name"]] = self.current_enum
694 if "value" in attrs:
695 value = int(attrs["value"], 0)
698 self.current_enum.values.append((attrs["name"], value))
700 self.parse_reg(attrs, 32)
702 self.parse_reg(attrs, 64)
705 variant = self.parse_variants(attrs)
706 index_type = self.enums[attrs["index"]] if "index" in attrs else None
707 self.current_array = Array(attrs, self.prefix(variant), variant, self.current_array, index_type)
711 self.current_bitset = Bitset(attrs["name"], None)
712 if "inline" in attrs and attrs["inline"] == "yes":
718 self.parse_field(attrs["name"], attrs)
720 self.do_validate(attrs["xsi:schemaLocation"])
736 attrs = {
740 self.parse_reg(attrs, 32)