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