13fce4f48SLingrui98#!/bin/bash 23fce4f48SLingrui98 3c6d43980SLemover#*************************************************************************************** 4c6d43980SLemover# Copyright (c) 2020-2021 Institute of Computing Technology, Chinese Academy of Sciences 5*f320e0f0SYinan Xu# Copyright (c) 2020-2021 Peng Cheng Laboratory 6c6d43980SLemover# 7c6d43980SLemover# XiangShan is licensed under Mulan PSL v2. 8c6d43980SLemover# You can use this software according to the terms and conditions of the Mulan PSL v2. 9c6d43980SLemover# You may obtain a copy of Mulan PSL v2 at: 10c6d43980SLemover# http://license.coscl.org.cn/MulanPSL2 11c6d43980SLemover# 12c6d43980SLemover# THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, 13c6d43980SLemover# EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, 14c6d43980SLemover# MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. 15c6d43980SLemover# 16c6d43980SLemover# See the Mulan PSL v2 for more details. 17c6d43980SLemover#*************************************************************************************** 18c6d43980SLemover 193fce4f48SLingrui98log_dir=$1 206b98bdcbSLingrui98tage_w_sc_w=$(grep "scUpdate" $log_dir | grep "sc(1), tage(1)" -c) 216b98bdcbSLingrui98tage_w_sc_r=$(grep "scUpdate" $log_dir | grep "sc(0), tage(1)" -c) 226b98bdcbSLingrui98tage_r_sc_w=$(grep "scUpdate" $log_dir | grep "sc(1), tage(0)" -c) 236b98bdcbSLingrui98tage_r_sc_r=$(grep "scUpdate" $log_dir | grep "sc(0), tage(0)" -c) 243fce4f48SLingrui98 253fce4f48SLingrui98echo $tage_r_sc_w tage right but mispredicted by sc 263fce4f48SLingrui98echo $tage_w_sc_r tage wrong and rectified by sc 276b98bdcbSLingrui98echo `expr $tage_w_sc_w + $tage_r_sc_r` branches remain unchanged, in which $tage_w_sc_w are wrong 283fce4f48SLingrui98 29