Core: remove use of blocking assignments (XST can't deal)
[yari.git] / testcases / Makefile
blob3a8fa49b7dc3b4780ff70eee56c3b64ac29efd58
1 #mips-elf-gcc -Tmymips.ld -msoft-float $< -o $@
3 HEAD=# | head -2048
4 SIM=../yarisim/sim
5 OBJDUMP_FLAGS=-S -D -M reg-names=numeric
6 TINYMON=../firmware/tinymon-prom
7 PROG=regress/nor
8 VERB=--verb
10 all: regress-test
12 perfcounters.h: ../rtl/yari-core/perfcounters.v Makefile
13 sed -e 's/`def/#def/' < $< > $@
14 (echo;echo 'char *__perf_counter_names[] = {') >> $@
15 (sed -e 's/`define PERF_/"/' -e 's/ .*$$/",/' |tr "_A-Z" " a-z") < $< >> $@
16 echo '};' >> $@
17 echo "#define __FORALL_PERF_COUNTERS(F) \\" >> $@
18 sed -e 's/`define /F(/' -e 's/ .*$$/) \\/' < $< >> $@
19 echo >> $@
21 regress-test:
22 @for t in regress/*.c; do \
23 /bin/echo -n $$(basename $$t .c)': '; \
24 if make cosim VERB= PROG=regress/$$(basename $$t .c) 2> /dev/null | grep -q 'TEST SUCCESS'; \
25 then echo PASS; else echo FAIL; fi; done
27 regress-isasim:
28 @for t in regress/*.c; do \
29 /bin/echo $$(basename $$t .c); \
30 make isasim VERB= PROG=regress/$$(basename $$t .c); \
31 done
33 working: hw.txt sieve.txt fib.txt lievaart2.txt
35 # testall.data testicache.data testeret-prom.data \
36 # gdbstub-prom.data showtime.mips letters.mips sramtester.mips
38 broken: stalls.mif \
39 fail.mips test0.data test1.data testlwsw.data sieve.data sieve.mif \
40 serialout_nowait.mif muldiv.mif # monitor.mif tests.data
42 try0: test0.mips $(SIM)
43 $(SIM) --elf --simple --verb test0.mips
45 #%.o: %.c
46 # mips-elf-gcc -msoft-float -Tmymips.ld -g -O $< -o $@
48 promote: $(PROG)-prom.data $(PROG)-prom.mif
49 cp $(PROG)-prom.data ../rtl/initmem.data
50 cp $(PROG)-prom.mif ../rtl/initmem.mif
52 gdbstub-prom.mips: ../gdbstub/gdbstub.mips
53 cp ../gdbstub/gdbstub.mips gdbstub-prom.mips
55 %-prom.mips: %.o
56 mips-elf-ld -Tprom.ld $< -o $@
58 %-prom.data: %-prom.mips %-prom.mif $(SIM)
59 $(SIM) --data $< > $@
61 bootloader.mips: bootloader.o
62 mips-elf-ld -Tprom.ld $< -o $@
63 -mips-elf-objdump $(OBJDUMP_FLAGS) $@ > $(basename $@).dis
64 mips-elf-nm $@ | sort > $(basename $@).nm
66 bootloader.data: bootloader.mips $(SIM)
67 $(SIM) --data $< > $@
69 spinscreen.mips: spinscreen.o
70 mips-elf-ld -Tprom.ld $< -o $@
71 -mips-elf-objdump $(OBJDUMP_FLAGS) $@ > $(basename $@).dis
73 sramtester.mips: sramtester.o
74 mips-elf-ld -Tsram.ld $< -o $@
75 -mips-elf-objdump $(OBJDUMP_FLAGS) $@ > $(basename $@).dis
77 spinscreen.data: spinscreen.mips $(SIM)
78 $(SIM) --data $< > $@
80 testall.mips: testall.o
81 mips-elf-ld -Tsram.ld testall.o -o $@
83 testall-prom.mips: testall.o
84 mips-elf-ld -Tprom.ld $< -o $@
86 testall-prom.data: testall-prom.mips $(SIM)
87 $(SIM) --data $< > $@
89 testicache.mips: testicache.o
90 mips-elf-ld -Tsram.ld testicache.o -o $@
92 testicache-prom.mips: testicache.o
93 mips-elf-ld -Tprom.ld $< -o $@
95 testicache-prom.data: testicache-prom.mips $(SIM)
96 $(SIM) --data $< > $@
98 # cpp $< > $(basename $<).s DON'T DO THIS!!! IT BREAKS TERRIBLY WHEN THE DIRECTORY IS SMB :-(
99 %.o: %.S
100 gcc -E $< > $(basename $<)._s
101 mips-elf-as $(basename $<)._s -o $@
103 # I think this might be causing trouble because the files are on a samba file system
104 #%.o: %.s
105 # mips-elf-as $< -o $@
107 %.o: %.c stdio.h perfcounters.h
108 mips-elf-gcc -fno-builtin -I. -DSTANDALONE -msoft-float -g -O -c $< -o $@
110 .PRECIOUS: %.dis %.mips %.data %.mif
112 %.dis: %.mips
113 -mips-elf-objdump $(OBJDUMP_FLAGS) $< > $@
115 crt0.o: crt0.S
117 %.mips: %.o Makefile random.o crt0.o
118 mips-elf-ld -Tsram.ld crt0.o random.o $< -o $@
119 -mips-elf-objdump -d -M reg-names=numeric $@ > $(basename $@).dis
120 -mips-elf-nm $@ | sort > $(basename $@).nm
122 %.mif: %.mips $(SIM)
123 -$(SIM) --mif $< > $@
125 %.data: %.mips $(SIM)
126 -$(SIM) --data $< $(HEAD) > $@
128 #%.data: %.mips %.dis %.mif bootloader.data
129 # -$(SIM) --data $< $(HEAD) > $@
131 show: test0.mips
132 mips-elf-objdump -D test0.mips
134 muldiv.mips: muldiv.c
135 mips-elf-gcc -DSTANDALONE -msoft-float -O -c muldiv.c
136 mips-elf-ld -Tstandalone.ld muldiv.o -o muldiv.mips
138 hello.mips: hello.c
139 mips-elf-gcc -DSTANDALONE -msoft-float -O -c hello.c
140 mips-elf-ld -Tstandalone.ld hello.o -o hello.mips
142 hello2.mips: hello2.c
143 mips-elf-gcc -DSTANDALONE -msoft-float -O -c hello2.c
144 mips-elf-ld -Tstandalone.ld hello2.o -o hello2.mips
146 testshifts.mips: testshifts.c
147 mips-elf-gcc -DSTANDALONE -msoft-float -O -c testshifts.c
148 mips-elf-ld -Tstandalone.ld testshifts.o -o testshifts.mips
150 stalls.mips: stalls.c
151 mips-elf-gcc -DSTANDALONE -msoft-float -O -c stalls.c
152 mips-elf-ld -Tstandalone.ld stalls.o -o stalls.mips
154 testvga.mips: testvga.c
155 mips-elf-gcc -DSTANDALONE -msoft-float -O -c testvga.c
156 mips-elf-ld -Tstandalone.ld testvga.o -o testvga.mips
158 testifsram.mips: testifsram.c
159 mips-elf-gcc -DSTANDALONE -msoft-float -O -c testifsram.c
160 mips-elf-ld -Tstandalone.ld testifsram.o -o testifsram.mips
162 sermon.mips: sermon.c
163 mips-elf-gcc -DSTANDALONE -msoft-float -O -c sermon.c
164 mips-elf-ld -Tstandalone.ld sermon.o -o sermon.mips
166 #memorytester.mips: memorytester.c
167 # mips-elf-gcc -DSTANDALONE -msoft-float -O -c memorytester.c
168 # mips-elf-ld -Tstandalone.ld memorytester.o -o memorytester.mips
170 #$(SIM) --simp sieve.mips
171 #make sieve.data
172 #$(SIM) --simp --verb sieve.mips > sieve.trace
174 %.txt: %.mips $(SIM)
175 $(SIM) --tiny $< > $@
177 hw2.mips: hw2.S
178 mips-elf-gcc -DSTANDALONE -msoft-float -O -c hw2.S
179 mips-elf-ld -Tsram.ld hw2.o -o hw2.mips
181 rtlsim: $(PROG).txt $(PROG).data $(TINYMON).data
182 egrep -A99999 '^e4[0-9a-f]+ [0-9a-f][0-9a-f]' $< > ../rtl/target/Icarus/input.txt
183 make -C ../rtl/target/Icarus TESTPROG=../$(TINYMON).data SRAM_INIT=../../../testcases/$(PROG) simulate
185 isasim: $(PROG).txt $(SIM) $(TINYMON).mips
186 egrep -A99999 '^e4[0-9a-f]+ [0-9a-f][0-9a-f]' $< > input.txt
187 make -C ../yarisim FLAGS="-i ../testcases/input.txt "$(VERB) FIRMWARE=$(TINYMON).mips TESTPROG=../testcases/$(PROG).mips run
189 cosim: $(PROG).txt $(PROG).data $(SIM) $(TINYMON).mips $(TINYMON).data
190 egrep -A99999 '^e4[0-9a-f]+ [0-9a-f][0-9a-f]' $< > ../rtl/target/Icarus/input.txt
191 egrep -A99999 '^e4[0-9a-f]+ [0-9a-f][0-9a-f]' $< > input.txt
192 make -C ../rtl/target/Icarus TESTPROG=../$(TINYMON).data SRAM_INIT=../../../testcases/$(PROG) simulate | \
193 make -C ../yarisim FLAGS="-i ../testcases/input.txt --cosim $(VERB)" FIRMWARE=$(TINYMON).mips TESTPROG=../testcases/$(PROG).mips run
195 # "FULL" here means including the loading of the program over the serial port -- a slow affair
196 rtlsim_full: $(PROG).txt $(TINYMON).data
197 cp $< ../rtl/target/Icarus/input.txt
198 make -C ../rtl/target/Icarus TESTPROG=../$(TINYMON).data simulate
200 isasim_full: $(PROG).txt $(TINYMON).mips
201 make -C ../yarisim \
202 FLAGS="-i ../testcases/$(PROG).txt "$(VERB) \
203 FIRMWARE=$(TINYMON).mips \
204 TESTPROG=../testcases/$(PROG).mips \
207 cosim_full: $(PROG).txt $(PROG).data $(SIM) $(TINYMON).mips $(TINYMON).data
208 cp $< ../rtl/target/Icarus/input.txt
209 make -C ../rtl/target/Icarus TESTPROG=../$(TINYMON).data SRAM_INIT=../../../testcases/$(PROG) simulate | \
210 make -C ../yarisim \
211 FLAGS="--cosim $(VERB)" \
212 FIRMWARE=$(TINYMON).mips \
213 TESTPROG=../testcases/$(PROG).mips \
219 $(SIM):
220 make -C ../yarisim
222 $(TINYMON).mips:
223 make -C ../firmware
225 $(TINYMON).data:
226 make -C ../firmware
228 clean:
229 -rm *.o *._s *.mips *.txt *.dis *.nm
231 realclean: clean
232 -rm *~ a.out *.mif *.data *.s