2023-06-15 12:24:35 -04:00
|
|
|
# Copyright 2023 (C) Peter McGoron
|
|
|
|
# This file is a part of Upsilon, a free and open source software project.
|
|
|
|
# For license terms, refer to the files in `doc/copying` in the Upsilon
|
|
|
|
# source distribution.
|
2023-03-14 11:42:41 -04:00
|
|
|
# Makefile for tests and hardware verification.
|
|
|
|
|
2023-03-15 14:47:20 -04:00
|
|
|
.PHONY: test clean codegen
|
2023-05-10 14:35:57 -04:00
|
|
|
include ../common.makefile
|
2023-03-14 11:42:41 -04:00
|
|
|
|
2023-03-15 14:47:20 -04:00
|
|
|
all: test codegen
|
2023-03-14 11:42:41 -04:00
|
|
|
test: obj_dir/Vspi_switch
|
|
|
|
|
2023-03-15 17:08:55 -04:00
|
|
|
CODEGEN_FILES= spi_master_ss_preprocessed.v spi_master_preprocessed.v \
|
|
|
|
spi_master_no_write_preprocessed.v \
|
|
|
|
spi_master_no_read_preprocessed.v \
|
|
|
|
spi_master_ss_no_read_preprocessed.v \
|
|
|
|
spi_master_ss_no_write_preprocessed.v spi_switch_preprocessed.v
|
2023-03-15 14:47:20 -04:00
|
|
|
|
2023-03-15 17:08:55 -04:00
|
|
|
codegen: ${CODEGEN_FILES}
|
2023-03-15 14:47:20 -04:00
|
|
|
|
2023-03-14 11:42:41 -04:00
|
|
|
SRC= spi_switch.v spi_switch_sim.cpp
|
|
|
|
obj_dir/Vspi_switch.mk: $(SRC)
|
|
|
|
verilator --cc --exe -Wall \
|
|
|
|
$(SRC)
|
|
|
|
obj_dir/Vspi_switch: obj_dir/Vspi_switch.mk $(SRC)
|
|
|
|
cd obj_dir && make -f Vspi_switch.mk
|
|
|
|
./obj_dir/Vspi_switch
|
|
|
|
|
|
|
|
clean:
|
2023-03-15 17:08:55 -04:00
|
|
|
rm -rf obj_dir/ ${CODEGEN_FILES}
|