2022-08-09 11:32:38 +00:00
|
|
|
if {[get_cmd_switch --autopilot] && [have_board virt_qemu_riscv]} {
|
2021-02-18 08:04:39 +00:00
|
|
|
puts "Autopilot mode is not supported on this platform."
|
|
|
|
exit 0
|
|
|
|
}
|
2017-10-19 18:40:35 +00:00
|
|
|
|
2023-11-17 14:13:36 +00:00
|
|
|
set targets {
|
|
|
|
core lib/ld init timer lib/libc lib/vfs lib/vfs_lwip
|
|
|
|
server/report_rom server/nic_router server/nic_bridge server/nic_loopback
|
|
|
|
test/lwip/http_srv test/lwip/http_clnt test/lwip/udp
|
|
|
|
}
|
2017-10-19 18:40:35 +00:00
|
|
|
|
|
|
|
proc client_bin { prot } {
|
|
|
|
if {$prot == "udp"} { return "test-lwip-udp-client" }
|
|
|
|
if {$prot == "http"} { return "test-http_clnt" } }
|
|
|
|
|
|
|
|
proc server_bin { prot } {
|
|
|
|
if {$prot == "udp"} { return "test-lwip-udp-server" }
|
2018-07-10 17:09:40 +00:00
|
|
|
if {$prot == "http"} { return "test-lwip_httpsrv" } }
|
2017-10-19 18:40:35 +00:00
|
|
|
|
2017-11-13 20:14:44 +00:00
|
|
|
proc client_config { name prot ip_addr gateway netmask nic srv_port srv_ip } {
|
2017-12-13 16:33:34 +00:00
|
|
|
global nr_of_clients
|
|
|
|
incr nr_of_clients
|
2017-10-19 18:40:35 +00:00
|
|
|
append result {
|
2018-07-10 17:09:40 +00:00
|
|
|
<start name="} $name {" priority="-1">
|
2017-10-19 18:40:35 +00:00
|
|
|
<binary name="} [client_bin $prot] {" />
|
2022-12-03 21:00:59 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
2017-10-19 18:40:35 +00:00
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="} $nic {"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
<config server_ip="} $srv_ip {" server_port="} $srv_port {">
|
2018-07-10 17:09:40 +00:00
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"/>
|
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> </dir>
|
|
|
|
<dir name="socket">
|
2018-03-19 17:31:23 +00:00
|
|
|
}
|
|
|
|
if {$ip_addr == "dhcp"} {
|
|
|
|
append result {
|
2018-07-10 17:09:40 +00:00
|
|
|
<lwip dhcp="yes"/>}
|
2018-03-19 17:31:23 +00:00
|
|
|
} else {
|
|
|
|
append result {
|
2018-07-10 17:09:40 +00:00
|
|
|
<lwip ip_addr="} $ip_addr {" gateway="} $gateway {" netmask="} $netmask {"/>}
|
2018-03-19 17:31:23 +00:00
|
|
|
}
|
|
|
|
append result {
|
2018-07-10 17:09:40 +00:00
|
|
|
</dir>
|
|
|
|
</vfs>
|
2017-10-19 18:40:35 +00:00
|
|
|
</config>
|
|
|
|
</start>}
|
|
|
|
return $result
|
|
|
|
}
|
|
|
|
|
2017-11-13 20:14:44 +00:00
|
|
|
proc server_config { name prot ip_addr gateway netmask nic port } {
|
2017-10-19 18:40:35 +00:00
|
|
|
append result {
|
2018-07-10 17:09:40 +00:00
|
|
|
<start name="} $name {" priority="-1">
|
2017-10-19 18:40:35 +00:00
|
|
|
<binary name="} [server_bin $prot] {" />
|
2022-12-03 21:00:59 +00:00
|
|
|
<resource name="RAM" quantum="8M"/>
|
2017-10-19 18:40:35 +00:00
|
|
|
<route>
|
|
|
|
<service name="Nic"> <child name="} $nic {"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
|
|
|
<config port="} $port {">
|
2018-07-10 17:09:40 +00:00
|
|
|
<vfs>
|
|
|
|
<dir name="dev"> <log/> </dir>
|
|
|
|
<dir name="socket">
|
|
|
|
<lwip ip_addr="} $ip_addr {" gateway="} $gateway {" netmask="} $netmask {"/>
|
|
|
|
</dir>
|
|
|
|
</vfs>
|
|
|
|
<libc stdout="/dev/log" stderr="/dev/log" socket="/socket"
|
|
|
|
ip_addr="} $ip_addr {" gateway="} $gateway {" netmask="} $netmask {"/>
|
2017-10-19 18:40:35 +00:00
|
|
|
</config>
|
|
|
|
</start>}
|
|
|
|
return $result
|
|
|
|
}
|
|
|
|
|
2018-02-08 14:33:08 +00:00
|
|
|
append qemu_args "-nographic "
|