670495223e8dff1fcb6d81cd514da0fbe930d7e6
[barrelfish] / platforms / Hakefile
1 --------------------------------------------------------------------------
2 -- Copyright (c) 2015, 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, Universit√§tstr. 6, CH-8092 Zurich. Attn: Systems Group.
8 --
9 -- Hakefile for /platforms/x86
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                         "schedtest",
38                         "testerror",
39                         "yield_test" ] ]
40
41     tests_x86 = [ "/sbin/" ++ f | f <- [ 
42                     "tests/luatest",
43                     "tests/numatest" ] ]
44
45     tests_x86_64 = [ "/sbin/" ++ f | f <- [ 
46                         "arrakis_hellotest",
47                         "ata_rw28_test",
48                         "bomp_cpu_bound",
49                         "bomp_cpu_bound_progress",
50                         "bomp_sync",
51                         "bomp_sync_progress",
52                         "bomp_test",
53                         "bulk_shm",
54                         "cryptotest",
55                         "mdbtest_addr_zero",
56                         "mdbtest_range_query",
57                         "mem_affinity",
58                         "multihoptest",
59                         "net-test",
60                         "net_openport_test",
61                         "perfmontest",
62                         "phoenix_kmeans",
63                         "socketpipetest",
64                         "spantest",
65                         "spin",
66                         "testconcurrent",
67                         "testdesc",
68                         "testdesc-child",
69                         "tests/cxxtest",
70                         "tests/dma_test",
71                         "tests/xphi_nameservice_test",
72                         "thcidctest",
73                         "thcminitest",
74                         "thctest",
75                         "timer_test",
76                         "tlstest",
77                         "tweedtest",
78                         "xcorecap",
79                         "xcorecapserv" ] ] ++ tests_x86
80
81     tests_x86_32 = tests_x86
82
83     bench_common = [ "/sbin/" ++ f | f <- [ 
84                        "channel_cost_bench",
85                        "flounder_stubs_buffer_bench",
86                        "flounder_stubs_empty_bench",
87                        "flounder_stubs_payload_bench",
88                        "xcorecapbench" ]]
89
90     bench_x86 =  [ "/sbin/" ++ f | f <- [ 
91                       "multihop_latency_bench",
92                       "net_openport_test",
93                       "perfmontest",
94                       "thc_v_flounder_empty",
95                       "timer_test",
96                       "udp_throughput",
97                       "ump_exchange",
98                       "ump_latency",
99                       "ump_latency_cache",
100                       "ump_receive",
101                       "ump_send",
102                       "ump_throughput" ]]
103
104     bench_x86_64 = bench_x86 ++ bin_rcce_bt ++ bin_rcce_lu ++ 
105                    [ "/sbin/" ++ f | f <- [ 
106                         "ahci_bench",
107                         "apicdrift_bench",
108                         "benchmarks/bomp_mm",
109                         "benchmarks/dma_bench",
110                         "benchmarks/xomp_share",
111                         "benchmarks/xomp_spawn",
112                         "benchmarks/xomp_work",
113                         "benchmarks/xphi_ump_bench",
114                         "bomp_benchmark_cg",
115                         "bomp_benchmark_ft",
116                         "bomp_benchmark_is",
117                         "bulk_transfer_passthrough",
118                         "bulkbench",
119                         "bulkbench_micro_echo",
120                         "bulkbench_micro_rtt",
121                         "bulkbench_micro_throughput",
122                         "elb_app",
123                         "elb_app_tcp",
124                         "lrpc_bench",
125                         "mdb_bench",
126                         "mdb_bench_old",
127                         "netthroughput",
128                         "phases_bench",
129                         "phases_scale_bench",
130                         "placement_bench",
131                         "rcce_pingpong",
132                         "shared_mem_clock_bench",
133                         "tsc_bench" ]]
134
135     bench_x86_32 = bench_x86 ++ bin_rcce_bt ++ bin_rcce_lu
136
137
138     -- Default list of modules to build/install for all enabled architectures
139     modules_common = [ "/sbin/" ++ f | f <- [ 
140                           "init",
141                           "chips",
142                           "skb",
143                           "spawnd",
144                           "startd",
145                           "mem_serv",
146                           "monitor",
147                           "ramfsd" ]]
148
149     -- List of modules that are arch-independent and always built
150     modules_generic = [ "/skb_ramfs.cpio.gz", "/sshd_ramfs.cpio.gz" ]
151
152     -- x86_64-specific modules to build by default
153     -- this should shrink as targets are ported and move into the generic list above 
154     modules_x86_64  = [ "/sbin/" ++ f | f <- [ 
155                            "elver",
156                            "cpu",
157                            "acpi",
158                            "ahcid",
159                            "angler",
160                            "arrakismon",
161                            "bcached",
162                            "bench",
163                            "bfscope",
164                            "block_server",
165                            "block_server_client",
166                            "boot_perfmon",
167                            "bs_user",
168                            "bulk_shm",
169                            "corectrl",
170                            "datagatherer",
171                            "dma_mgr",
172                            "e1000n",
173                            "e10k",
174                            "e10k_queue",
175                            "echoserver",
176                            "fbdemo",
177                            "fish",
178                            "hpet",
179                            "ioat_dma",
180                            "kaluga",
181                            "lo_queue",
182                            "lpc_kbd",
183                            "lpc_timer",
184                            "lshw",
185                            "mem_serv_dist",
186                            "netd",
187                            "NGD_mng",
188                            "pci",
189                            "routing_setup",
190                            "rtl8029",
191                            "serial",
192                            "sfxge",
193                            "sif",
194                            "slideshow",
195                            "sshd",
196                            "vbe",
197                            "virtio_blk",
198                            "virtio_blk_host",
199                            "vmkitmon",
200                            "vnode_map_test",
201                            "webserver",
202                            "xeon_phi",
203                            "xeon_phi_mgr"
204                            ]] ++ modules_generic
205     
206     -- the following are broken in the newidc system
207     modules_x86_64_broken  = [ "/sbin/" ++ f | f <- [ 
208                                   "barriers",
209                                   "ipi_bench",
210                                   "ring_barriers",
211                                   "ssf_bcast",
212                                   "lamport_bcast" ]]
213                              
214     -- x86-32-specific module to build by default
215     modules_x86_32  = [ "/sbin/" ++ f | f <- [ 
216                            "cpu",
217                            "lpc_kbd",
218                            "serial",
219                            "rcce_pingpong",
220                            "bench",
221                            "fbdemo",
222                            "fish",
223                            "fputest",
224                            "pci",
225                            "acpi",
226                            "kaluga",
227                            "slideshow",
228                            "thc_v_flounder_empty",
229                            "thcidctest",
230                            "thcminitest",
231                            "thctest",
232                            "vbe",
233                            "mem_serv_dist",
234                            "routing_setup",
235                            "multihoptest",
236                            "multihop_latency_bench",
237                            "angler",
238                            "sshd",
239                            "corectrl" ]] ++ bin_rcce_bt ++ bin_rcce_lu
240
241     -- ARMv7-a Pandaboard modules
242     pandaModules = [ "/sbin/" ++ f | f <- [
243                         "cpu_omap44xx",
244                         "init",
245                         "mem_serv",
246                         "monitor",
247                         "ramfsd",
248                         "spawnd",
249                         "startd",
250                         "skb",
251                         "memtest",
252                         "kaluga",
253                         "fish",
254                         "sdma",
255                         "sdmatest",
256                         "sdma_bench",
257                         "bulk_sdma",
258                         "usb_manager",
259                         "usb_keyboard",
260                         "serial",
261                         "angler",
262                         "corectrl"
263                         ] ]
264
265     -- ARMv7-m Pandaboard modules
266     pandaM3Modules = [ "/sbin/" ++ f | f <- [
267                           "cpu_omap44xx",
268                           "init",
269                           "mem_serv",
270                           "monitor",
271                           "ramfsd",
272                           "spawnd",
273                           "startd",
274                           "skb",
275                           "memtest"
276                           ] ]
277
278     -- ARMv7-a modules for running under GEM5
279     gem5Modules = [ "/sbin/" ++ f | f <- [
280                        "cpu_arm_gem5",
281                        "init",
282                        "mem_serv",
283                        "monitor",
284                        "ramfsd",
285                        "spawnd",
286                        "startd",
287                        "corectrl",
288                        "skb",
289                        "memtest"
290                        ] ]
291   in
292  [
293
294
295    --
296    -- Rules to build assorted platforms
297    --
298    
299     platform "X86_64_Basic" [ "x86_64" ]
300       [ ("x86_64", f) | f <- modules_x86_64 ]
301       "Basic 64-bit x86 PC build",
302
303     platform "X86_64_Benchmarks" [ "x86_64" ]
304       [ ("x86_64", f) | f <- modules_x86_64 ++ bench_x86_64]
305       "64-bit x86 PC build with benchmarks",
306
307     platform "X86_64_Full" [ "x86_64" ]
308       [ ("x86_64", f) | f <- modules_x86_64 ++ bench_x86_64 ++ tests_x86_64 ]
309       "64-bit x86 PC build with benchmarks and test suites",
310
311     platform "X86_32_Basic" [ "x86_32" ]
312       [ ("x86_32", f) | f <- modules_x86_32 ]
313       "Basic 32-bit x86 PC build",
314
315     platform "X86_32_Benchmarks" [ "x86_32" ]
316       [ ("x86_32", f) | f <- modules_x86_32 ++ bench_x86_32]
317       "32-bit x86 PC build with benchmarks",
318
319     platform "X86_32_Full" [ "x86_32" ]
320       [ ("x86_32", f) | f <- modules_x86_32 ++ bench_x86_32 ++ tests_x86_32 ]
321       "32-bit x86 PC build with benchmarks and test suites",
322
323     platform "PandaboardES" [ "armv7" ]
324     ([ ("armv7", f) | f <- pandaModules ] ++ [ ("root", "/pandaboard_image") ])
325     "Standard Pandaboard ES build image and modules",
326     
327     platform "PandaboardES-Heterogeneous" [ "armv7", "armv7-m" ]
328     ([ ("armv7", f) | f <- pandaModules ] ++ [ ("root", "/pandaboard_het_image") ])
329     "Pandaboard ES with experimental heterogeneous (Cortex-M3) support",
330
331     platform "ARMv7-GEM5" [ "armv7" ]
332     ([ ("armv7", f) | f <- gem5Modules ] ++ [ ("root", "/arm_gem5_image") ])
333     "GEM5 emulator for ARM Cortex-A series multicore processors",
334
335     platform "ARMv5" [ "armv5" ]
336     ([ ("armv5", "/sbin/" ++ f) | f <- [ "cpu", "cpu.bin" ]])
337     "Very basic ARMv5 configuration for testing",
338
339     platform "ARM11MP" [ "arm11mp" ]
340     ([ ("arm11mp", "/sbin/" ++ f) | f <- [ "cpu", "cpu.bin" ]])
341     "Very basic ARM11MP configuration for testing",
342
343     --
344     -- Rules to build assorted boot images
345     --
346     
347     -- Build the default PandaBoard boot image
348     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
349             Str "--srcdir",   NoDep SrcTree "root" "/.", 
350             Str "--builddir", NoDep BuildTree "root" "/.", 
351             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.pandaboard",
352             Str "--baseaddr", Str "0x82001000",
353             Str "--image",    Out "root" "/pandaboard_image",
354             Str "--gcc",      Str Config.arm_cc,
355             Str "--objcopy",  Str Config.arm_objcopy,
356             Dep BuildTree "tools" "/bin/arm_molly"
357           ] ++ [ (Dep BuildTree "armv7" m) | m <- pandaModules ]),
358
359     -- Build the (old) PandaBoard Cortex-M3 image
360     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
361             Str "--srcdir",   NoDep SrcTree "root" "/.", 
362             Str "--builddir", NoDep BuildTree "root" "/.",
363             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.armv7-m",
364             Str "--baseaddr", Str "0x00",
365             Str "--cflags",   Str "\"-march=armv7-m -mcpu=cortex-m3 -mthumb\"",
366             Str "--image",    Out "root" "/pandaboard_m3image_intermediate",
367             Str "--gcc",      Str Config.arm_cc,
368             Str "--objcopy",  Str Config.arm_objcopy,
369             Dep BuildTree "tools" "/bin/arm_molly"
370           ] ++ [ (Dep BuildTree "armv7-m" m) | m <- pandaM3Modules ]),
371
372     -- Convert slave image into a form we can insert in our image
373     Rule ([ Str "arm-linux-gnueabi-objcopy",
374             Str "-I", Str "binary",
375             Str "-O", Str "elf32-littlearm",
376             Str "-B", Str "arm",
377             Str "--rename-section", Str ".data=.rodata_thumb,alloc,load,readonly,data,contents",
378             In BuildTree "root" "/pandaboard_m3image_intermediate",
379             Out "root" "/pandaboard_m3image" ]),
380     
381     -- Build the PandaBoard Cortex-A9 image that includes the M3 image
382     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
383             Str "--srcdir",   NoDep SrcTree "root" "/.", 
384             Str "--builddir", NoDep BuildTree "root" "/.",
385             Str "-D",         Str "HETEROPANDA",
386             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.heteropandaboard",
387             Str "--baseaddr", Str "0x82001000",
388             Str "--extra",    In BuildTree "root" "/pandaboard_m3image",
389             Str "--image",    Out "root" "/pandaboard_hetero_image",
390             Str "--gcc",      Str Config.arm_cc,
391             Str "--objcopy",  Str Config.arm_objcopy,
392             Dep BuildTree "tools" "/bin/arm_molly"
393           ] ++ [ (Dep BuildTree "armv7" m) | m <- pandaModules ]),
394
395     -- Build the ARM GEM5 simulation image
396     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
397             Str "--srcdir",   NoDep SrcTree "root" "/.", 
398             Str "--builddir", NoDep BuildTree "root" "/.", 
399             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.arm_gem5_mc",
400             Str "--baseaddr", Str "0x00100000",
401             Str "--image",    Out "root" "/arm_gem5_image",
402             Str "--gcc",      Str Config.arm_cc,
403             Str "--objcopy",  Str Config.arm_objcopy,
404             Dep BuildTree "tools" "/bin/arm_molly"
405           ] ++ [ (Dep BuildTree "armv7" m) | m <- gem5Modules ]),
406
407     --
408     -- Booting: various targets for booting Barrelfish under different circumstances
409     --
410
411     -- Copy menu.list files across
412     Rules [ copyFile SrcTree "root" ("/hake/menu.lst." ++ p)
413                      "root" ("/platforms/arm/menu.lst." ++ p)
414             | p <- [ "arm_gem5",
415                      "arm_gem5_mc",
416                      "arm_gem5_panda",
417                      "armv5",
418                      "armv7-m",
419                      "heteropanda_master",
420                      "pandaboard",
421                      "xscale" ]],
422     Rules [ copyFile SrcTree "root" ("/hake/menu.lst." ++ p)
423                      "root" ("/platforms/x86/menu.lst." ++ p)
424             | p <- [ "x86_32", "x86_64", "k1om" ] ],
425     
426     -- Convenient functions for running GEM5
427     boot "gem5_armv7" [ "armv7" ] [
428       Str Config.gem5,
429       In SrcTree "tools" "/tools/arm_gem5/gem5script.py",
430       Str "--caches",
431       Str "--l2cache",
432       Str "--n=2",
433       NStr "--kernel=", In BuildTree "root" "/arm_gem5_image" ]
434     "Boot an ARMv7a multicore image in GEM5",
435
436     boot "gem5_armv7_detailed" [ "armv7" ] [
437       Str Config.gem5,
438       In SrcTree "tools" "/tools/arm_gem5/gem5script.py",
439       Str "--caches",
440       Str "--l2cache",
441       Str "--n=2",
442       Str "--cpu-type=arm_detailed",
443       NStr "--kernel=", In BuildTree "root" "/arm_gem5_image" ]
444     "Boot an ARMv7a multicore image in GEM5 using a detailed CPU model",
445
446     boot "qemu_x86_64" [ "x86_64" ] [
447       In SrcTree "tools" "/tools/qemu-wrapper.sh",
448       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_64",
449       Str "--arch", Str "x86_64" ]
450     "Boot QEMU in 64-bit x86 mode emulating a PC",
451     
452     boot "qemu_x86_32" [ "x86_32" ] [
453       In SrcTree "tools" "/tools/qemu-wrapper.sh",
454       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_32",
455       Str "--arch", Str "x86_32" ]
456     "Boot QEMU in 32-bit x86 mode emulating a PC",
457
458     boot "qemu_x86_64_debug" [ "x86_64" ] [
459       In SrcTree "tools" "/tools/qemu-wrapper.sh",
460       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_64",
461       Str "--arch", Str "x86_64",
462       Str "--debug", In SrcTree "tools" "/tools/debug.gdb" ]
463     "Boot QEMU under GDB in 64-bit x86 mode emulating a PC",
464     
465     boot "qemu_x86_32_debug" [ "x86_32" ] [
466       In SrcTree "tools" "/tools/qemu-wrapper.sh",
467       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_32",
468       Str "--arch", Str "x86_32",
469       Str "--debug", In SrcTree "tools" "/tools/debug.gdb" ]
470     "Boot QEMU under GDB in 32-bit x86 mode emulating a PC",
471
472     boot "qemu_armv5" [ "armv5" ] [
473       In SrcTree "tools" "/tools/qemu-wrapper.sh",
474       Str "--kernel", In BuildTree "armv5" "/sbin/cpu.bin",
475       Str "--initrd", In BuildTree "armv5" "/romfs.cpio",
476       Str "--arch", Str "armv5" ]
477     "Boot QEMU as an ARMv5-based Integrator/CP board",
478
479     boot "qemu_armv5_debug" [ "armv5" ] [
480       In SrcTree "tools" "/tools/qemu-wrapper.sh",
481       Str "--kernel", In BuildTree "armv5" "/sbin/cpu.bin",
482       Str "--initrd", In BuildTree "armv5" "/romfs.cpio",
483       Str "--arch", Str "armv5",
484       Str "--debug", In SrcTree "tools" "/tools/debug.arm.gdb" ]
485     "Boot QEMU under GDB as an ARMv5-based Integrator/CP board",
486
487     boot "qemu_arm11mp" [ "arm11mp" ] [
488       In SrcTree "tools" "/tools/qemu-wrapper.sh",
489       Str "--kernel", In BuildTree "arm11mp" "/sbin/cpu.bin",
490       Str "--initrd", In BuildTree "arm11mp" "/romfs.cpio",
491       Str "--arch", Str "arm11mp" ]
492     "Boot QEMU as an ARM11MPCore-based Realview board"
493     
494  ]
495