36 lines
767 B
Makefile
36 lines
767 B
Makefile
SOURCES=processor.v testbench.v memory.v registers.v alu.v
|
|
INCLUDES=proc_state_def.v
|
|
VVP=processor.vvp
|
|
|
|
.PHONY: run
|
|
run: ${VVP}
|
|
vvp ${VVP}
|
|
|
|
.PHONY: build
|
|
build: ${VVP}
|
|
|
|
.PHONY: wave
|
|
wave: ${VVP}
|
|
vvp ${VVP} -lxt2
|
|
gtkwave test.lx2 gtkwave_savefile.gtkw
|
|
|
|
${VVP} : ${SOURCES} ${INCLUDES} boot_code.txt
|
|
iverilog -g2012 ${SOURCES} -o $@
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
rm -f ${VVP} test.lx2 boot_code.txt boot_code.bin
|
|
|
|
boot_code.txt:boot_code.bin
|
|
dd if=/dev/zero bs=1 count=256 of=boot_code.stage status=none
|
|
dd if=boot_code.bin of=boot_code.stage conv=notrunc,nocreat status=none
|
|
xxd -ps -c 2 boot_code.stage > boot_code.txt
|
|
rm boot_code.stage
|
|
|
|
boot_code.bin:boot_code.asm
|
|
as86 -0 $< -b $@
|
|
|
|
.PHONY: disas
|
|
disas: boot_code.bin
|
|
objdump -D -b binary -m i8086 boot_code.bin
|