genode/repos/os/run/ahci_bench.run

167 lines
4.3 KiB
Plaintext
Raw Normal View History

#
# Select benchmark layer
#
# 0: driver internal
# 1: native Genode app
# 2: native Genode app with partition manager
#
set layer 0
2014-12-19 09:02:10 +00:00
# driver-internal benchmark is special
if {[expr ($layer == 0)] && ![have_spec platform_arndale]} {
puts "Driver-internal benchmark (layer 0) only supported on Arndale."
2014-12-19 09:02:10 +00:00
exit 0
}
#
# Build
#
set build_components {
core init
drivers/timer
drivers/ahci
drivers/platform
}
lappend_if [expr ($layer == 1 || $layer == 2)] build_components test/block_bench
lappend_if [expr ($layer == 2)] build_components server/part_blk
2014-12-19 09:02:10 +00:00
lappend_if [have_spec acpi] build_components drivers/acpi
lappend_if [have_spec pci] build_components drivers/pci/device_pd
lappend_if [have_spec pci] build_components drivers/pci
build $build_components
create_boot_directory
#
# Config
#
# basic config for all layers
set config {
<config>
<parent-provides>
<service name="ROM"/>
<service name="RAM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
2014-12-19 09:02:10 +00:00
<service name="IO_PORT"/>
<service name="CAP"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="SIGNAL"/>
</parent-provides>
<default-route>
<any-service><parent/><any-child/></any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
2014-12-19 09:02:10 +00:00
</start>}
append_if [expr ![have_spec acpi] && ![have_spec pci]] config {
<start name="platform_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Regulator"/></provides>
</start>}
append_if [have_spec acpi] config {
<start name="acpi">
<resource name="RAM" quantum="16M" constrain_phys="yes"/>
2014-12-19 09:02:10 +00:00
<binary name="acpi_drv"/>
<provides>
<service name="PCI"/>
<service name="IRQ" />
</provides>
<route>
<service name="PCI"> <any-child /> </service>
<any-service> <parent/> <any-child /> </any-service>
</route>
</start>}
append_if [expr ![have_spec acpi] && [have_spec pci]] config {
<start name="pci_drv">
<resource name="RAM" quantum="3M" constrain_phys="yes"/>
2014-12-19 09:02:10 +00:00
<provides> <service name="PCI"/> </provides>
</start> }
2014-12-19 09:02:10 +00:00
# start driver internal bench with layer 0
append_if [expr $layer == 0] config {
<start name="ahci_bench">
<resource name="RAM" quantum="1G"/>
<provides><service name="Block"/></provides>
</start> }
2014-12-19 09:02:10 +00:00
# start part_blk with layer 2
append_if [expr $layer == 2] config {
<start name="part_blk">
<resource name="RAM" quantum="10M" />
<provides><service name="Block" /></provides>
<route>
<service name="Block"><child name="ahci" /></service>
<any-service><parent/><any-child/></any-service>
</route>
<config>
2014-12-19 09:02:10 +00:00
<policy label="test-block_bench" partition="1"/>
</config>
</start> }
# start normal AHCI driver and bench app with layer 1 or 2
append_if [expr ($layer == 1 || $layer == 2)] config {
<start name="ahci">
<resource name="RAM" quantum="10M"/>
2014-12-19 09:02:10 +00:00
<provides><service name="Block"/></provides>}
append_if [expr ($layer == 1 || $layer == 2) && [have_spec acpi]] config {
<route>
<service name="IRQ"><child name="acpi" /></service>
<any-service><parent/><any-child/></any-service>
</route>}
append_if [expr ($layer == 1 || $layer == 2)] config {
</start>
<start name="test-block_bench">
<resource name="RAM" quantum="1G"/> }
# if layer is 2 route block requests of bench app to part_blk
append_if [expr $layer == 2] config {
<route>
<service name="Block"><child name="part_blk" /></service>
<any-service><parent/><any-child/></any-service>
</route> }
# end start node of bench app if layer 1 or 2
append_if [expr ($layer == 1 || $layer == 2)] config {
</start> }
# end config
append config {
</config> }
install_config $config
#
# Boot modules
#
2014-12-19 09:02:10 +00:00
set boot_modules { core init timer }
lappend_if [expr ![have_spec acpi] && ![have_spec pci]] boot_modules platform_drv
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec pci] boot_modules pci_device_pd
lappend_if [have_spec acpi] boot_modules acpi_drv
lappend_if [expr ($layer == 0)] boot_modules ahci_bench
lappend_if [expr ($layer == 1 || $layer == 2)] boot_modules ahci
lappend_if [expr ($layer == 1 || $layer == 2)] boot_modules test-block_bench
lappend_if [expr ($layer == 2)] boot_modules part_blk
build_boot_image $boot_modules
run_genode_until forever