xref: /XiangShan/debug/sc_stat.sh (revision f320e0f01bd645f0a3045a8a740e60dd770734a9)
1#!/bin/bash
2
3#***************************************************************************************
4# Copyright (c) 2020-2021 Institute of Computing Technology, Chinese Academy of Sciences
5# Copyright (c) 2020-2021 Peng Cheng Laboratory
6#
7# XiangShan is licensed under Mulan PSL v2.
8# You can use this software according to the terms and conditions of the Mulan PSL v2.
9# You may obtain a copy of Mulan PSL v2 at:
10#          http://license.coscl.org.cn/MulanPSL2
11#
12# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
13# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
14# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
15#
16# See the Mulan PSL v2 for more details.
17#***************************************************************************************
18
19log_dir=$1
20tage_w_sc_w=$(grep "scUpdate" $log_dir | grep "sc(1), tage(1)" -c)
21tage_w_sc_r=$(grep "scUpdate" $log_dir | grep "sc(0), tage(1)" -c)
22tage_r_sc_w=$(grep "scUpdate" $log_dir | grep "sc(1), tage(0)" -c)
23tage_r_sc_r=$(grep "scUpdate" $log_dir | grep "sc(0), tage(0)" -c)
24
25echo $tage_r_sc_w tage right but mispredicted by sc
26echo $tage_w_sc_r tage wrong and rectified by sc
27echo `expr $tage_w_sc_w + $tage_r_sc_r` branches remain unchanged, in which $tage_w_sc_w are wrong
28
29