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