From 0e984f4ec702debd4b21235909a0ae2d21f72e03 Mon Sep 17 00:00:00 2001 From: Qingcai Jiang Date: Thu, 30 Dec 2021 20:30:43 +0800 Subject: [PATCH 1/2] fix a bug when 'mov' is the last instruction --- osaca/semantics/marker_utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osaca/semantics/marker_utils.py b/osaca/semantics/marker_utils.py index 708f9f1..cfe0fb8 100755 --- a/osaca/semantics/marker_utils.py +++ b/osaca/semantics/marker_utils.py @@ -138,7 +138,7 @@ def find_marked_section( index_start = i + 1 elif comments["end"] == line.comment: index_end = i - elif line.instruction in mov_instr and lines[i + 1].directive is not None: + elif line.instruction in mov_instr and len(lines) > i + 1 and lines[i + 1].directive is not None: source = line.operands[0 if not reverse else 1] destination = line.operands[1 if not reverse else 0] # instruction pair matches, check for operands From 71b9a17ab8b120710a5dbcbc4995e62601af2a53 Mon Sep 17 00:00:00 2001 From: Qingcai Jiang Date: Thu, 30 Dec 2021 21:32:29 +0800 Subject: [PATCH 2/2] fix a bug when longest_path is not integer, try 'ldpw3, w1, [x0, #0x48]' in AArch64 --- osaca/semantics/kernel_dg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osaca/semantics/kernel_dg.py b/osaca/semantics/kernel_dg.py index 88621d8..8424177 100755 --- a/osaca/semantics/kernel_dg.py +++ b/osaca/semantics/kernel_dg.py @@ -225,7 +225,7 @@ class KernelDG(nx.DiGraph): node["latency_cp"] = self.dg.edges[(s, d)]["latency"] path_latency += node["latency_cp"] # add latency for last instruction - node = self._get_node_by_lineno(longest_path[-1]) + node = self._get_node_by_lineno(int(longest_path[-1])) node["latency_cp"] = node["latency"] if max_latency_instr["latency"] > path_latency: max_latency_instr["latency_cp"] = float(max_latency_instr["latency"])