示例#1
0
    def decrement_bits_predictor(self, address, ret):

        retval = 0
        data = None
        ret_data = {}
        bits = -1

        retval = self.extract_bits(address, 2, ret_data)

        if (retval):
            return retval

        data = ret_data["value"]
        bits = data["bits"]
        ret["value"] = bits

        if (bits > 0):
            data["bits"] = bits - 1
        else:
            retval = FLAGS.GET_COUNTER_SATURED()

        return retval
示例#2
0
    def increment_bits_predictor(self, address, ret):

        retval = 0
        data = None
        ret_data = {}
        bits = -1

        retval = self.extract_bits(address, 1, ret_data)

        if (retval):
            return retval

        data = ret_data["value"]
        bits = data["bits"]
        ret["value"] = bits

        if (bits < (2**(self.num_pred_bits)) - 1):
            data["bits"] = bits + 1
        else:
            retval = FLAGS.GET_COUNTER_SATURED()

        return retval