<?xml version="1.0" encoding="utf-8"?>

<vivo_thermal>
    <boot_thermal>
    </boot_thermal>

    <junctions>
        <interval>5</interval>
        <para his_length="8" init_value="30000" standard_deviation_threshold="0,5000,10000,99999999" />
        <!-- sensor温度filter及替代采用代码固化的形式实现 -->
        <sensor0 name="cpu-little0-2-0" 	type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor1 name="cpu-little1-2-1" 	type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor2 name="cpu-little2-2-2" 	type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor3 name="cpu-little3-2-3" 	type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor4 name="cpu-medium4-3-0" 	type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor5 name="cpu-medium4-3-1"  type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor6 name="cpu-medium5-3-2"  type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor7 name="cpu-medium5-3-3"  type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor8 name="cpu-medium6-1-2"  type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor9 name="cpu-medium6-1-3"  type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor10 name="cpu-big7-4-2" 	type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor11 name="cpu-big7-4-3" 	type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />
        <sensor12 name="soc-bot2" 	type="tsens" prop_func="*" prop_value="1" range_low="-35000" range_high="125000" tolerance="1000" />

        <virtual_sensor100 name="standard_deviation" input_sensor="0,1,2,3,4,5,6,7,8,9,10,11,12" input_index="0,0,0,0,0,0,0,0,0,0,0,0,0">
            <operator100 cal="std_deviation" input_nodes="0,1,2,3,4,5,6,7,8,9,10,11,12" input_values="" output="1" />
        </virtual_sensor100>

        <virtual_sensor101 name="cpu_little_core_max" input_sensor="0,1,2,3" input_index="0,0,0,0">
            <operator100 cal="max" input_nodes="0,1,2,3" input_values="" output="1" />
        </virtual_sensor101>

        <virtual_sensor102 name="cpu_big_core_max" input_sensor="4,5,6,7,8,9" input_index="0,0,0,0,0,0">
            <operator100 cal="max" input_nodes="0,1,2,3,4,5" input_values="" output="1" />
        </virtual_sensor102>

        <virtual_sensor103 name="cpu_prime_core_max" input_sensor="10,11" input_index="0,0">
            <operator100 cal="max" input_nodes="0,1" input_values="" output="1" />
        </virtual_sensor103>

        <virtual_sensor104 name="gpu_core_max" input_sensor="12" input_index="0">
            <operator100 cal="=" input_nodes="0" input_values="" output="1" />
        </virtual_sensor104>

        <virtual_sensor105 name="cpu_ball_cpu_max_last" input_sensor="1000" input_index="-1"> <!-- 1000+表示结温； 0代表最新值，1代表上一时刻 -->
            <operator100 cal="=" input_nodes="0" input_values="" output="1" />
        </virtual_sensor105>

        <virtual_sensor106 name="gpu_ball_cpu_max_last" input_sensor="1001" input_index="-1"> <!-- 1000+表示结温； 0代表最新值，1代表上一时刻 -->
            <operator100 cal="=" input_nodes="0" input_values="" output="1" />
        </virtual_sensor106>

        <virtual_sensor107 name="which_model" input_sensor="100" input_index="0"  update_func="decide_which_model" />

        <junction_temp0 name="junction_temp_cpu" write_path="/proc/thermal_lifespan/cpu_solder_ball">
            <junction_temp_calculation_operators name="temp_calculation" input_sensor="107,101,102,103,104,105" input_index="0,0,0,0,0,0" >
                <operator100 name="model1" cal="dot_product" input_nodes="1,2,3,4,5,-1,-1,-1,-1,-1,-1,-1" input_values="1831,0.433,-0.028,0.27,0.121,0.167,1" />
                <operator101 name="model2" cal="dot_product" input_nodes="1,2,3,4,5,-1,-1,-1,-1,-1,-1,-1" input_values="862,0.591,0.01,0.164,0.176,0.045,1" />
                <operator102 name="model3" cal="dot_product" input_nodes="1,2,3,4,5,-1,-1,-1,-1,-1,-1,-1" input_values="4215,0.579,0.001,0.166,0.163,0.033,1" />
                <operator103 name="filter" cal="range_switch" input_nodes="0,-1,-1,-1,100,100,101,102" input_values="0,5000,10000" output="1" />
            </junction_temp_calculation_operators>
        </junction_temp0>

        <junction_temp1 name="junction_temp_gpu" write_path="/proc/thermal_lifespan/gpu_solder_ball">
            <junction_temp_calculation_operators name="temp_calculation" input_sensor="107,101,102,103,104,105" input_index="0,0,0,0,0,0" >
                <operator100 name="model1" cal="dot_product" input_nodes="1,2,3,4,5,-1,-1,-1,-1,-1,-1,-1" input_values="1264,0.232,-0.069,-0.01,0.536,0.285,1" />
                <operator101 name="model2" cal="dot_product" input_nodes="1,2,3,4,5,-1,-1,-1,-1,-1,-1,-1" input_values="226,0.134,-0.009,0.035,0.738,0.102,1" />
                <operator102 name="model3" cal="dot_product" input_nodes="1,2,3,4,5,-1,-1,-1,-1,-1,-1,-1" input_values="4215,0.579,0.001,0.166,0.163,0.033,1" />
                <operator103 name="filter" cal="range_switch" input_nodes="0,-1,-1,-1,100,100,101,102" input_values="0,5000,10000" output="1" />
            </junction_temp_calculation_operators>
        </junction_temp1>

        <junction_temp2 name="junction_temp_other" write_path="/proc/thermal_lifespan/other_solder_ball">
            <junction_temp_calculation_operators name="temp_calculation" input_sensor="100" input_index="0" >
                <operator100 name="default" cal="dot_product" input_nodes="-1,-1" input_values="0,0" output="1" />
            </junction_temp_calculation_operators>
        </junction_temp2>
    </junctions>

    <lifespan>
        <config sensor="junction_temp_cpu" />
        <operators input_name="interval-s,max_temp-mC,temp_diff-mC">
                <operator100 name="" cal="/" input_nodes="-1,2" input_values="70000" />		<!--  温差项  -->
                <operator101 name="" cal="^" input_nodes="100,-1" input_values="1.5" />		<!--  温差项幂次  -->
                <operator102 name="" cal="-" input_nodes="-1,1" input_values="100000" />	<!--  最高温温差  -->
                <operator103 name="" cal="/" input_nodes="102,-1" input_values="20000" />	<!--  0.05指数项  -->
                <operator104 name="" cal="exp" input_nodes="103" input_values="" />			<!--  指数运算  -->
                <operator105 name="" cal="*" input_nodes="104,101" input_values=""/>		<!--  指数项和温差项乘积  -->
                <operator106 name="" cal="/" input_nodes="-1,0" input_values="55"/>			<!--  周期项，注意除零  -->
                <operator107 name="" cal="^" input_nodes="106,-1" input_values="0.333333"/>	<!--  周期项幂次  -->
                <operator108 name="" cal="*" input_nodes="105,107" input_values=""/>		<!--  指数项和温差项和周期项乘积  -->
                <operator109 name="amplification1" cal="/" input_nodes="108,-1" input_values="1000"/>	<!--  放大1000倍  -->
                <operator110 name="" cal="/" input_nodes="-1,109" input_values="1" output="1"/>			<!--  1/AF  -->
        </operators>
    </lifespan>

    <data_report>
        <report0 name="JunctionTempCalcuUpdate">
            <para path="/proc/thermal_lifespan/soc_temperature_info" />
            <data0 title="solder_ball_cpu_temperature" virtual_sensor="junction_temp_cpu" input_type="int" write_type="int" />
            <data1 title="solder_ball_gpu_temperature" virtual_sensor="junction_temp_gpu" input_type="int" write_type="int" />
            <data2 title="solder_ball_other_temperature" virtual_sensor="junction_temp_other" input_type="int" write_type="int" />
            <data3 title="cpu_cluster0_max_temperature" virtual_sensor="cpu_little_core_max" input_type="int" write_type="int" />
            <data4 title="cpu_cluster1_max_temperature" virtual_sensor="cpu_big_core_max" input_type="int" write_type="int" />
            <data5 title="cpu_cluster2_max_temperature" virtual_sensor="cpu_prime_core_max" input_type="int" write_type="int" />
            <data6 title="gpu_temperature" virtual_sensor="gpu_core_max" input_type="int" write_type="int" />
            <data7 title="soc_bot_temperature" virtual_sensor="nonsensor" input_type="int" write_type="int" />
            <data8 title="other_temperature" virtual_sensor="nonsensor" input_type="int" write_type="int" />
        </report0>
        <report1 name="ReservedJunctionDamageUpdate">
            <para path="/proc/thermal_lifespan/soc_thermal_stress_info" />
            <data0 title="total_loss_value,0,0" virtual_sensor="totalJunctionDamage" input_type="int" write_type="int" />
            <data1 title="period_loss_value,1,1" virtual_sensor="newJunctionDamage" input_type="int" write_type="int" />
        </report1>
    </data_report>

    <reserved>
    </reserved>
</vivo_thermal>
