beepo/tests/adding/Makefile
2023-11-18 03:03:52 -05:00

41 lines
876 B
Makefile

SLAPPER_DIR = ../../slapper
SLAPPER_BUILD = ${SLAPPER_DIR}/target/release/slapper
SLAPPER = ../slapper
HBASM = ../hbasm
SPMEM = ../spmem.v
INPUT_FILE = inputs.txt
BUILD_DEPS = ../../src/beepo.v ../../src/instructions.v adding.v ../../src/uart_tx.v ../../src/multi7.v ../../src/bus.v build/spmem_gen.v
clean:
rm -r build
${SLAPPER_BUILD}:
cargo build --manifest-path ${SLAPPER_DIR}/Cargo.toml -r
${SLAPPER}: ${SLAPPER_BUILD}
cp $< $@
build:
mkdir -p $@
build/program.bin: program.rhai | build
${HBASM} $< > $@
build/spmem_gen.v: build/program.bin ${SLAPPER}
${SLAPPER} $< ${SPMEM} $@
build/out: ${INPUT_FILE} ${BUILD_DEPS} build/spmem_gen.v
iverilog -o $@ -c $< -s tb_adding
build/dump.vcd: build/out
vvp $<
wave: build/dump.vcd
gtkwave build/dump.vcd
assemble: build/program.bin
insert-mem: build/spmem_gen.v
synth: build/out
run: build/dump.vcd