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