def do_search(self, arg): if len(self.trace) <= 0: return print_red("Empty trace") try: c = sim_trace_search.search_sim_trace(self.trace, self.cycle, arg) if c != None: print 'Found in cycle %d'%c else: print_yellow('No result found for "%s"'%arg) except SimTraceError as e: print_red('%s'%e.args)
def do_search(self, arg): if len(self.trace) <= 0: return print_red("Empty trace") try: c = sim_trace_search.search_sim_trace(self.trace, self.cycle, arg) if c != None: print 'Found in cycle %d' % c else: print_yellow('No result found for "%s"' % arg) except SimTraceError as e: print_red('%s' % e.args)
def do_goto(self, arg): "goto <num>|<expr>: go to cycle <num> or the cycle the matches"\ " search expression <expr>" if len(self.trace) <= 0: return print_red("Empty trace") if arg == 'begin': return self.set_cycle(0) if arg == 'end' : return self.set_cycle(self.trace.max_cycle) if arg.isdigit() : return self.set_cycle(int(arg)) try: c = sim_trace_search.search_sim_trace(self.trace, self.cycle, arg) if c != None: self.set_cycle(c) else: print_yellow('No cycle matches "%s"'%arg) except SimTraceError as e: print_red('%s'%e.args)
def do_goto(self, arg): "goto <num>|<expr>: go to cycle <num> or the cycle the matches"\ " search expression <expr>" if len(self.trace) <= 0: return print_red("Empty trace") if arg == 'begin': return self.set_cycle(0) if arg == 'end': return self.set_cycle(self.trace.max_cycle) if arg.isdigit(): return self.set_cycle(int(arg)) try: c = sim_trace_search.search_sim_trace(self.trace, self.cycle, arg) if c != None: self.set_cycle(c) else: print_yellow('No cycle matches "%s"' % arg) except SimTraceError as e: print_red('%s' % e.args)