2023-11-17 12:53:35 -06:00
|
|
|
SLAPPER_DIR = ../../slapper
|
|
|
|
SLAPPER_BUILD = ${SLAPPER_DIR}/target/release/slapper
|
|
|
|
SLAPPER = ../slapper
|
|
|
|
HBASM = ../hbasm
|
|
|
|
SPMEM = ../spmem.v
|
|
|
|
|
|
|
|
INPUT_FILE = inputs.txt
|
2023-11-18 02:03:52 -06:00
|
|
|
BUILD_DEPS = ../../src/beepo.v ../../src/instructions.v adding.v ../../src/uart_tx.v ../../src/multi7.v ../../src/bus.v build/spmem_gen.v
|
2023-11-17 12:53:35 -06:00
|
|
|
|
2023-11-18 02:03:52 -06:00
|
|
|
clean:
|
|
|
|
rm -r build
|
2023-11-17 12:53:35 -06:00
|
|
|
|
|
|
|
${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
|
2023-11-18 02:03:52 -06:00
|
|
|
synth: build/out
|
|
|
|
run: build/dump.vcd
|