2023-05-04 14:18:04 +00:00
|
|
|
build { core init lib/ld test/bomb timer }
|
2016-12-12 10:15:44 +00:00
|
|
|
|
|
|
|
set timeout 60
|
|
|
|
set rounds 10
|
|
|
|
set generations 3
|
|
|
|
set children 7
|
|
|
|
set sleep 600
|
|
|
|
set demand [expr 1*1024*1024]
|
|
|
|
|
|
|
|
set cpus 4
|
|
|
|
set init_ram 256
|
|
|
|
|
|
|
|
if { [get_cmd_switch --autopilot] } {
|
|
|
|
|
|
|
|
if {[have_include "power_on/qemu"]} {
|
|
|
|
puts "\nRun script does not support Qemu.\n"
|
|
|
|
exit 0
|
|
|
|
}
|
|
|
|
|
|
|
|
assert_spec nova
|
|
|
|
|
|
|
|
# set specifically for our nightly test hardware */
|
2017-10-24 12:08:05 +00:00
|
|
|
if {[have_spec x86_64]} {
|
|
|
|
set cpus 8
|
|
|
|
}
|
2016-12-12 10:15:44 +00:00
|
|
|
set children 3
|
|
|
|
}
|
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
proc per_cpu_start_node { i } {
|
2016-12-12 10:15:44 +00:00
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
global init_ram rounds generations children sleep demand
|
2016-12-12 10:15:44 +00:00
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
return [join [list {
|
|
|
|
<start name="init_} $i {" caps="1100">
|
|
|
|
<affinity xpos="} $i {" width="1"/>
|
|
|
|
<resource name="RAM" quantum="} ${init_ram}M {"/>
|
2016-12-12 10:15:44 +00:00
|
|
|
<binary name="init"/>
|
|
|
|
<config verbose="yes">
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="Timer"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</default-route>
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="1000"/>
|
2016-12-12 10:15:44 +00:00
|
|
|
|
2017-10-24 12:08:05 +00:00
|
|
|
<resource name="RAM" preserve="2M"/>
|
|
|
|
<resource name="CAP" preserve="100"/>
|
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
<start name="bomb-master" priority="-1" caps="100000">
|
2016-12-12 10:15:44 +00:00
|
|
|
<binary name="bomb"/>
|
|
|
|
<resource name="CPU" quantum="90"/>
|
2023-05-04 14:18:04 +00:00
|
|
|
<resource name="RAM" quantum="2G"/>
|
|
|
|
<config rounds="} $rounds {" generations="} $generations {"
|
|
|
|
children="} $children {" sleep="} $sleep {" demand="} $demand {"/>
|
2016-12-12 10:15:44 +00:00
|
|
|
</start>
|
|
|
|
</config>
|
2023-05-04 14:18:04 +00:00
|
|
|
</start>}] ""]
|
2016-12-12 10:15:44 +00:00
|
|
|
}
|
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
proc cpu_start_nodes { cpus } {
|
2016-12-12 10:15:44 +00:00
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
set result { }
|
|
|
|
for { set i 0} { $i < $cpus } { incr i } {
|
|
|
|
append result [per_cpu_start_node $i] }
|
2016-12-12 10:15:44 +00:00
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
return $result
|
|
|
|
}
|
2016-12-12 10:15:44 +00:00
|
|
|
|
|
|
|
|
2023-05-04 14:18:04 +00:00
|
|
|
install_config {
|
|
|
|
<config verbose="yes">
|
|
|
|
|
|
|
|
<affinity-space width="} $cpus {" height="1"/>
|
|
|
|
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
</parent-provides>
|
|
|
|
<default-route><any-service><parent/><any-child/></any-service></default-route>
|
|
|
|
<default caps="100"/>
|
|
|
|
|
|
|
|
<resource name="RAM" preserve="2M"/>
|
|
|
|
<resource name="CAP" preserve="100"/>
|
|
|
|
|
|
|
|
<start name="timer">
|
|
|
|
<resource name="CPU" quantum="10"/>
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
|
|
|
</start>
|
|
|
|
|
|
|
|
} [cpu_start_nodes $cpus] {
|
|
|
|
|
|
|
|
</config>}
|
|
|
|
|
|
|
|
build_boot_image [build_artifacts]
|
|
|
|
|
|
|
|
append qemu_args " -m [expr 128 + $init_ram*$cpus]M -nographic -smp $cpus"
|
2016-12-12 10:15:44 +00:00
|
|
|
|
|
|
|
if { [get_cmd_switch --autopilot] } {
|
|
|
|
|
|
|
|
run_genode_until {bomb started} 20
|
|
|
|
|
|
|
|
for { set i 0} { $i < ${cpus} } { incr i} {
|
|
|
|
run_genode_until {\[init -\> init_[0-9] -\> bomb-master] Done\. Going to sleep} $timeout [output_spawn_id]
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
run_genode_until forever
|
|
|
|
}
|