From c781897e5256940ba5c63b780b3e57ec64c7cf77 Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Tue, 15 Feb 2022 14:23:35 +1100 Subject: [PATCH] Tools: powr_change.py also prints AccFlags changes --- Tools/scripts/powr_change.py | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Tools/scripts/powr_change.py b/Tools/scripts/powr_change.py index 326fb4948b..3d515ceedc 100755 --- a/Tools/scripts/powr_change.py +++ b/Tools/scripts/powr_change.py @@ -43,11 +43,14 @@ class POWRChange(object): break if current is None: current_flags = 0 + current_accflags = 0 + have_accflags = hasattr(m, "AccFlags") else: current_flags = current.Flags + if have_accflags: + current_accflags = current.AccFlags + flags = m.Flags - if flags == current_flags: - continue line = "" for bit in range(0, 32): # range? mask = 1 << bit @@ -58,6 +61,19 @@ class POWRChange(object): elif not new_bit_set and old_bit_set: line += " -%s" % self.bit_description(bit) + if have_accflags: + accflags = m.AccFlags + old_acc_bit_set = current_accflags & mask + new_acc_bit_set = accflags & mask + + if new_acc_bit_set and not old_acc_bit_set: + line += " ACCFLAGS+%s" % self.bit_description(bit) + elif not new_bit_set and old_bit_set: + line += " ACCFLAGS-%s" % self.bit_description(bit) + + if len(line) == 0: + continue + current = m timestamp = getattr(m, '_timestamp', 0.0)