--- decoders/lpc/pd.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
diff --git a/decoders/lpc/pd.py b/decoders/lpc/pd.py index f9fefd0..9e73b0d 100644 --- a/decoders/lpc/pd.py +++ b/decoders/lpc/pd.py @@ -165,7 +165,8 @@ def handle_get_start(self): # LFRAME# is de-asserted (high). Last START field was last clock cycle, # we are now reading the CYCTYPE + DIR field. if self.lframe == 1: - self.state = 'GET CT/DR' + # aborted cycle -> go back to idle state, otherwise read type+dir + self.state = 'GET CT/DR' if self.start_field != 0b1111 else 'IDLE' return # The last value of LAD[3:0] before LFRAME# gets de-asserted is what @@ -173,8 +174,11 @@ def handle_get_start(self): # multiple clocks, and we output all START fields that occur, even # though the peripherals are supposed to ignore all but the last one. self.es_block = self.samplenum - self.putb([1, [fields['START'][self.lad], 'START', 'St', 'S']]) self.start_field = self.lad + if self.start_field != 0b1111: + self.putb([1, [fields['START'][self.lad], 'START', 'St', 'S']]) + else: + self.putb([1, [fields['START'][self.lad], 'ABORT', 'Ab', 'A']]) self.ss_block = self.samplenum def handle_get_ct_dr(self): @@ -341,6 +345,11 @@ def decode(self): # self.putb([0, ['LAD: %s' % self.lad_bits]]) continue + # Check for abort in the middle of a cycle + if self.state not in ['IDLE', 'GET START'] and self.lframe != 1: + self.putb([0, ['Warning: LFRAME# low in middle of cycle: aborting']]) + self.state = 'GET START' + # TODO: Only memory read/write is currently supported/tested. # State machine -- 2.30.2 _______________________________________________ sigrok-devel mailing list sigrok-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sigrok-devel