-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathMakefile
43 lines (30 loc) · 973 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
all: image check
image: test/make-image.fth forth/asm.fth
echo include $< | forth
kernel: forth/compiler.fth
echo include $< | forth
check: test-asm test-cpu test-verilog test-verilator
test-cpu: image forth/nybble.fth
echo include forth/nybble.fth load $< hex start | forth > $@
grep "FF undefined" $@
test-asm: test/test-asm.fth forth/asm.fth
echo include $< | forth > $@
grep "Assembler test: PASS" $@
nybble: verilog/cpu.v
iverilog -o $@ $^
image.hex: image
hexdump -ve '1/1 "%02x "' < $< > $@
bench: test/cpu_tb.v verilog/cpu.v image.hex
iverilog -Wall -o $@ $<
test-verilog: bench
vvp $< > $@
grep "ff undefined" $@
obj_dir/Vcpu.cpp: verilog/cpu.v test/sim.cpp
verilator -Wall -Wno-fatal --cc --trace $< --top-module cpu --exe test/sim.cpp
obj_dir/Vcpu: obj_dir/Vcpu.cpp
$(MAKE) -C obj_dir -f Vcpu.mk Vcpu
test-verilator: obj_dir/Vcpu image.hex
$< > $@
grep "ff undefined" $@
clean:
rm -rf *.hex *.vcd test-* image nybble bench obj_dir