- Timestamp:
- Jul 8, 2015, 4:28:46 PM (9 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/Makefile
r585 r595 1 -include build.mk 2 3 export # export all variable to sub-Makefile 1 -include params.mk 2 3 export # export all variable to applications sub-Makefile 4 4 5 CC = mipsel-unknown-elf-gcc 5 6 AS = mipsel-unknown-elf-as … … 8 9 AR = mipsel-unknown-elf-ar 9 10 10 # Parameters definition11 # ARCH ?= ../tsar-trunk-svn-2013/platforms/tsar_generic_iob12 ARCH ?= ../../../tsar/platforms/tsar_generic_iob11 # Defaults values for hardware parameters and applications 12 # These parameters should be defined in the build.mk file 13 ARCH ?= pathname 13 14 X_SIZE ?= 1 14 15 Y_SIZE ?= 1 15 NB_PROCS ?= 416 NB_PROCS ?= 1 16 17 NB_TTYS ?= 1 17 FBF_WIDTH ?= 128 18 IOC_TYPE ?= HBA 19 APP ?= ocean 20 21 22 .PHONY: clean map.bin build 23 24 ### FAT parameters definition for Disk image 25 ### sector_size = 512 26 ### partition_begin_lba = 300 27 ### sector_per_cluster = 8 28 ### partition sectors = 524832 29 30 BUILD_DIRS = boot \ 31 classif \ 32 common \ 33 convol \ 34 coproc \ 35 dhrystone \ 36 display \ 37 drivers \ 38 fat32 \ 39 gameoflife\ 40 hello \ 41 kernel \ 42 libs/math \ 43 ocean \ 44 pgcd \ 45 router \ 46 sort \ 47 transpose 18 FBF_WIDTH ?= 256 19 IOC_TYPE ?= BDV 20 APPLIS ?= classif 21 22 # build the list of applications used as argument by genmap 23 GENMAP_APPLIS := $(addprefix --,$(APPLIS)) 24 25 # TODO delete or improve 26 # build the list of applications used as dependancies by genmap 27 28 # build the list of applications to be executed (used in the all rule) 29 APPLIS_ELF := $(addsuffix /appli.elf,$(addprefix applications/,$(APPLIS))) 30 31 # check hardware platform definition 32 ifeq ($(wildcard $(ARCH)),) 33 $(error please define in ARCH parameter the path to the platform) 34 endif 35 36 # Build the convenient PYTHONPATH 37 PYTHONPATH := giet_python 38 PYTHONPATH := applications/classif:$(PYTHONPATH) 39 PYTHONPATH := applications/convol:$(PYTHONPATH) 40 PYTHONPATH := applications/coproc:$(PYTHONPATH) 41 PYTHONPATH := applications/display:$(PYTHONPATH) 42 PYTHONPATH := applications/dhrystone:$(PYTHONPATH) 43 PYTHONPATH := applications/gameoflife:$(PYTHONPATH) 44 PYTHONPATH := applications/ocean:$(PYTHONPATH) 45 PYTHONPATH := applications/router:$(PYTHONPATH) 46 PYTHONPATH := applications/sort:$(PYTHONPATH) 47 PYTHONPATH := applications/shell:$(PYTHONPATH) 48 PYTHONPATH := applications/transpose:$(PYTHONPATH) 49 50 .PHONY: clean map.bin 51 52 .NOTPARALLEL: 48 53 49 54 ### Objects to be linked for the drivers library … … 91 96 build/kernel/ctx_handler.o \ 92 97 build/kernel/irq_handler.o \ 98 build/kernel/sys_handler.o \ 93 99 build/kernel/switch.o \ 94 100 build/boot/boot.o \ … … 103 109 build/libs/user_barrier.o \ 104 110 build/libs/user_lock.o \ 105 build/libs/user_sqt_lock.o \111 build/libs/user_sqt_lock.o 106 112 107 113 ### Objects to be linked for the math library … … 120 126 build/libs/math/s_scalbn.o \ 121 127 build/libs/math/s_sin.o \ 122 build/libs/math/e_sqrt.o \ 123 124 ### Objects to be linked for display.elf 125 DISPLAY_OBJS = build/display/main.o \ 126 build/libs/libuser.a 127 128 ### Objects to be linked for router.elf 129 ROUTER_OBJS = build/router/main.o \ 130 build/libs/libuser.a 131 132 ### Objects to be linked for hello.elf 133 HELLO_OBJS = build/hello/main.o \ 134 build/libs/libuser.a 135 136 ### Objects to be linked for pgcd.elf 137 PGCD_OBJS = build/pgcd/main.o \ 138 build/libs/libuser.a 139 140 ### Objects to be linked for game.elf 141 GAMEOFLIFE_OBJS = build/gameoflife/main.o \ 142 build/libs/libuser.a 143 144 ### Objects to be linked for dhrystone.elf 145 DHRYSTONE_OBJS = build/dhrystone/dhry_1.o \ 146 build/dhrystone/dhry_2.o \ 147 build/libs/libuser.a 148 149 ### Objects to be linked for sort.elf 150 SORT_OBJS = build/sort/main.o \ 151 build/libs/libuser.a 152 153 ### Objects to be linked for transpose.elf 154 TRANSPOSE_OBJS = build/transpose/main.o \ 155 build/libs/libuser.a 156 157 ### Objects to be linked for convol.elf 158 CONVOL_OBJS = build/convol/main.o \ 159 build/libs/libuser.a 160 161 ### Objects to be linked for classif.elf 162 CLASSIF_OBJS = build/classif/main.o \ 163 build/libs/libuser.a 164 165 ### Objects to be linked for coproc.elf 166 COPROC_OBJS = build/coproc/main.o \ 167 build/libs/libuser.a 168 169 ### Objects to be linked for ocean.elf 170 OCEAN_OBJS = build/libs/stdio.o \ 171 build/libs/libuser.a \ 172 build/libs/libmath.a 128 build/libs/math/e_sqrt.o 129 173 130 174 131 CFLAGS = -Wall -ffreestanding -mno-gpopt -mips32 -g -O2 \ … … 184 141 -I. 185 142 186 USER_INCLUDE = -Igiet_libs \187 -Igiet_xml \188 -I.189 190 143 DISK_IMAGE := hdd/virt_hdd.dmg 191 144 192 ### All the Mtools commands perform a few sanity checks before going ahead,145 ### The Mtools used to build the FAT32 disk image perform a few sanity checks, 193 146 ### to make sure that the disk is indeed an MS-DOS disk. However, the size 194 147 ### of the disk image used by the Giet-VM is not MS-DOS compliant. … … 196 149 MTOOLS_SKIP_CHECK := 1 197 150 198 all: build \ 199 $(DISK_IMAGE) \ 151 ################################## 152 ### first rule executed (make all) 153 all: $(DISK_IMAGE) \ 200 154 map.bin \ 201 155 hard_config.h \ … … 203 157 build/boot/boot.elf \ 204 158 build/kernel/kernel.elf \ 205 build/display/display.elf \ 206 build/hello/hello.elf \ 207 build/pgcd/pgcd.elf \ 208 build/router/router.elf \ 209 build/dhrystone/dhrystone.elf \ 210 build/gameoflife/gameoflife.elf \ 211 build/sort/sort.elf \ 212 build/transpose/transpose.elf \ 213 build/convol/convol.elf \ 214 build/classif/classif.elf \ 215 build/coproc/coproc.elf \ 216 build/ocean/ocean.elf 159 $(APPLIS_ELF) 160 161 mcopy -o -i $(DISK_IMAGE) map.bin ::/ 217 162 mdir -/ -b -i $(DISK_IMAGE) ::/ 218 163 219 build: 220 mkdir -p build 221 (cd build && mkdir -p $(BUILD_DIRS)) 222 223 ### copy the files generated by the virtual prototype on 224 ### the virtual disk "home" directory to the giet_vm home directory 225 extract: 226 mcopy -o -i $(DISK_IMAGE) ::/home . 227 228 ### Disk image generation (no files in this step) 164 ######################### 165 ### Disk image generation 229 166 ### This requires the generic LINUX/MacOS script "create_dmg" script 230 167 ### written by C.Fuguet. (should be installed in GIET-VM root directory). … … 239 176 mmd -o -i $(DISK_IMAGE) ::/misc 240 177 mmd -o -i $(DISK_IMAGE) ::/home 241 mcopy -o -i $(DISK_IMAGE) applications/transpose/images.raw ::/misc 242 mcopy -o -i $(DISK_IMAGE) applications/convol/philips_image.raw ::/misc 243 mcopy -o -i $(DISK_IMAGE) applications/display/lena.raw ::/misc 244 178 mcopy -o -i $(DISK_IMAGE) images/images_128.raw ::/misc 179 mcopy -o -i $(DISK_IMAGE) images/philips_1024.raw ::/misc 180 mcopy -o -i $(DISK_IMAGE) images/lena_256.raw ::/misc 181 mcopy -o -i $(DISK_IMAGE) images/bridge_256.raw ::/misc 182 mcopy -o -i $(DISK_IMAGE) images/couple_512.raw ::/misc 183 184 ##################################################### 185 ### make a recursive list of the virtual disk content 186 list: 187 mdir -/ -w -i $(DISK_IMAGE) ::/ 188 189 ######################################################## 190 ### copy the files generated by the virtual prototype on 191 ### the virtual disk "home" directory to the giet_vm home directory 192 extract: 193 mcopy -o -i $(DISK_IMAGE) ::/home . 194 195 ######################################################################### 245 196 ### mapping generation: map.bin / map.xml / hard_config.h / giet_vsegs.ld 246 map.bin hard_config.h giet_vsegs.ld: $(ARCH)/arch.py applications/$(APP)/$(APP).py $(DISK_IMAGE) 197 ### TODO add dépendancies on appli.py files : $(APPLIS_DEPS) 198 map.bin hard_config.h giet_vsegs.ld: $(ARCH)/arch.py 247 199 giet_python/genmap --arch=$(ARCH) \ 248 200 --x=$(X_SIZE) \ … … 253 205 --ioc=$(IOC_TYPE) \ 254 206 --giet=. \ 255 --$(APP)\207 $(GENMAP_APPLIS) \ 256 208 --xml=. 257 mcopy -o -i $(DISK_IMAGE) map.bin ::/258 209 259 210 ################################ … … 330 281 ########################### 331 282 ### user library compilation 332 build/libs/%.o: giet_libs/%.c \333 giet_libs/%.h \334 hard_config.h \335 giet_config.h336 $(CC) $(CFLAGS) $( USER_INCLUDE) -c -o $@ $<283 build/libs/%.o: giet_libs/%.c \ 284 giet_libs/%.h \ 285 hard_config.h \ 286 giet_config.h 287 $(CC) $(CFLAGS) $(GIET_INCLUDE) -c -o $@ $< 337 288 338 289 build/libs/libuser.a: $(USER_OBJS) … … 344 295 giet_libs/math/math_private.h \ 345 296 giet_libs/math.h 346 $(CC) $(CFLAGS) $( USER_INCLUDE) -c -o $@ $<297 $(CC) $(CFLAGS) $(GIET_INCLUDE) -c -o $@ $< 347 298 348 299 build/libs/libmath.a: $(MATH_OBJS) 349 300 $(AR) -rcs $@ $^ 350 301 351 ######################################## 352 ### display application compilation 353 build/display/display.elf: $(DISPLAY_OBJS) applications/display/display.ld hard_config.h $(DISK_IMAGE) 354 $(LD) -o $@ -T applications/display/display.ld $(DISPLAY_OBJS) 355 $(DU) -D $@ > $@.txt 302 303 304 ######################################## 305 ### classif application compilation 306 applications/classif/appli.elf: build/libs/libuser.a | $(DISK_IMAGE) 307 $(MAKE) -C applications/classif 308 mmd -o -i $(DISK_IMAGE) ::/build/classif || true 309 mcopy -o -i $(DISK_IMAGE) $@ ::/build/classif 310 311 ######################################## 312 ### convol application compilation 313 applications/convol/appli.elf: build/libs/libuser.a | $(DISK_IMAGE) 314 $(MAKE) -C applications/convol 315 mmd -o -i $(DISK_IMAGE) ::/build/convol || true 316 mcopy -o -i $(DISK_IMAGE) $@ ::/build/convol 317 318 ######################################## 319 ### coproc application compilation 320 applications/coproc/appli.elf: build/libs/libuser.a | $(DISK_IMAGE) 321 $(MAKE) -C applications/coproc 322 mmd -o -i $(DISK_IMAGE) ::/build/coproc || true 323 mcopy -o -i $(DISK_IMAGE) $@ ::/build/coproc 324 325 ######################################## 326 ### dhrystone application compilation 327 applications/dhrystone/appli.elf: build/libs/libuser.a | $(DISK_IMAGE) 328 $(MAKE) -C applications/dhrystone 329 mmd -o -i $(DISK_IMAGE) ::/build/dhrystone || true 330 mcopy -o -i $(DISK_IMAGE) $@ ::/build/dhrystone 331 332 ######################################## 333 ### display application compilation 334 applications/display/appli.elf: build/libs/libuser.a | $(DISK_IMAGE) 335 $(MAKE) -C applications/display 356 336 mmd -o -i $(DISK_IMAGE) ::/build/display || true 357 337 mcopy -o -i $(DISK_IMAGE) $@ ::/build/display 358 338 359 build/display/main.o: applications/display/main.c hard_config.h 360 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 361 362 ######################################## 363 ### router compilation 364 build/router/router.elf: $(ROUTER_OBJS) applications/router/router.ld hard_config.h $(DISK_IMAGE) 365 $(LD) -o $@ -T applications/router/router.ld $(ROUTER_OBJS) 366 $(DU) -D $@ > $@.txt 339 ######################################## 340 ### gameoflife application compilation 341 applications/gameoflife/appli.elf: build/libs/libuser.a | $(DISK_IMAGE) 342 $(MAKE) -C applications/gameoflife 343 mmd -o -i $(DISK_IMAGE) ::/build/gameoflife || true 344 mcopy -o -i $(DISK_IMAGE) $@ ::/build/gameoflife 345 346 ######################################## 347 ### ocean application compilation 348 applications/ocean/appli.elf: build/libs/libmath.a build/libs/libuser.a | $(DISK_IMAGE) 349 $(MAKE) -C applications/ocean 350 mmd -o -i $(DISK_IMAGE) ::/build/ocean || true 351 mcopy -o -i $(DISK_IMAGE) $@ ::/build/ocean 352 353 ######################################## 354 ### router application compilation 355 applications/router/appli.elf: build/libs/libuser.a | $(DISK_IMAGE) 356 $(MAKE) -C applications/router 367 357 mmd -o -i $(DISK_IMAGE) ::/build/router || true 368 358 mcopy -o -i $(DISK_IMAGE) $@ ::/build/router 369 359 370 build/router/main.o: applications/router/main.c hard_config.h 371 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 372 373 ######################################## 374 ### hello compilation 375 build/hello/hello.elf: $(HELLO_OBJS) applications/hello/hello.ld hard_config.h $(DISK_IMAGE) 376 $(LD) -o $@ -T applications/hello/hello.ld $(HELLO_OBJS) 377 $(DU) -D $@ > $@.txt 378 mmd -o -i $(DISK_IMAGE) ::/build/hello || true 379 mcopy -o -i $(DISK_IMAGE) $@ ::/build/hello 380 381 build/hello/main.o: applications/hello/main.c hard_config.h 382 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 383 384 ######################################## 385 ### pgcd compilation 386 build/pgcd/pgcd.elf: $(PGCD_OBJS) applications/pgcd/pgcd.ld hard_config.h $(DISK_IMAGE) 387 $(LD) -o $@ -T applications/pgcd/pgcd.ld $(PGCD_OBJS) 388 $(DU) -D $@ > $@.txt 389 mmd -o -i $(DISK_IMAGE) ::/build/pgcd || true 390 mcopy -o -i $(DISK_IMAGE) $@ ::/build/pgcd 391 392 build/pgcd/main.o: applications/pgcd/main.c hard_config.h 393 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 394 395 ######################################## 396 ### gameoflife compilation 397 build/gameoflife/gameoflife.elf: $(GAMEOFLIFE_OBJS) applications/gameoflife/gameoflife.ld $(DISK_IMAGE) 398 $(LD) -o $@ -T applications/gameoflife/gameoflife.ld $(GAMEOFLIFE_OBJS) 399 $(DU) -D $@ > $@.txt 400 mmd -o -i $(DISK_IMAGE) ::/build/gameoflife || true 401 mcopy -o -i $(DISK_IMAGE) $@ ::/build/gameoflife 402 403 build/gameoflife/main.o: applications/gameoflife/main.c hard_config.h 404 $(CC) $(USER_INCLUDE) $(CFLAGS) -O3 -c -o $@ $< 405 406 ######################################## 407 ### dhrystone compilation 408 build/dhrystone/dhrystone.elf: $(DHRYSTONE_OBJS) applications/dhrystone/dhrystone.ld hard_config.h $(DISK_IMAGE) 409 $(LD) -o $@ -T applications/dhrystone/dhrystone.ld $(DHRYSTONE_OBJS) 410 $(DU) -D $@ > $@.txt 411 mmd -o -i $(DISK_IMAGE) ::/build/dhrystone || true 412 mcopy -o -i $(DISK_IMAGE) $@ ::/build/dhrystone 413 414 build/dhrystone/dhry_1.o: applications/dhrystone/dhry_1.c hard_config.h 415 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 416 417 build/dhrystone/dhry_2.o: applications/dhrystone/dhry_2.c hard_config.h 418 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 419 420 ######################################## 421 ### sort compilation 422 build/sort/sort.elf: $(SORT_OBJS) applications/sort/sort.ld hard_config.h $(DISK_IMAGE) 423 $(LD) -o $@ -T applications/sort/sort.ld $(SORT_OBJS) 424 $(DU) -D $@ > $@.txt 360 ######################################## 361 ### shell application compilation 362 applications/shell/appli.elf: build/libs/libuser.a | $(DISK_IMAGE) 363 $(MAKE) -C applications/shell 364 mmd -o -i $(DISK_IMAGE) ::/build/shell || true 365 mcopy -o -i $(DISK_IMAGE) $@ ::/build/shell 366 367 ######################################## 368 ### sort application compilation 369 applications/sort/appli.elf: build/libs/libuser.a | $(DISK_IMAGE) 370 $(MAKE) -C applications/sort 425 371 mmd -o -i $(DISK_IMAGE) ::/build/sort || true 426 372 mcopy -o -i $(DISK_IMAGE) $@ ::/build/sort 427 373 428 build/sort/main.o: applications/sort/main.c hard_config.h429 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $<430 431 374 ######################################## 432 375 ### transpose compilation 433 build/transpose/transpose.elf: $(TRANSPOSE_OBJS) applications/transpose/transpose.ld hard_config.h $(DISK_IMAGE) 434 $(LD) -o $@ -T applications/transpose/transpose.ld $(TRANSPOSE_OBJS) 435 $(DU) -D $@ > $@.txt 376 applications/transpose/appli.elf: build/libs/libuser.a | $(DISK_IMAGE) 377 $(MAKE) -C applications/transpose 436 378 mmd -o -i $(DISK_IMAGE) ::/build/transpose || true 437 379 mcopy -o -i $(DISK_IMAGE) $@ ::/build/transpose 438 380 439 build/transpose/main.o: applications/transpose/main.c hard_config.h 440 $(CC) $(USER_INCLUDE) $(CFLAGS) -c -o $@ $< 441 442 ######################################## 443 ### convol compilation 444 build/convol/convol.elf: $(CONVOL_OBJS) applications/convol/convol.ld hard_config.h $(DISK_IMAGE) 445 $(LD) -o $@ -T applications/convol/convol.ld $(CONVOL_OBJS) 446 $(DU) -D $@ > $@.txt 447 mmd -o -i $(DISK_IMAGE) ::/build/convol || true 448 mcopy -o -i $(DISK_IMAGE) $@ ::/build/convol 449 450 build/convol/main.o: applications/convol/main.c hard_config.h 451 $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< 452 453 ######################################## 454 ### classif compilation 455 build/classif/classif.elf: $(CLASSIF_OBJS) applications/classif/classif.ld hard_config.h $(DISK_IMAGE) 456 $(LD) -o $@ -T applications/classif/classif.ld $(CLASSIF_OBJS) 457 $(DU) -D $@ > $@.txt 458 mmd -o -i $(DISK_IMAGE) ::/build/classif || true 459 mcopy -o -i $(DISK_IMAGE) $@ ::/build/classif 460 461 build/classif/main.o: applications/classif/main.c hard_config.h 462 $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< 463 464 ######################################## 465 ### coproc compilation 466 build/coproc/coproc.elf: $(COPROC_OBJS) applications/coproc/coproc.ld hard_config.h $(DISK_IMAGE) 467 $(LD) -o $@ -T applications/coproc/coproc.ld $(COPROC_OBJS) 468 $(DU) -D $@ > $@.txt 469 mmd -o -i $(DISK_IMAGE) ::/build/coproc || true 470 mcopy -o -i $(DISK_IMAGE) $@ ::/build/coproc 471 472 build/coproc/main.o: applications/coproc/main.c hard_config.h 473 $(CC) $(USER_INCLUDE) $(CFLAGS) -O0 -c -o $@ $< 474 475 ######################################## 476 ### ocean compilation 477 build/ocean/ocean.elf: applications/ocean/ocean.elf hard_config.h 478 mv $< $@ 479 $(DU) -D $@ > $@.txt 480 mmd -o -i $(DISK_IMAGE) ::/build/ocean || true 481 mcopy -o -i $(DISK_IMAGE) $@ ::/build/ocean 482 483 applications/ocean/ocean.elf: $(OCEAN_OBJS) hard_config.h 484 cd applications/ocean/ && $(MAKE) 485 486 ######################################## 487 ### clean 381 382 383 384 ######################################## 385 ### clean all binary files 488 386 clean: 489 387 rm -f *.o *.elf *.bin *.txt core 490 388 rm -f hard_config.h giet_vsegs.ld map.bin map.xml 491 rm -rf build/ 492 cd applications/ocean && $(MAKE) clean 493 389 rm -rf build/kernel/* 390 rm -rf build/boot/* 391 rm -rf build/libs/* 392 $(MAKE) -C applications/classif clean 393 $(MAKE) -C applications/convol clean 394 $(MAKE) -C applications/coproc clean 395 $(MAKE) -C applications/display clean 396 $(MAKE) -C applications/dhrystone clean 397 $(MAKE) -C applications/gameoflife clean 398 $(MAKE) -C applications/ocean clean 399 $(MAKE) -C applications/router clean 400 $(MAKE) -C applications/shell clean 401 $(MAKE) -C applications/sort clean 402 $(MAKE) -C applications/transpose clean 403 404 ######################################## 405 ### delete disk image 494 406 clean-disk: 495 407 rm -f $(DISK_IMAGE) 408 409 410 -
soft/giet_vm/giet_config.h
r572 r595 31 31 #define GIET_DEBUG_SWITCH 0 /* context switchs */ 32 32 #define GIET_DEBUG_IRQS 0 /* interrupts */ 33 #define GIET_DEBUG_IOC _DRIVER0 /* IOC access: BDV, HBA, SDC, RDK */33 #define GIET_DEBUG_IOC 0 /* IOC access: BDV, HBA, SDC, RDK */ 34 34 #define GIET_DEBUG_TTY_DRIVER 0 /* TTY access */ 35 35 #define GIET_DEBUG_DMA_DRIVER 0 /* DMA access */
Note: See TracChangeset
for help on using the changeset viewer.