提交 51d074c6 编写于 作者: Z Zihao Yu

engine,rv64,tran: support less than TOP_N basic blocks

* previously it may trigger an assertion fail if the number of basic
  blocks of a program is less than TOP_N
* now if that is the case, we will display statistic of an empty basic
  block
上级 231d670d
......@@ -53,9 +53,10 @@ static int find_topn_min(TB **top) {
static TB** find_topn_tb() {
static TB *top[TOP_N];
TB *p = head.next;;
TB empty = { .pc = -1, .hit_time = 0, .guest_nr_instr = 0 };
int i;
for (i = 0; i < TOP_N; i ++) {
Assert(p != NULL, "i = %d", i);
if (p == NULL) p = &empty;
top[i] = p;
p = p->next;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册