Lines Matching full:attrs
236 def __init__(self, attrs, domain): argument
237 if "name" in attrs:
238 self.name = attrs["name"]
242 self.offset = int(attrs["offset"], 0)
243 self.stride = int(attrs["stride"], 0)
244 self.length = int(attrs["length"], 0)
253 def __init__(self, attrs, domain, array, bit_size): argument
254 self.name = attrs["name"]
257 self.offset = int(attrs["offset"], 0)
282 def parse_variants(attrs): argument
283 if not "variants" in attrs:
285 variant = attrs["variants"].split(",")[0]
314 def parse_field(self, name, attrs): argument
316 if "pos" in attrs:
317 high = low = int(attrs["pos"], 0)
318 elif "high" in attrs and "low" in attrs:
319 high = int(attrs["high"], 0)
320 low = int(attrs["low"], 0)
325 if "type" in attrs:
326 type = attrs["type"]
330 if "shr" in attrs:
331 shr = int(attrs["shr"], 0)
338 b.radix = int(attrs["radix"], 0)
359 def parse_reg(self, attrs, bit_size): argument
360 if "type" in attrs and attrs["type"] in self.bitsets:
361 self.current_bitset = self.bitsets[attrs["type"]]
363 self.current_bitset = Bitset(attrs["name"], None)
365 if "type" in attrs:
366 self.parse_field(None, attrs)
368 self.current_reg = Reg(attrs, self.prefix(), self.current_array, bit_size)
374 def start_element(self, name, attrs): argument
376 filename = attrs["file"]
379 self.current_domain = attrs["name"]
380 if "prefix" in attrs and attrs["prefix"] == "chip":
381 self.current_prefix = parse_variants(attrs)
383 self.current_stripe = parse_variants(attrs)
386 self.current_enum = Enum(attrs["name"])
387 self.enums[attrs["name"]] = self.current_enum
391 if "value" in attrs:
392 value = int(attrs["value"], 0)
395 self.current_enum.values.append((attrs["name"], value))
398 self.parse_reg(attrs, 32)
400 self.parse_reg(attrs, 64)
402 self.current_array = Array(attrs, self.prefix())
406 self.current_bitset = Bitset(attrs["name"], None)
407 if "inline" in attrs and attrs["inline"] == "yes":
413 self.parse_field(attrs["name"], attrs)