def wait(self, val, is_tg=False): start_time = get_timenow() thid = logger.get_thread_name() if is_tg: self.tg_total_wait = self.tg_total_wait + val self.cmds.append( [start_time, thid, "TGWAIT", None, "TG sleep", val]) else: self.tc_total_wait = self.tc_total_wait + val self.cmds.append( [start_time, thid, "WAIT", None, "static delay", val])
def stop(self, pid): [start_time, dut, msg, data] = self.profile_ids[pid] delta = get_timenow() - start_time cmd_time = int(delta.total_seconds() * 1000) thid = logger.get_thread_name() if dut: if pid > 0 and thid == "T0000: ": [pstart_time, pdut, pmsg, pdata] = self.profile_ids[pid - 1] if pmsg == msg and dut != pdut: self.canbe_parallel.append([start_time, msg, dut, pdut]) if "spytest-helper.py" in msg: self.infra_cmds.append([start_time, thid, dut, msg, cmd_time]) self.infra_cmd_time = self.infra_cmd_time + cmd_time self.cmds.append( [start_time, thid, "INFRA", dut, msg, cmd_time]) else: self.tc_cmds.append([start_time, thid, dut, msg, cmd_time]) self.tc_cmd_time = self.tc_cmd_time + cmd_time self.cmds.append([start_time, thid, "CMD", dut, msg, cmd_time]) else: self.tg_cmds.append([start_time, thid, dut, msg, cmd_time]) self.tg_cmd_time = self.tg_cmd_time + cmd_time self.cmds.append([start_time, thid, "TG", dut, msg, cmd_time]) return data
def prompt_nfound(self, cmd): start_time = get_timenow() thid = logger.get_thread_name() self.pnfound = self.pnfound + 1 self.cmds.append([start_time, thid, "PROMPT_NFOUND", None, cmd, ""])
def start(self, msg, dut=None, data=None): msg = msg.replace("\r", "") msg = msg.replace("\n", "\\n") count = len(self.profile_ids) self.profile_ids[count] = [get_timenow(), dut, msg, data] return count