Преглед изворни кода

fpga: Add build rules for max files

Samuel Thibault пре 5 година
родитељ
комит
349f8f7124
2 измењених фајлова са 32 додато и 5 уклоњено
  1. 23 1
      tests/Makefile.am
  2. 9 4
      tests/fpga/README.txt

+ 23 - 1
tests/Makefile.am

@@ -1046,7 +1046,8 @@ perfmodels_regression_based_gpu_SOURCES=\
 fpga_max_fpga_SOURCES=\
 	fpga/max_fpga.c
 fpga_max_fpga_LDADD = $(LDADD) \
-	$(srcdir)/fpga/slic_MyTasks.o
+	fpga/slic_MyTasks.o
+fpga/max_fpga.o: fpga/MyTasks.max
 
 if STARPU_USE_OPENCL
 perfmodels_regression_based_memset_SOURCES+=\
@@ -1086,3 +1087,24 @@ starpu_mod.mod: fortran90/starpu_mod.o
 # - list explicit dependences to control proper module files dependencies
 fortran90/init_01.o: starpu_mod.mod
 endif
+
+# Maxeler compiler
+if STARPU_USE_FPGA
+MAX_TARGET = DFE_SIM
+MAX_DFE = MAX5C_$(MAX_TARGET)
+
+MAXJ=$(wildcard fpga/*.maxj)
+CLASS=$(MAXJ:.maxj=.class)
+$(CLASS) &: $(MAXJ)
+	maxjc -1.7 -cp $$MAXCLASSPATH $(dir $<)
+
+%.max: %Manager.class
+	java -XX:+UseSerialGC -Xmx2048m -cp $$MAXCLASSPATH:. $(shell dirname $*).$(notdir $*)Manager DFEModel=MAIA maxFileName=$(notdir $*) target=$(MAX_TARGET)
+	cp $(notdir $*)_$(MAX_DFE)/results/$(notdir $*).{max,h} $(dir $@)
+
+slic_%.o: %.max
+	sliccompile $< $@
+
+CLEANFILES += */*.max */*.class fpga/*.h
+endif
+

+ 9 - 4
tests/fpga/README.txt

@@ -22,12 +22,15 @@ $ module load vivado maxcompiler
 $ module load devtoolset/8
 
 
-To build the JAVA program: (for kernel and Manager (.maxj))
+The Makefiles then build the program automatically. They do the equivalent of
+the following, written here only for information:
+
+Building the JAVA program: (for kernel and Manager (.maxj))
 
 $ cd starpu/tests/
 $ maxjc -1.7 -cp $MAXCLASSPATH fpga
 
-To run the Java program to generate a DFE implementation (a .max file)
+Running the Java program to generate a DFE implementation (a .max file)
 that can be called from a StarPU/FPGA application and slic headers
 (.h) for simulation:
 
@@ -37,11 +40,13 @@ $ cp MyTasks_MAX5C_DFE_SIM/results/*{.max,.h} fpga
 
 $ cd fpga
 
-To build the slic object file (simulation):
+Building the slic object file (simulation):
 
 $ sliccompile MyTasks.max
 
-To start the simulation:
+
+
+Once built, to start the simulation:
 
 $ maxcompilersim -c LIMA -n $USER-MyTasks restart
 $ export LD_LIBRARY_PATH=$MAXELEROSDIR/lib:$LD_LIBRARY_PATH