hw/ip/otbn/dv/otbnsim/sim/state.py
def step(self, next_pc: int) -> Optional[int]:
        '''Update loop stack. If we should loop, return new PC'''
        if self.stack:
            top = self.stack[-1]
            if next_pc == top.match_addr:
                assert top.restarts_left > 0
                top.restarts_left -= 1

                if not top.restarts_left:
                    self.stack.pop()

                # 1-based iteration number
                idx = top.loop_count - top.restarts_left
                self.trace.append(TraceLoopIteration(idx, top.loop_count))

                return top.start_addr

        return None
Update loop stack. If we should loop, return new PC
Update loop stack. If we should loop, return new PC
Update loop stack . If we should loop return new PC
def step(self, next_pc: int) -> Optional[int]:
        if self.stack:
            top = self.stack[-1]
            if next_pc == top.match_addr:
                assert top.restarts_left > 0
                top.restarts_left -= 1
                if not top.restarts_left:
                    self.stack.pop()
                idx = top.loop_count - top.restarts_left
                self.trace.append(TraceLoopIteration(idx, top.loop_count))
                return top.start_addr
        return None
def step ( self , next_pc : int ) -> Optional [ int ] : if self . stack : top = self . stack [ - 1 ] if next_pc == top . match_addr : assert top . restarts_left > 0 top . restarts_left -= 1 if not top . restarts_left : self . stack . pop ( ) idx = top . loop_count - top . restarts_left self . trace . append ( TraceLoopIteration ( idx , top . loop_count ) ) return top . start_addr return None
Update loop stack.
Update loop stack .
'''Update loop stack. If we should loop, return new PC''' # 1-based iteration number
self
next_pc
int