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