4.7.8. hrut_bpuprofile
hrut_bpuprofile is used to configure and query BPU (Hardware Processing Unit) related parameters, including power, clock, frequency, utilization, etc.
4.7.8.1. Syntax Description
Below is the Usage output from executing hrut_bpuprofile -h:
BPU PROFILE HELP INFORMATION
>>> -b/--bpu [BPU CORE,0--bpu0] (required)
>>> -p/--power [POWER OFF/ON,0--OFF,1--ON]
>>> -c/--clock [CLOCK OFF/ON,0--OFF,1--ON]
>>> -t/--time [GET FC TIME,NO ARGUMENT]
>>> -f/--frq [SET BPU FREQUENCY,ARGUMENT:N]
>>> -r/--ratio [BPU RATIO,N--N TIMES,0--FOREVER]
4.7.8.2. Option Arguments Description
Below are the options supported by hrut_bpuprofile and their descriptions:
-bor--bpu: Specifies the BPU core number (0 means BPU0).-por--power: Sets the power state of the BPU (0 means off, 1 means on).-cor--clock: Sets the clock state of the BPU (0 means off, 1 means on).-tor--time: Gets the FC time of the BPU (no argument required).-for--frq: Sets the operating frequency of the BPU (argument is the frequency value).-ror--ratio: Sets the utilization of the BPU (argument N means N times, 0 means permanently).-hor--help: Displays help information explaining how to use the command.
4.7.8.3. Command Options and Their Functional Descriptions
Setting BPU Power
Enable command:
root@buildroot:~# hrut_bpuprofile -b 0 -p 1
Function:
Sets the power state of BPU core 0 to on.
Disable command:
root@buildroot:~# hrut_bpuprofile -b 0 -p 0
Function:
Sets the power state of BPU core 0 to off.
Print output:
set bpu[0] power
Setting BPU Clock
Enable command:
root@buildroot:~# hrut_bpuprofile -b 0 -c 1
Print output:
bpu[0] clock is enable
Function:
Enables the clock state of BPU core 0.
Disable command:
root@buildroot:~# hrut_bpuprofile -b 0 -c 0
Function:
Disables the clock state of BPU core 0.
Print output:
bpu[0] clock is disable
Getting BPU FC Time
Command:
hrut_bpuprofile -b 0 -t
Function:
This command retrieves the FC time (Flow Control Time) of BPU core 0, which typically refers to detailed timing information during task processing, including start time, end time, and runtime.
Print output:
root@buildroot:/userdata# hrut_bpuprofile -b 0 -t
index id:hwid group prio s_time e_time r_time
916 1:458 16:4447 0 6016162 6016193 30977us
918 1:459 16:4447 0 6016194 6016224 30692us
920 1:460 16:4447 0 6016225 6016256 30760us
922 1:461 16:4447 0 6016257 6016288 31173us
924 1:462 16:4447 0 6016289 6016320 31009us
926 1:463 16:4447 0 6016321 6016352 31564us
928 1:464 16:4447 0 6016353 6016384 30351us
930 1:465 16:4447 0 6016385 6016415 30401us
932 1:466 16:4447 0 6016416 6016445 29305us
Result Explanation:
index: Task index number, used to identify different tasks.
id:hwid: Task ID and hardware ID.
group: Group to which the task belongs.
prio: Priority of the task.
s_time: Start time of the task, in system time units (us).
e_time: End time of the task, in system time units (us).
r_time: Runtime of the task, in system time units (us).
Setting BPU Frequency
Command:
hrut_bpuprofile -b 0 -f 500000000
Function:
Sets the operating frequency of BPU core 0 to 500 MHz.
Print output:
current bpu[0] frequency:500000000
Verification Method:
Run the cpu_bpu_ddr stress test script under /app/platform_samples/chip_base_test/01_cpu_bpu_ddr/scripts. For usage, refer to CPU_BPU_DDR_STRESS. After setting the BPU frequency with this command, running the stress test yields the following output:
root@buildroot:/app/platform_samples/chip_base_test/01_cpu_bpu_ddr/scripts# ./stress_test.sh
Running stress test with the following configuration:
Stress Time: 48h hours (172800 seconds)
Memory Size: 100 MB
I/O Threads: 4
BPU Core: 0
BPU Portion: 100%
Output directory: /userdata/log
Starting CPU stress test...
nohup: redirecting stderr to stdout
Starting BPU stress test...
=====================1=====================
temperature-->
DDR : 61.7 (C)
75759
cat: /sys/class/hwmon/hwmon0/temp2_input: Connection timed out
BPU : 0.0 (C)
CPU : 62.6 (C)
cpu frequency-->
min(M) cur(M) max(M)
cpu0: 300 1500 1500
cpu1: 300 1500 1500
cpu2: 300 1500 1500
cpu3: 300 1500 1500
cpu4: 300 1500 1500
cpu5: 300 1500 1500
cpu6: 300 1500 1500
cpu7: 300 1500 1500
bpu status information---->
min(M) cur(M) max(M) ratio
bpu0: 500 500 1000 99
ddr frequency information---->
min(M) cur(M) max(M)
ddr: 266 4266 4266
GPU gc8000 frequency information---->
min(M) cur(M) max(M)
gc8000: 200 1000 1000
It can be seen that the current default frequency of the BPU has changed from 1000 MHz to 500 MHz. Similarly, this method can also be used to check BPU utilization.
Command:
hrut_bpuprofile -b 0 -f 1000000000
Function:
Sets the operating frequency of BPU core 0 to 1000 MHz.
Print output:
current bpu[0] frequency:996000000
Note:
Due to limitations in the frequency division factor, an exact 1000 MHz cannot be generated.
Setting BPU Utilization Display
Command:
hrut_bpuprofile -b 0 -r 5
Function:
Sets the BPU0 utilization output to 5 times.
Print output:
root@buildroot:/userdata# hrut_bpuprofile -b 0 -r 5
BPU RATIO FREE QUEUE
0 100% 1023
Result Explanation:
BPU: Indicates the BPU core being operated, here 0 (i.e., bpu0).
RATIO: Represents the current utilization of the BPU core.
FREE QUEUE: Indicates the number of free queues in the current BPU core, which generally reflects the current load status of the BPU.
Displaying Help Information
Command:
hrut_bpuprofile -h
Function:
Displays help information explaining how to use the command.
Print output:
BPU PROFILE HELP INFORMATION
>>> -b/--bpu [BPU CORE,0--bpu0] (required)
>>> -p/--power [POWER OFF/ON,0--OFF,1--ON]
>>> -c/--clock [CLOCK OFF/ON,0--OFF,1--ON]
>>> -t/--time [GET FC TIME,NO ARGUMENT]
>>> -f/--frq [SET BPU FREQUENCY,ARGUMENT:N]
>>> -r/--ratio [BPU RATIO,N--N TIMES,0--FOREVER]