# Makefile for regression testing the sky simulator.
-
VPATH = @srcdir@
srcdir = @srcdir@
srcroot = $(srcdir)/..
prefix = @prefix@
exec_prefix = @exec_prefix@
+bindir = $(exec_prefix)/bin
host_alias = @host_alias@
target_alias = @target_alias@
fi; \
fi`
+DVPAS_FOR_TARGET = `\
+ if [ -x ${bindir}/dvp-elf-as ]; then \
+ echo ${bindir}/dvp-elf-as ; \
+ else \
+ echo $(target_alias)-as ; \
+ fi`
+
+DVPOBJCP_FOR_TARGET = `\
+ if [ -x ${bindir}/dvp-elf-objcopy ]; then \
+ echo ${bindir}/dvp-elf-objcopy ; \
+ else \
+ echo $(target_alias)-objcopy ; \
+ fi`
AS_FOR_TARGET = `\
if [ -x ../../../gas/as-new ]; then \
echo $(target_alias)-ld ; \
fi`
+
RUNOPTS =
RUN_FOR_TARGET = `\
echo $(target_alias)-gcc ; \
fi`
-C_GEN = /build/sky-tools/c_gen.pl
+C_GEN = perl $(srcdir)/c_gen.pl
+
+# cpu time limit (in seconds)
+ULIMIT = 30
-.SUFFIXES: .trc .c .run .ok .vif0out .vif0ok .vif0expect .vif1out .vif1ok .vif1expect .uu
+.SUFFIXES: .trc .c .run .ok \
+ .vif0out .vif0ok .vif0expect \
+ .vif1out .vif1ok .vif1expect \
+ .vuout .vuok .vuexpect \
+ .uu \
+ .dvpasm .vuasm
TESTS = \
- t-pke1.vif0ok \
- t-pke2.vif1ok \
- t-pke3.ok \
- t-pke4.vif0ok \
- tss08_0.ok \
- tss08_1.ok \
- tss16_0.ok \
- tss16_1.ok \
- tss32_0.ok \
- tss32_1.ok \
- tsv208_0.ok \
- tsv208_1.ok \
- tsv216_0.ok \
- tsv216_1.ok \
- tsv232_0.ok \
- tsv232_1.ok \
- tsv308_0.ok \
- tsv308_1.ok \
- tsv316_0.ok \
- tsv316_1.ok \
- tsv332_0.ok \
- tsv332_1.ok \
- tsv408_0.ok \
- tsv408_1.ok \
- tsv416_0.ok \
- tsv416_1.ok \
- tsv432_0.ok \
- tsv432_1.ok
-
-
-check: sanity
- -$(MAKE) -k $(TESTS)
+ t-dma.ok \
+ t-pke2.vif1ok t-pke3.ok t-pke4.vif0ok \
+ tss08_0.ok tss08_1.ok \
+ tss16_0.ok tss16_1.ok \
+ tss32_0.ok tss32_1.ok \
+ tsv208_0.ok tsv208_1.ok \
+ tsv216_0.ok tsv216_1.ok \
+ tsv232_0.ok tsv232_1.ok \
+ tsv308_0.ok tsv308_1.ok \
+ tsv316_0.ok tsv316_1.ok \
+ tsv332_0.ok tsv332_1.ok \
+ tsv408_0.ok tsv408_1.ok \
+ tsv416_0.ok tsv416_1.ok \
+ tsv432_0.ok tsv432_1.ok \
+ t-cop2.vuok t-cop2b.ok
+
+#SCE_TESTS := $(patsubst %.dvpasm, %.ok, $(wildcard sce*.dvpasm))
+SCE_TESTS = \
+ sce_test1.ok sce_test2.ok sce_test3.ok sce_test4.ok \
+ sce_test5.ok sce_test6.ok sce_test7.ok sce_test8.ok \
+ sce_test9.ok sce_test10.ok sce2_test11.ok sce2_test12.ok \
+ sce_test13.ok sce_test14.ok sce_test15.ok sce_test16.ok \
+ sce_test17.ok sce_test18.ok sce_test19.ok sce_test20.ok \
+ sce_test21.ok sce_test22.ok sce2_test23.ok sce_test24.ok \
+ sce_test25.ok sce_test26.ok sce_test27.ok sce_test28.ok \
+ sce_test29.ok sce_test30.ok sce_test31.ok sce_test32.ok \
+ sce_test33.ok sce_test34.ok sce_test35.ok sce_test36.ok \
+ sce_test37.ok sce_test38.ok sce_test39.ok sce_test40.ok \
+ sce_test41.ok sce_test42.ok sce_test43.ok sce_test44.ok \
+ sce_test45.ok sce_test46.ok sce_test47.ok sce_test48.ok \
+ sce_test49.ok sce_test50.ok sce_test51.ok sce_test52.ok \
+ sce_test53.ok sce_test54.ok sce_test55.ok sce_test56.ok \
+ sce_test57.ok sce_test58.ok sce_test59.ok
+
+check: sanity $(TESTS)
+check_sce: sanity $(SCE_TESTS)
+
sanity:
@eval echo AS_FOR_TARGET = $(AS_FOR_TARGET)
@eval echo LD_FOR_TARGET = $(LD_FOR_TARGET)
@eval echo RUN_FOR_TARGET = $(RUN_FOR_TARGET)
@eval echo GCC_FOR_TARGET = $(GCC_FOR_TARGET)
+ @eval echo DVPAS_FOR_TARGET = $(DVPAS_FOR_TARGET)
+ @eval echo DVPOBJCP_FOR_TARGET = $(DVPOBJCP_FOR_TARGET)
+
+#------------------------------------
+# Rules for building and running the SCE tests :
+#------------------------------------
+
+LDFLAGS=-T$(srcdir)/sky.ld
+CFLAGS += -g -I$(srcdir)
+ASFLAGS = -I$(srcdir)
+
+sce%.exe: sce%.o sce_main.o refresh.o
+ $(GCC_FOR_TARGET) $(CFLAGS) $(LDFLAGS) sce_main.o refresh.o -o $@ $<
+sce_main.o: sce_main.c
+ $(GCC_FOR_TARGET) -c $(CFLAGS) -o $@ $<
-# Rules for running the tests
+refresh.o: refresh.s
+ $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $<
+
+sce_%.o: sce_%.dvpasm sce_%.vuasm
+ $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $<
+
+sce2_%.o: sce2_%.dvpasm sce2_%.vubin
+ $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $<
+
+sce2_%.vubin: sce2_%.vu.o
+ $(DVPOBJCP_FOR_TARGET) -O binary $< $@
+
+sce2_%.vu.o: sce2_%.vuasm
+ $(DVPAS_FOR_TARGET) $(ASFLAGS) -o $@ $<
+
+sce%.ok: sce%.exe
+ rm -f sce$*.ok
+ ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< > sce$*_our_gif.dat; \
+ if [ $$? -ne 0 ]; then \
+ touch sce$*.ok; \
+ else \
+ echo Running sce$*.exe returns $$? > sce$*.ok ;\
+ fi
+
+# else \
+# diff -bitw sce$*_out_dif.dat sce$*_our_gif.dat > sce$*.ok; \
+# fi
+
+#------------------------
+# Rules for running tests
+#------------------------
.run.ok:
rm -f tmp-$* $*.hi
- ulimit -t 30 ; $(RUN_FOR_TARGET) $< > tmp-$*
+ ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< > tmp-$*
mv tmp-$* $*.ok
.run.ko:
rm -f tmp-$* $*.ko
set +e ; \
- ulimit -t 30 ; $(RUN_FOR_TARGET) $< > tmp-$* ; \
+ ulimit -t $(ULIMIT) ; $(RUN_FOR_TARGET) $< > tmp-$* ; \
if [ $$? -ne 0 ] ; then \
exit 0 ; \
else \
.vif1out.vif1ok:
diff $(srcdir)/$*.vif1expect $<
touch $@
+.vuout.vuok:
+ diff $(srcdir)/$*.vuexpect $<
+
-# Rules for building all the tests
+#------------------------------------
+# Rules for building the TESTS
+#------------------------------------
.trc.c:
$(C_GEN) $< $@
.c.run:
- $(GCC_FOR_TARGET) -Tr5900.ld -o $@ $<
+ $(GCC_FOR_TARGET) $(CFLAGS) $(LDFLAGS) -o $@ $<
.uu.run:
uudecode $< > $@
.run.vif0out:
.run.vif1out:
rm -f $@
-env VIF1_TRACE_FILE=$@ $(RUN_FOR_TARGET) $<
-
+.run.vuout:
+ rm -f $@
+ -env SKY_DEBUG=inst_trace $(RUN_FOR_TARGET) $< > $@
+.s.run:
+ rm -f $@
+ $(AS_FOR_TARGET) -mcpu=r5900 -o $@ $<
+.c.s:
+ $(GCC_FOR_TARGET) -S -o $@ $<
#
clean mostlyclean:
-rm -f *~ core *.o a.out *.x *.grt
-rm -f *.vif*out *.ok tmp-*
- rm -f $(TESTS)
+ rm -f $(TESTS)
+ rm -f $(SCE_TESTS) sce*our_gif.dat sce*.exe *.vubin a.raw
# if [ x"${SUBDIRS}" != x ] ; then \
# for dir in ${SUBDIRS}; \
# do \
-rm -f *~ core
-rm -f Makefile config.status *-init.exp
-rm -fr *.log summary detail *.plog *.sum *.psum site.*
+ -rm -f a.raw
# if [ x"${SUBDIRS}" != x ] ; then \
# for dir in ${SUBDIRS}; \
# do \