mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-21 06:33:31 +00:00
b2bc5912c8
Issue #4860
72 lines
1.9 KiB
Plaintext
72 lines
1.9 KiB
Plaintext
if {[get_cmd_switch --autopilot]} {
|
|
if {[have_include "power_on/qemu"]} {
|
|
puts "\nRun script does not support Qemu.\n"
|
|
exit 0
|
|
}
|
|
}
|
|
|
|
if {[have_board linux]} {
|
|
puts "\n Run script is not supported on this platform. \n";
|
|
exit 0
|
|
}
|
|
|
|
build { core init timer lib/ld test/cpu_bench }
|
|
|
|
create_boot_directory
|
|
|
|
install_config {
|
|
<config>
|
|
<parent-provides>
|
|
<service name="LOG"/>
|
|
<service name="CPU"/>
|
|
<service name="ROM"/>
|
|
<service name="PD"/>
|
|
</parent-provides>
|
|
<default-route>
|
|
<any-service> <parent/> </any-service>
|
|
</default-route>
|
|
<default caps="100"/>
|
|
<start name="cpu_bench">
|
|
<resource name="RAM" quantum="10M"/>
|
|
</start>
|
|
</config>
|
|
}
|
|
|
|
build_boot_image [build_artifacts]
|
|
|
|
append qemu_args " -nographic "
|
|
|
|
#
|
|
# Those value relate to hardware used in CI testsuite used at Genode Labs,
|
|
# as well as the initialization of their bootloaders, we use this to measure
|
|
# regressions in the platform initialization code
|
|
#
|
|
proc bogomips_max_time { } {
|
|
if {[have_board rpi]} { return 14300 }
|
|
if {[have_board imx53_qsb]} { return 7520 }
|
|
if {[have_board imx53_qsb_tz]} { return 7520 }
|
|
if {[have_board imx6q_sabrelite]} { return 6320 }
|
|
if {[have_board imx7d_sabre]} { return 9470 }
|
|
if {[have_board imx8q_evk]} { return 7510 }
|
|
if {[have_board pc]} {
|
|
if {[have_spec x86_64]} { return 600 }
|
|
if {[have_spec x86_32]} { return 3150 }
|
|
}
|
|
return 0
|
|
}
|
|
|
|
# run the test
|
|
run_genode_until {\[init -\> cpu_bench\] Execute 10G BogoMIPS.*\n} 120
|
|
set serial_id [output_spawn_id]
|
|
set t1 [clock milliseconds]
|
|
run_genode_until "Finished execution.*\n" 30 $serial_id
|
|
set t2 [clock milliseconds]
|
|
set result [expr {$t2 - $t1}]
|
|
set bogomips [expr {10000000000 / $result}]
|
|
set maximum [bogomips_max_time]
|
|
puts "10G bogus instructions in $result msecs ($bogomips BogoMIPS)"
|
|
if {$result > $maximum} {
|
|
puts "Test failed: bogomips loop lasted longer than $maximum msecs"
|
|
exit 1
|
|
}
|