yayacemu/makefile

31 lines
850 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-15 14:32:48 +00:00
SV_FILES=aastructs.sv cpu.sv chip8.sv gpu.sv alu.sv keypad.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
2024-04-08 06:28:28 +00:00
build: build-rom
2024-04-15 14:32:48 +00:00
verilator --cc --exe --build --timing -j 0 --top-module chip8 *.sv yayacemu.cpp -DDUMMY_KEYPAD -DDUMMY_GPU -DFAST_CLK -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:
2024-04-11 02:59:00 +00:00
rm -rf obj_dir db incremental_db
2024-01-31 01:54:35 +00:00
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
2024-04-15 14:32:48 +00:00
quartus_sh --flow compile chip8 && ./make_cdf.sh && \
notify-send "Quartus Build Complete"
2024-04-08 04:39:15 +00:00
2024-04-08 04:55:54 +00:00
run-fpga:
2024-04-08 04:39:15 +00:00
quartus_pgm -m jtag -o "p;./output_files/chip8.sof" ./output_files/chip8.cdf