9086/cpu/Makefile

40 lines
885 B
Makefile
Raw Normal View History

SOURCES=processor.v testbench.v memory.v registers.v alu.v
INCLUDES=proc_state_def.v
2023-02-08 09:18:00 +00:00
VVP=processor.vvp
.PHONY: brainf
brainf: ${VVP} brainfuck.txt
vvp ${VVP} +BOOT_CODE=brainfuck.txt
2023-02-08 09:18:00 +00:00
.PHONY: run
run: ${VVP} boot_code.txt
2023-02-08 09:18:00 +00:00
vvp ${VVP}
.PHONY: build
build: ${VVP}
.PHONY: wave
wave: ${VVP} brainfuck.txt
vvp ${VVP} -lxt2 +BOOT_CODE=brainfuck.txt
2023-02-08 09:18:00 +00:00
gtkwave test.lx2 gtkwave_savefile.gtkw
${VVP} : ${SOURCES} ${INCLUDES}
iverilog -g2012 ${SOURCES} -o $@
2023-02-08 09:18:00 +00:00
%.txt:%.bin
dd if=/dev/zero bs=1 count=1200 of=$(subst .bin,.stage,$^) status=none
dd if=$^ of=$(subst .bin,.stage,$^) conv=notrunc,nocreat status=none
xxd -ps -c 2 $(subst .bin,.stage,$^) > $@
rm $(subst .bin,.stage,$^)
%.bin:%.asm
as86 -0 $< -b $@
.PHONY: disas
disas: brainfuck.bin
objdump -D -b binary -m i8086 $^
.PHONY: clean
clean:
rm -f ${VVP} test.lx2 boot_code.txt boot_code.bin brainfuck.txt brainfuck.bin