+ @staticmethod
+ def mask_and_shift_to_bits(width, mask, shift):
+ bits = []
+ val = mask << shift
+ for i in range(0, width):
+ if mask & (1 << i):
+ bits.insert(0, width - i - 1 - shift)
+ return bits
+
+ @staticmethod
+ def mask_to_bits(width, mask):
+ return bitfield.mask_and_shift_to_bits(width, mask, 0)
+