yayacemu/makefile

30 lines
746 B
Makefile
Raw Normal View History

2024-02-01 03:04:52 +00:00
.PHONY: run clean format
2024-01-31 01:54:35 +00:00
SDL_CFLAGS = `sdl2-config --cflags`
SDL_LDFLAGS = `sdl2-config --libs`
2024-04-08 04:39:15 +00:00
SV_FILES=cpu.sv chip8.sv gpu.sv
2024-01-31 01:54:35 +00:00
lint:
2024-04-08 04:39:15 +00:00
verilator --lint-only -DDUMMY_GPU --timing ${SV_FILES}
2024-01-31 01:54:35 +00:00
2024-04-08 04:39:15 +00:00
build-rom:
python3 ./gen_rom.py ${ROM_FILE} rom.bin
build: lint build-rom
verilator --cc --exe --build --timing -j 0 --top-module chip8 *.sv yayacemu.cpp -DDUMMY_GPU -CFLAGS "${SDL_CFLAGS}" -LDFLAGS "${SDL_LDFLAGS}" && clear
2024-01-31 01:54:35 +00:00
run: build
2024-04-08 04:39:15 +00:00
obj_dir/Vchip8
2024-01-31 01:54:35 +00:00
clean:
rm -rf obj_dir
2024-02-01 03:04:52 +00:00
format:
verible-verilog-format *.sv --inplace && clang-format *.cpp -i
2024-04-08 04:39:15 +00:00
build-fpga: *.sv *.qsf *.qpf rom.bin build-rom
quartus_sh --flow compile chip8 && ./make_cdf.sh
run-fpga: build-fpga
quartus_pgm -m jtag -o "p;./output_files/chip8.sof" ./output_files/chip8.cdf