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