source: trunk/platforms/linux_monocluster/Makefile@ 1007

Last change on this file since 1007 was 667, checked in by porquet, 13 years ago

add a new platform, known for running Linux properly

This platform is quite configurable:

  • number of cpus
  • optional framebuffer
  • optional blockdevice

This platform is also quite fast, thanks to the use of VciLocalCrossbar
instead of DspinLocalCrossbar (about 30% faster on Linux simulation).

File size: 2.3 KB
Line 
1# where is soclib?
2#
3SOCLIB_DIR=$(shell soclib-cc --getpath)
4
5# name definitions
6#
7SOCLIB_DESC=desc.py
8SOCLIB_TOP=top.cpp
9SIMULATOR_BINARY=system.x
10SIMULATOR_CMD=./$(SIMULATOR_BINARY) --nobanner
11
12# extra arguments for compilation
13#
14#SOCLIB_CC_ARGS=-v
15SOCLIB_CC_ARGS+=-b common:mips32
16
17# extra arguments for execution
18#
19# gdb
20# - F: start the simulation in a frozen state so it can be attached with a gdb
21# client
22# - X: disable automatic break whenever an exception is caught, the exception
23# handler will be called transparently
24# - S: make the simulation stop and wait for a gdb attachment whenever an
25# exception is caught
26# - C: dump a trace of every inter-functions branch
27# - T: exit the simulator on trap exception
28# - Z: same as C but display only function's entrypoint
29# - W: disable automatic break whenever a watchpoint is hit, just report it on
30# stderr (watchpoints can be defined using SOCLIB_GDB_WATCH)
31SIMULATOR_GDB=
32ifeq ("$(origin GDB)", "command line")
33 ifeq ($(GDB), 1)
34 SIMULATOR_GDB=SOCLIB_GDB=FCX
35 else
36 SIMULATOR_GDB=SOCLIB_GDB=$(GDB)
37 endif
38endif
39# ncpus
40SIMULATOR_NCPUS=4
41ifeq ("$(origin NCPUS)", "command line")
42 SIMULATOR_NCPUS=$(NCPUS)
43endif
44# vmlinux
45SIMULATOR_VMLINUX=./vmlinux
46ifeq ("$(origin VMLINUX)", "command line")
47 SIMULATOR_VMLINUX=$(VMLINUX)
48endif
49# dsk
50SIMULATOR_DSK=
51ifeq ("$(origin DSK)", "command line")
52 SIMULATOR_DSK=--dsk $(DSK)
53endif
54# trace
55SIMULATOR_TRACE=
56ifeq ("$(origin TRACE)", "command line")
57 SIMULATOR_TRACE=--trace $(TRACE)
58endif
59# ncycles
60SIMULATOR_NCYCLES=
61ifeq ("$(origin NCYCLES)", "command line")
62 SIMULATOR_NCYCLES=--ncycles $(NCYCLES)
63endif
64
65# recipes
66all: $(SIMULATOR_BINARY)
67
68$(SIMULATOR_BINARY): $(SOCLIB_DESC) $(SOCLIB_TOP)
69 soclib-cc $(SOCLIB_CC_ARGS) -P -p $(SOCLIB_DESC) -o $(SIMULATOR_BINARY)
70
71run_tsar_boot: all tsar_boot.bin
72 $(SIMULATOR_GDB) $(SIMULATOR_CMD) --ncpus $(SIMULATOR_NCPUS) --rom tsar_boot.bin $(SIMULATOR_DSK) $(SIMULATOR_TRACE) $(SIMULATOR_NCYCLES)
73
74run_dummy_boot: all
75 $(SIMULATOR_GDB) $(SIMULATOR_CMD) --ncpus $(SIMULATOR_NCPUS) --rom $(SIMULATOR_VMLINUX) $(SIMULATOR_DSK) --dummy-boot $(SIMULATOR_TRACE) $(SIMULATOR_NCYCLES)
76
77cscope.out:
78 soclib-cc -p $(SOCLIB_DESC) --tags
79
80clean:
81 soclib-cc -P -p $(SOCLIB_DESC) -x -o $(SIMULATOR_BINARY)
82 rm -f $(SIMULATOR_BINARY) *.o vci*
83
84.PHONY: $(SIMULATOR_BINARY)
Note: See TracBrowser for help on using the repository browser.