Generic modules shouldn't be listed under <arch>/
[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                            ]]
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        [ ("",       f) | f <- modules_generic])
302       "Basic 64-bit x86 PC build",
303
304     platform "X86_64_Benchmarks" [ "x86_64" ]
305       ([ ("x86_64", f) | f <- modules_x86_64 ++ bench_x86_64]
306        ++
307        [ ("",       f) | f <- modules_generic])
308       "64-bit x86 PC build with benchmarks",
309
310     platform "X86_64_Full" [ "x86_64" ]
311       ([ ("x86_64", f) | f <- modules_x86_64 ++ bench_x86_64 ++ tests_x86_64 ]
312        ++
313        [ ("",       f) | f <- modules_generic])
314       "64-bit x86 PC build with benchmarks and test suites",
315
316     platform "X86_32_Basic" [ "x86_32" ]
317       ([ ("x86_32", f) | f <- modules_x86_32 ]
318        ++
319        [ ("",       f) | f <- modules_generic])
320       "Basic 32-bit x86 PC build",
321
322     platform "X86_32_Benchmarks" [ "x86_32" ]
323       ([ ("x86_32", f) | f <- modules_x86_32 ++ bench_x86_32]
324        ++
325        [ ("",       f) | f <- modules_generic])
326       "32-bit x86 PC build with benchmarks",
327
328     platform "X86_32_Full" [ "x86_32" ]
329       ([ ("x86_32", f) | f <- modules_x86_32 ++ bench_x86_32 ++ tests_x86_32 ]
330        ++
331        [ ("",       f) | f <- modules_generic])
332       "32-bit x86 PC build with benchmarks and test suites",
333
334     platform "PandaboardES" [ "armv7" ]
335     ([ ("armv7", f) | f <- pandaModules ] ++ [ ("root", "/pandaboard_image") ])
336     "Standard Pandaboard ES build image and modules",
337     
338     platform "PandaboardES-Heterogeneous" [ "armv7", "armv7-m" ]
339     ([ ("armv7", f) | f <- pandaModules ] ++ [ ("root", "/pandaboard_het_image") ])
340     "Pandaboard ES with experimental heterogeneous (Cortex-M3) support",
341
342     platform "ARMv7-GEM5" [ "armv7" ]
343     ([ ("armv7", f) | f <- gem5Modules ] ++ [ ("root", "/arm_gem5_image") ])
344     "GEM5 emulator for ARM Cortex-A series multicore processors",
345
346     platform "ARMv5" [ "armv5" ]
347     ([ ("armv5", "/sbin/" ++ f) | f <- [ "cpu", "cpu.bin" ]])
348     "Very basic ARMv5 configuration for testing",
349
350     platform "ARM11MP" [ "arm11mp" ]
351     ([ ("arm11mp", "/sbin/" ++ f) | f <- [ "cpu", "cpu.bin" ]])
352     "Very basic ARM11MP configuration for testing",
353
354     --
355     -- Rules to build assorted boot images
356     --
357     
358     -- Build the default PandaBoard boot image
359     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
360             Str "--srcdir",   NoDep SrcTree "root" "/.", 
361             Str "--builddir", NoDep BuildTree "root" "/.", 
362             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.pandaboard",
363             Str "--baseaddr", Str "0x82001000",
364             Str "--image",    Out "root" "/pandaboard_image",
365             Str "--gcc",      Str Config.arm_cc,
366             Str "--objcopy",  Str Config.arm_objcopy,
367             Dep BuildTree "tools" "/bin/arm_molly"
368           ] ++ [ (Dep BuildTree "armv7" m) | m <- pandaModules ]),
369
370     -- Build the (old) PandaBoard Cortex-M3 image
371     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
372             Str "--srcdir",   NoDep SrcTree "root" "/.", 
373             Str "--builddir", NoDep BuildTree "root" "/.",
374             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.armv7-m",
375             Str "--baseaddr", Str "0x00",
376             Str "--cflags",   Str "\"-march=armv7-m -mcpu=cortex-m3 -mthumb\"",
377             Str "--image",    Out "root" "/pandaboard_m3image_intermediate",
378             Str "--gcc",      Str Config.arm_cc,
379             Str "--objcopy",  Str Config.arm_objcopy,
380             Dep BuildTree "tools" "/bin/arm_molly"
381           ] ++ [ (Dep BuildTree "armv7-m" m) | m <- pandaM3Modules ]),
382
383     -- Convert slave image into a form we can insert in our image
384     Rule ([ Str "arm-linux-gnueabi-objcopy",
385             Str "-I", Str "binary",
386             Str "-O", Str "elf32-littlearm",
387             Str "-B", Str "arm",
388             Str "--rename-section", Str ".data=.rodata_thumb,alloc,load,readonly,data,contents",
389             In BuildTree "root" "/pandaboard_m3image_intermediate",
390             Out "root" "/pandaboard_m3image" ]),
391     
392     -- Build the PandaBoard Cortex-A9 image that includes the M3 image
393     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
394             Str "--srcdir",   NoDep SrcTree "root" "/.", 
395             Str "--builddir", NoDep BuildTree "root" "/.",
396             Str "-D",         Str "HETEROPANDA",
397             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.heteropandaboard",
398             Str "--baseaddr", Str "0x82001000",
399             Str "--extra",    In BuildTree "root" "/pandaboard_m3image",
400             Str "--image",    Out "root" "/pandaboard_hetero_image",
401             Str "--gcc",      Str Config.arm_cc,
402             Str "--objcopy",  Str Config.arm_objcopy,
403             Dep BuildTree "tools" "/bin/arm_molly"
404           ] ++ [ (Dep BuildTree "armv7" m) | m <- pandaModules ]),
405
406     -- Build the ARM GEM5 simulation image
407     Rule ([ In SrcTree "tools" "/tools/arm_molly/build_pandaboard_image.sh",
408             Str "--srcdir",   NoDep SrcTree "root" "/.", 
409             Str "--builddir", NoDep BuildTree "root" "/.", 
410             Str "--menu",     In SrcTree "tools" "/hake/menu.lst.arm_gem5_mc",
411             Str "--baseaddr", Str "0x00100000",
412             Str "--image",    Out "root" "/arm_gem5_image",
413             Str "--gcc",      Str Config.arm_cc,
414             Str "--objcopy",  Str Config.arm_objcopy,
415             Dep BuildTree "tools" "/bin/arm_molly"
416           ] ++ [ (Dep BuildTree "armv7" m) | m <- gem5Modules ]),
417
418     --
419     -- Booting: various targets for booting Barrelfish under different circumstances
420     --
421
422     -- Copy menu.list files across
423     Rules [ copyFile SrcTree "root" ("/hake/menu.lst." ++ p)
424                      "root" ("/platforms/arm/menu.lst." ++ p)
425             | p <- [ "arm_gem5",
426                      "arm_gem5_mc",
427                      "arm_gem5_panda",
428                      "armv5",
429                      "armv7-m",
430                      "heteropanda_master",
431                      "pandaboard",
432                      "xscale" ]],
433     Rules [ copyFile SrcTree "root" ("/hake/menu.lst." ++ p)
434                      "root" ("/platforms/x86/menu.lst." ++ p)
435             | p <- [ "x86_32", "x86_64", "k1om" ] ],
436     
437     -- Convenient functions for running GEM5
438     boot "gem5_armv7" [ "armv7" ] [
439       Str Config.gem5,
440       In SrcTree "tools" "/tools/arm_gem5/gem5script.py",
441       Str "--caches",
442       Str "--l2cache",
443       Str "--n=2",
444       NStr "--kernel=", In BuildTree "root" "/arm_gem5_image" ]
445     "Boot an ARMv7a multicore image in GEM5",
446
447     boot "gem5_armv7_detailed" [ "armv7" ] [
448       Str Config.gem5,
449       In SrcTree "tools" "/tools/arm_gem5/gem5script.py",
450       Str "--caches",
451       Str "--l2cache",
452       Str "--n=2",
453       Str "--cpu-type=arm_detailed",
454       NStr "--kernel=", In BuildTree "root" "/arm_gem5_image" ]
455     "Boot an ARMv7a multicore image in GEM5 using a detailed CPU model",
456
457     boot "qemu_x86_64" [ "x86_64" ] [
458       In SrcTree "tools" "/tools/qemu-wrapper.sh",
459       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_64",
460       Str "--arch", Str "x86_64" ]
461     "Boot QEMU in 64-bit x86 mode emulating a PC",
462     
463     boot "qemu_x86_32" [ "x86_32" ] [
464       In SrcTree "tools" "/tools/qemu-wrapper.sh",
465       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_32",
466       Str "--arch", Str "x86_32" ]
467     "Boot QEMU in 32-bit x86 mode emulating a PC",
468
469     boot "qemu_x86_64_debug" [ "x86_64" ] [
470       In SrcTree "tools" "/tools/qemu-wrapper.sh",
471       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_64",
472       Str "--arch", Str "x86_64",
473       Str "--debug", In SrcTree "tools" "/tools/debug.gdb" ]
474     "Boot QEMU under GDB in 64-bit x86 mode emulating a PC",
475     
476     boot "qemu_x86_32_debug" [ "x86_32" ] [
477       In SrcTree "tools" "/tools/qemu-wrapper.sh",
478       Str "--menu", In BuildTree "root" "/platforms/x86/menu.lst.x86_32",
479       Str "--arch", Str "x86_32",
480       Str "--debug", In SrcTree "tools" "/tools/debug.gdb" ]
481     "Boot QEMU under GDB in 32-bit x86 mode emulating a PC",
482
483     boot "qemu_armv5" [ "armv5" ] [
484       In SrcTree "tools" "/tools/qemu-wrapper.sh",
485       Str "--kernel", In BuildTree "armv5" "/sbin/cpu.bin",
486       Str "--initrd", In BuildTree "armv5" "/romfs.cpio",
487       Str "--arch", Str "armv5" ]
488     "Boot QEMU as an ARMv5-based Integrator/CP board",
489
490     boot "qemu_armv5_debug" [ "armv5" ] [
491       In SrcTree "tools" "/tools/qemu-wrapper.sh",
492       Str "--kernel", In BuildTree "armv5" "/sbin/cpu.bin",
493       Str "--initrd", In BuildTree "armv5" "/romfs.cpio",
494       Str "--arch", Str "armv5",
495       Str "--debug", In SrcTree "tools" "/tools/debug.arm.gdb" ]
496     "Boot QEMU under GDB as an ARMv5-based Integrator/CP board",
497
498     boot "qemu_arm11mp" [ "arm11mp" ] [
499       In SrcTree "tools" "/tools/qemu-wrapper.sh",
500       Str "--kernel", In BuildTree "arm11mp" "/sbin/cpu.bin",
501       Str "--initrd", In BuildTree "arm11mp" "/romfs.cpio",
502       Str "--arch", Str "arm11mp" ]
503     "Boot QEMU as an ARM11MPCore-based Realview board"
504     
505  ]
506