15044c81937a87fd794d77841d656c1941d6abc0
[barrelfish] / platforms / Hakefile
1 --------------------------------------------------------------------------
2 -- Copyright (c) 2015-2016 ETH Zurich.
3 -- All rights reserved.
4 --
5 -- This file is distributed under the terms in the attached LICENSE file.
6 -- If you do not find this file, copies can be found by writing to:
7 -- ETH Zurich D-INFK, Universitaetstr. 6, CH-8092 Zurich. Attn: Systems Group.
8 --
9 -- Hakefile for /platforms/
10 --
11 --------------------------------------------------------------------------
12
13 let bin_rcce_lu = [ "/sbin/" ++ f | f <- [
14                         "rcce_lu_A1",
15                         "rcce_lu_A2",
16                         "rcce_lu_A4",
17                         "rcce_lu_A8",
18                         "rcce_lu_A16",
19                         "rcce_lu_A32",
20                         "rcce_lu_A64" ]]
21
22     bin_rcce_bt = [ "/sbin/" ++ f | f <- [
23                         "rcce_bt_A1",
24                         "rcce_bt_A4",
25                         "rcce_bt_A9",
26                         "rcce_bt_A16",
27                         "rcce_bt_A25",
28                         "rcce_bt_A36" ]]
29
30     tests_common = [ "/sbin/" ++ f | f <- [
31                         "fputest",
32                         "hellotest",
33                         "idctest",
34                         "memtest",
35                         "nkmtest_all",
36                         "nkmtest_map_unmap",
37                         "nkmtest_modify_flags",
38                         "schedtest",
39                         "testerror",
40                         "yield_test" ] ]
41
42     tests_x86 = [ "/sbin/" ++ f | f <- [
43                         "tests/luatest",
44                         "tests/numatest" ] ] ++ tests_common
45
46     tests_x86_64 = [ "/sbin/" ++ f | f <- [
47                         "arrakis_hellotest",
48                         "fread_test",
49                         "fscanf_test",
50                         "ata_rw28_test",
51                         "bomp_cpu_bound",
52                         "bomp_cpu_bound_progress",
53                         "bomp_sync",
54                         "bomp_sync_progress",
55                         "bomp_test",
56                         "bulk_shm",
57                         "cryptotest",
58                         "mdbtest_addr_zero",
59                         "mdbtest_range_query",
60                         "mem_affinity",
61                         "multihoptest",
62                         "net-test",
63                         "net_openport_test",
64                         "nkmtest_invalid_mappings",
65                         "perfmontest",
66                         "phoenix_kmeans",
67                         "socketpipetest",
68                         "spantest",
69                         "spin",
70                         "testconcurrent",
71                         "testdesc",
72                         "testdesc-child",
73                         "tests/cxxtest",
74                         "tests/dma_test",
75                         "tests/xphi_nameservice_test",
76                         "thcidctest",
77                         "thcminitest",
78                         "thctest",
79                         "timer_test",
80                         "tlstest",
81                         "tweedtest",
82                         "xcorecap",
83                         "xcorecapserv" ] ] ++ tests_x86
84
85     tests_x86_32 = [ "/sbin/" ++ f | f <- [
86                     "fread_test",
87                     "fscanf_test"
88                     ] ] ++ tests_x86
89
90     tests_k1om = [ "/sbin/" ++ f | f <- [
91                         "tests/dma_test",
92                         "tests/xeon_phi_inter",
93                         "tests/xeon_phi_test",
94                         "tests/xphi_nameservice_test" ] ] ++ tests_x86
95
96     bench_common = [ "/sbin/" ++ f | f <- [
97                         "channel_cost_bench",
98                         "flounder_stubs_buffer_bench",
99                         "flounder_stubs_empty_bench",
100                         "flounder_stubs_payload_bench",
101                         "xcorecapbench" ]]
102
103     bench_x86 =  [ "/sbin/" ++ f | f <- [
104                       "multihop_latency_bench",
105                       "net_openport_test",
106                       "perfmontest",
107                       "thc_v_flounder_empty",
108                       "timer_test",
109                       "udp_throughput",
110                       "ump_exchange",
111                       "ump_latency",
112                       "ump_latency_cache",
113                       "ump_receive",
114                       "ump_send",
115                       "ump_throughput" ]]
116
117     bench_x86_64 = bench_x86 ++ bin_rcce_bt ++ bin_rcce_lu ++
118                    [ "/sbin/" ++ f | f <- [
119                         "ahci_bench",
120                         "apicdrift_bench",
121                         "benchmarks/bomp_mm",
122                         "benchmarks/dma_bench",
123                         "benchmarks/xomp_share",
124                         "benchmarks/xomp_spawn",
125                         "benchmarks/xomp_work",
126                         "benchmarks/xphi_ump_bench",
127                         "bomp_benchmark_cg",
128                         "bomp_benchmark_ft",
129                         "bomp_benchmark_is",
130                         "bulk_transfer_passthrough",
131                         "bulkbench",
132                         "bulkbench_micro_echo",
133                         "bulkbench_micro_rtt",
134                         "bulkbench_micro_throughput",
135                         "elb_app",
136                         "elb_app_tcp",
137                         "lrpc_bench",
138                         "mdb_bench",
139                         "mdb_bench_old",
140                         "netthroughput",
141                         "phases_bench",
142                         "phases_scale_bench",
143                         "placement_bench",
144                         "rcce_pingpong",
145                         "shared_mem_clock_bench",
146                         "tsc_bench" ]]
147
148     bench_x86_32 = bench_x86 ++ bin_rcce_bt ++ bin_rcce_lu
149
150     bench_k1om = [ "/sbin/" ++ f | f <- [
151                         "benchmarks/bomp_mm",
152                         "benchmarks/dma_bench",
153                         "benchmarks/xomp_share",
154                         "benchmarks/xomp_spawn",
155                         "benchmarks/xomp_work",
156                         "benchmarks/xphi_ump_bench",
157                         "benchmarks/xphi_xump_bench" ] ] ++ bench_x86
158
159     -- Default list of modules to build/install for all enabled architectures
160     modules_common = [ "/sbin/" ++ f | f <- [
161                           "init",
162                           "chips",
163                           "skb",
164                           "spawnd",
165                           "startd",
166                           "mem_serv",
167                           "monitor",
168                           "ramfsd" ]]
169
170     -- List of modules that are arch-independent and always built
171     modules_generic = [
172         "/eclipseclp_ramfs.cpio.gz",
173         "/skb_ramfs.cpio.gz",
174         "/sshd_ramfs.cpio.gz" ]
175
176     -- x86_64-specific modules to build by default
177     -- this should shrink as targets are ported and move into the generic list above
178     modules_x86_64  = [ "/sbin/" ++ f | f <- [
179                            "elver",
180                            "cpu",
181                            "acpi",
182                            "ahcid",
183                            "angler",
184                            "arrakismon",
185                            "bcached",
186                            "bench",
187                            "bfscope",
188                            "block_server",
189                            "block_server_client",
190                            "boot_perfmon",
191                            "bs_user",
192                            "bulk_shm",
193                            "corectrl",
194                            "datagatherer",
195                            "dma_mgr",
196                            "e1000n",
197                            "e10k",
198                            "e10k_queue",
199                            "echoserver",
200                            "fbdemo",
201                            "fish",
202                            "hpet",
203                            "ioat_dma",
204                            "kaluga",
205                            "lo_queue",
206                            "lpc_kbd",
207                            "lpc_timer",
208                            "lshw",
209                            "mem_serv_dist",
210                            "netd",
211                            "NGD_mng",
212                            "pci",
213                            "routing_setup",
214                            "rtl8029",
215                            "serial",
216                            "sfxge",
217                            "slideshow",
218                            "sshd",
219                            "vbe",
220                            "virtio_blk",
221                            "virtio_blk_host",
222                            "vmkitmon",
223                            "vnode_map_test",
224                            "webserver",
225                            "xeon_phi",
226                            "xeon_phi_mgr"
227                            ]] ++ modules_common
228
229     -- the following are broken in the newidc system
230     modules_x86_64_broken  = [ "/sbin/" ++ f | f <- [
231                                   "barriers",
232                                   "ipi_bench",
233                                   "ring_barriers",
234                                   "ssf_bcast",
235                                   "lamport_bcast" ]]
236
237     -- x86-32-specific module to build by default
238     modules_x86_32  = [ "/sbin/" ++ f | f <- [
239                            "cpu",
240                            "lpc_kbd",
241                            "serial",
242                            "rcce_pingpong",
243                            "bench",
244                            "fbdemo",
245                            "fish",
246                            "fputest",
247                            "pci",
248                            "acpi",
249                            "kaluga",
250                            "slideshow",
251                            "thc_v_flounder_empty",
252                            "thcidctest",
253                            "thcminitest",
254                            "thctest",
255                            "vbe",
256                            "mem_serv_dist",
257                            "routing_setup",
258                            "multihoptest",
259                            "multihop_latency_bench",
260                            "angler",
261                            "sshd",
262                            "corectrl" ]] ++ bin_rcce_bt ++ bin_rcce_lu ++ modules_common
263
264     modules_k1om = [ "/sbin/" ++ f | f <- [
265                         "weever",
266                         "cpu",
267                         "xeon_phi",
268                         "corectrl" ] ]
269
270     -- ARMv7-a Pandaboard modules
271     pandaModules = [ "/sbin/" ++ f | f <- [
272                         "cpu_omap44xx",
273                         "init",
274                         "mem_serv",
275                         "monitor",
276                         "ramfsd",
277                         "spawnd",
278                         "startd",
279                         "skb",
280                         "memtest",
281                         "kaluga",
282                         "fish",
283                         "sdma",
284                         "sdmatest",
285                         "sdma_bench",
286                         "bulk_sdma",
287                         "usb_manager",
288                         "usb_keyboard",
289                         "serial",
290                         "angler",
291                         "corectrl"
292                         ] ]
293
294     -- ARMv7-m Pandaboard modules, this is unsupported.
295     pandaM3Modules = [ "/sbin/" ++ f | f <- [
296                           "cpu_omap44xx",
297                           "init",
298                           "mem_serv",
299                           "monitor",
300                           "ramfsd",
301                           "spawnd",
302                           "startd",
303                           "skb",
304                           "memtest"
305                           ] ]
306
307     -- ARMv7-a modules for running under GEM5
308     gem5Modules = [ "/sbin/" ++ f | f <- [
309                        "cpu_arm_gem5",
310                        "init",
311                        "mem_serv",
312                        "monitor",
313                        "ramfsd",
314                        "spawnd",
315                        "startd",
316                        "corectrl",
317                        "skb",
318                        "memtest"
319                        ] ]
320
321     -- ARMv8 modules for running under GEM5
322     armv8_gem5Modules = [ "/sbin/" ++ f | f <- [
323                        "cpu_gem5",
324                        "init",
325                        "mem_serv",
326                        "monitor",
327                        "ramfsd",
328                        "spawnd",
329                        "startd",
330                        "corectrl",
331                        "skb",
332                        "memtest",
333                        "serial",
334                        "fish",
335                        "angler"
336                        ] ]
337   in
338  [
339    --
340    -- Rules to build assorted platforms
341    --
342
343     platform "X86_64_Basic" [ "x86_64" ]
344       ([ ("x86_64", f) | f <- modules_x86_64 ]
345        ++
346        [ ("",       f) | f <- modules_generic])
347       "Basic 64-bit x86 PC build",
348
349     platform "X86_64_Benchmarks" [ "x86_64" ]
350       ([ ("x86_64", f) | f <- modules_x86_64 ++ bench_x86_64]
351        ++
352        [ ("",       f) | f <- modules_generic])
353       "64-bit x86 PC build with benchmarks",
354
355     platform "X86_64_Full" [ "x86_64" ]
356       ([ ("x86_64", f) | f <- modules_x86_64 ++ bench_x86_64 ++ tests_x86_64 ]
357        ++
358        [ ("",       f) | f <- modules_generic])
359       "64-bit x86 PC build with benchmarks and test suites",
360
361     platform "X86_32_Basic" [ "x86_32" ]
362       ([ ("x86_32", f) | f <- modules_x86_32 ]
363        ++
364        [ ("",       f) | f <- modules_generic])
365       "Basic 32-bit x86 PC build",
366
367     platform "X86_32_Benchmarks" [ "x86_32" ]
368       ([ ("x86_32", f) | f <- modules_x86_32 ++ bench_x86_32]
369        ++
370        [ ("",       f) | f <- modules_generic])
371       "32-bit x86 PC build with benchmarks",
372
373     platform "X86_32_Full" [ "x86_32" ]
374       ([ ("x86_32", f) | f <- modules_x86_32 ++ bench_x86_32 ++ tests_x86_32 ]
375        ++
376        [ ("",       f) | f <- modules_generic])
377       "32-bit x86 PC build with benchmarks and test suites",
378
379     platform "K1OM_Basic" [ "k1om" ]
380       ([ ("k1om", f) | f <- modules_k1om ]
381        ++
382        [ ("",       f) | f <- modules_generic])
383       "Basic Xeon Phi build",
384
385     platform "K1OM_Benchmarks" [ "k1om" ]
386       ([ ("k1om", f) | f <- modules_k1om ++ bench_k1om]
387        ++
388        [ ("",       f) | f <- modules_generic])
389       "Xeon Phi build with benchmarks",
390
391     platform "K1OM_Full" [ "k1om" ]
392       ([ ("k1om", f) | f <- modules_k1om ++ bench_k1om ++ tests_k1om ]
393        ++
394        [ ("",       f) | f <- modules_generic])
395       "Xeon Phi build with benchmarks and test suites",
396
397     platform "PandaboardES" [ "armv7" ]
398     ([ ("armv7", f) | f <- pandaModules ] ++ [ ("root", "/pandaboard_image") ])
399     "Standard Pandaboard ES build image and modules",
400
401     platform "ARMv8-GEM5" [ "armv8" ]
402     ([ ("armv8", f) | f <- armv8_gem5Modules ] ++ [ ("root", "/armv8_gem5_image") ])
403     "GEM5 emulator for ARM Cortex-A series multicore processors",
404
405     platform "ARMv7-GEM5" [ "armv7" ]
406     ([ ("armv7", f) | f <- gem5Modules ] ++ [ ("root", "/arm_gem5_image") ])
407     "GEM5 emulator for ARM Cortex-A series multicore processors",
408
409     platform "ARMv5" [ "armv5" ]
410     ([ ("armv5", "/sbin/" ++ f) | f <- [ "cpu", "cpu.bin" ]])
411     "Very basic ARMv5 configuration for testing",
412
413     platform "XScale" [ "xscale" ]
414     ([ ("xscale", "/sbin/" ++ f) | f <- [ "cpu_ixp2800", "cpu_ixp2800.bin" ]])
415     "Very basic XScale configuration for testing, not guaranteed to boot",
416
417     platform "Mustang" [ "armv8" ]
418     ([ ("armv8", "/sbin/cpu_apm88xxxx") ])
419     "The APM XGene development board (Mustang)",
420
421     --
422     -- Rules to build assorted boot images
423     --
424
425     -- Build the default PandaBoard boot image
426     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
427             Str "--srcdir",   NoDep SrcTree "root" "/.",
428             Str "--builddir", NoDep BuildTree "root" "/.",
429             Str "--arch armv7-a",
430             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.pandaboard",
431             Str "--baseaddr", Str "0x82001000",
432             Str "--image",    Out "root" "/pandaboard_image",
433             Str "--gcc",      Str Config.arm_cc,
434             Str "--objcopy",  Str Config.arm_objcopy,
435             Dep BuildTree "tools" "/bin/arm_molly"
436           ] ++ [ (Dep BuildTree "armv7" m) | m <- pandaModules ]),
437
438     -- Build the (old) PandaBoard Cortex-M3 image
439     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
440             Str "--srcdir",   NoDep SrcTree "root" "/.",
441             Str "--builddir", NoDep BuildTree "root" "/.",
442             Str "--arch armv7-m",
443             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.armv7-m",
444             Str "--baseaddr", Str "0x0",
445             Str "--cflags",   Str "\"-mcpu=cortex-m3 -mthumb\"",
446             Str "--image",    Out "root" "/pandaboard_m3image_intermediate",
447             Str "--gcc",      Str Config.thumb_cc,
448             Str "--objcopy",  Str Config.thumb_objcopy,
449             Dep BuildTree "tools" "/bin/arm_molly"
450           ] ++ [ (Dep BuildTree "armv7-m" m) | m <- pandaM3Modules ]),
451
452     -- Convert slave image into a form we can insert in our image
453     Rule ([ Str "arm-linux-gnueabi-objcopy",
454             Str "-I", Str "binary",
455             Str "-O", Str "elf32-littlearm",
456             Str "-B", Str "arm",
457             Str "--rename-section", Str (".data=.rodata_thumb,alloc,load" ++
458                                          ",readonly,data,contents"),
459             In BuildTree "root" "/pandaboard_m3image_intermediate",
460             Out "root" "/pandaboard_m3image" ]),
461
462     -- Build the ARMv7 GEM5 simulation image
463     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
464             Str "--srcdir",   NoDep SrcTree "root" "/.",
465             Str "--builddir", NoDep BuildTree "root" "/.",
466             Str "--arch armv7-a",
467             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.arm_gem5_mc",
468             Str "--baseaddr", Str "0x100000",
469             Str "--image",    Out "root" "/arm_gem5_image",
470             Str "--gcc",      Str Config.arm_cc,
471             Str "--objcopy",  Str Config.arm_objcopy,
472             Dep BuildTree "tools" "/bin/arm_molly"
473           ] ++ [ (Dep BuildTree "armv7" m) | m <- gem5Modules ]),
474
475     -- Build the ARMv8 GEM5 simulation image
476     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
477             Str "--srcdir",   NoDep SrcTree "root" "/.",
478             Str "--builddir", NoDep BuildTree "root" "/.",
479             Str "--arch armv8-a",
480             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.armv8_gem5",
481             Str "--baseaddr", Str "0x100000",
482             Str "--image",    Out "root" "/armv8_gem5_image",
483             Str "--gcc",      Str Config.aarch64_cc,
484             Str "--objcopy",  Str Config.aarch64_objcopy,
485             Dep BuildTree "tools" "/bin/arm_molly"
486           ] ++ [ (Dep BuildTree "armv8" m) | m <- armv8_gem5Modules ]),
487
488     -- XScale needs a special rule to generate "include/romfs_size.h"
489     -- XXX - this is currently a non-functional stub.  A real solution would
490     -- be to do a binary patch on the final image, if anybody still cares.
491     Rule ([ Str "echo",
492             Str ("\"size_t romfs_cpio_archive_size = 0;" ++
493                  " //should not see this\""),
494             Str ">",
495             Out "xscale" "/include/romfs_size.h" ]),
496
497     --
498     -- Booting: various targets for booting Barrelfish under different circumstances
499     --
500
501     -- Copy menu.list files across
502     Rules [ copyFile SrcTree "root" ("/hake/menu.lst." ++ p)
503                      "root" ("/platforms/arm/menu.lst." ++ p)
504             | p <- [ "armv8_gem5",
505                      "arm_gem5",
506                      "arm_gem5_mc",
507                      "arm_gem5_panda",
508                      "armv5",
509                      "armv7-m",
510                      "pandaboard",
511                      "xscale" ]],
512     Rules [ copyFile SrcTree "root" ("/hake/menu.lst." ++ p)
513                      "root" ("/platforms/x86/menu.lst." ++ p)
514             | p <- [ "x86_32", "x86_64", "k1om" ] ],
515
516     -- Convenient functions for running GEM5
517     boot "gem5_armv8" [ "armv8" ] [
518       Str Config.gem5,
519       In SrcTree "tools" "/tools/aarch64_gem5/gem5script.py",
520       Str "--caches",
521       Str "--l2cache",
522       Str "--n=1",
523       NStr "--kernel=", In BuildTree "root" "/armv8_gem5_image" ]
524     "Boot an ARMv8 single core image in GEM5",
525
526     boot "gem5_armv8_detailed" [ "armv8" ] [
527       Str Config.gem5,
528       In SrcTree "tools" "/tools/aarch64_gem5/gem5script.py",
529       Str "--caches",
530       Str "--l2cache",
531       Str "--n=1",
532       Str "--cpu-type=arm_detailed",
533       NStr "--kernel=", In BuildTree "root" "/armv8_gem5_image" ]
534     "Boot an ARMv8 single core image in GEM5 using a detailed CPU model",
535
536     boot "gem5_armv7" [ "armv7" ] [
537       Str Config.gem5,
538       In SrcTree "tools" "/tools/arm_gem5/gem5script.py",
539       Str "--caches",
540       Str "--l2cache",
541       Str "--n=2",
542       NStr "--kernel=", In BuildTree "root" "/arm_gem5_image" ]
543     "Boot an ARMv7a multicore image in GEM5",
544
545     boot "gem5_armv7_detailed" [ "armv7" ] [
546       Str Config.gem5,
547       In SrcTree "tools" "/tools/arm_gem5/gem5script.py",
548       Str "--caches",
549       Str "--l2cache",
550       Str "--n=2",
551       Str "--cpu-type=arm_detailed",
552       NStr "--kernel=", In BuildTree "root" "/arm_gem5_image" ]
553     "Boot an ARMv7a multicore image in GEM5 using a detailed CPU model",
554
555     boot "qemu_x86_64" [ "x86_64" ] [
556       In SrcTree "tools" "/tools/qemu-wrapper.sh",
557       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_64",
558       Str "--arch", Str "x86_64" ]
559     "Boot QEMU in 64-bit x86 mode emulating a PC",
560
561     boot "qemu_x86_32" [ "x86_32" ] [
562       In SrcTree "tools" "/tools/qemu-wrapper.sh",
563       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_32",
564       Str "--arch", Str "x86_32" ]
565     "Boot QEMU in 32-bit x86 mode emulating a PC",
566
567     boot "qemu_x86_64_debug" [ "x86_64" ] [
568       In SrcTree "tools" "/tools/qemu-wrapper.sh",
569       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_64",
570       Str "--arch", Str "x86_64",
571       Str "--debug", In SrcTree "tools" "/tools/debug.gdb" ]
572     "Boot QEMU under GDB in 64-bit x86 mode emulating a PC",
573
574     boot "qemu_x86_32_debug" [ "x86_32" ] [
575       In SrcTree "tools" "/tools/qemu-wrapper.sh",
576       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_32",
577       Str "--arch", Str "x86_32",
578       Str "--debug", In SrcTree "tools" "/tools/debug.gdb" ]
579     "Boot QEMU under GDB in 32-bit x86 mode emulating a PC",
580
581     boot "qemu_armv5" [ "armv5" ] [
582       In SrcTree "tools" "/tools/qemu-wrapper.sh",
583       Str "--kernel", In BuildTree "armv5" "/sbin/cpu.bin",
584       Str "--initrd", In BuildTree "armv5" "/romfs.cpio",
585       Str "--arch", Str "armv5" ]
586     "Boot QEMU as an ARMv5-based Integrator/CP board",
587
588     boot "qemu_armv5_debug" [ "armv5" ] [
589       In SrcTree "tools" "/tools/qemu-wrapper.sh",
590       Str "--kernel", In BuildTree "armv5" "/sbin/cpu.bin",
591       Str "--initrd", In BuildTree "armv5" "/romfs.cpio",
592       Str "--arch", Str "armv5",
593       Str "--debug", In SrcTree "tools" "/tools/debug.arm.gdb" ]
594     "Boot QEMU under GDB as an ARMv5-based Integrator/CP board"
595  ]