hw/ip/otbn/dv/otbnsim/sim/sim.py
def step(self, verbose: bool) -> Tuple[Optional[OTBNInsn], List[str]]:
        '''Run a single instruction.

        Returns the instruction, together with a list of the architectural
        changes that have happened. If the model isn't currently running,
        returns no instruction and no changes.

        '''
        if not self.state.running:
            return (None, [])

        was_stalled = self.state.stalled

        if was_stalled:
            insn = None
            changes = []
        else:
            word_pc = int(self.state.pc) >> 2
            if word_pc >= len(self.program):
                raise RuntimeError('Trying to execute instruction at address '
                                   '{:#x}, but the program is only {:#x} '
                                   'bytes ({} instructions) long. Since there '
                                   'are no architectural contents of the '
                                   'memory here, we have to stop.'
                                   .format(int(self.state.pc),
                                           4 * len(self.program),
                                           len(self.program)))
            insn = self.program[word_pc]

            if insn.insn.cycles > 1:
                self.state.add_stall_cycles(insn.insn.cycles - 1)

            insn.execute(self.state)
            self.state.post_insn()

            changes = self.state.changes()

        self.state.commit()

        if verbose:
            disasm = ('(stall)' if was_stalled
                      else insn.disassemble(self.state.pc))
            self._print_trace(disasm, changes)

        return (insn, changes)
Run a single instruction.

        Returns the instruction, together with a list of the architectural
        changes that have happened. If the model isn't currently running,
        returns no instruction and no changes.

        
Run a single instruction.
Returns the instruction, together with a list of the architectural
changes that have happened. If the model isn't currently running,
returns no instruction and no changes.
Run a single instruction . Returns the instruction together with a list of the architectural changes that have happened . If the model isn ' t currently running returns no instruction and no changes .
def step(self, verbose: bool) -> Tuple[Optional[OTBNInsn], List[str]]:
        if not self.state.running:
            return (None, [])
        was_stalled = self.state.stalled
        if was_stalled:
            insn = None
            changes = []
        else:
            word_pc = int(self.state.pc) >> 2
            if word_pc >= len(self.program):
                raise RuntimeError('Trying to execute instruction at address '
                                   '{:#x}, but the program is only {:#x} '
                                   'bytes ({} instructions) long. Since there '
                                   'are no architectural contents of the '
                                   'memory here, we have to stop.'
                                   .format(int(self.state.pc),
                                           4 * len(self.program),
                                           len(self.program)))
            insn = self.program[word_pc]
            if insn.insn.cycles > 1:
                self.state.add_stall_cycles(insn.insn.cycles - 1)
            insn.execute(self.state)
            self.state.post_insn()
            changes = self.state.changes()
        self.state.commit()
        if verbose:
            disasm = ('(stall)' if was_stalled
                      else insn.disassemble(self.state.pc))
            self._print_trace(disasm, changes)
        return (insn, changes)
def step ( self , verbose : bool ) -> Tuple [ Optional [ OTBNInsn ] , List [ str ] ] : if not self . state . running : return ( None , [ ] ) was_stalled = self . state . stalled if was_stalled : insn = None changes = [ ] else : word_pc = int ( self . state . pc ) >> 2 if word_pc >= len ( self . program ) : raise RuntimeError ( 'Trying to execute instruction at address ' '{:#x}, but the program is only {:#x} ' 'bytes ({} instructions) long. Since there ' 'are no architectural contents of the ' 'memory here, we have to stop.' . format ( int ( self . state . pc ) , 4 * len ( self . program ) , len ( self . program ) ) ) insn = self . program [ word_pc ] if insn . insn . cycles > 1 : self . state . add_stall_cycles ( insn . insn . cycles - 1 ) insn . execute ( self . state ) self . state . post_insn ( ) changes = self . state . changes ( ) self . state . commit ( ) if verbose : disasm = ( '(stall)' if was_stalled else insn . disassemble ( self . state . pc ) ) self . _print_trace ( disasm , changes ) return ( insn , changes )
Run a single instruction.
Run a single instruction .
'''Run a single instruction.

        Returns the instruction, together with a list of the architectural
        changes that have happened. If the model isn't currently running,
        returns no instruction and no changes.

        '''
self
verbose
bool