upsilon/gateware/rtl/control_loop/Makefile

61 lines
2.2 KiB
Makefile
Raw Normal View History

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.
# Makefile for tests and hardware verification.
.PHONY: test clean codegen all
all: test codegen
2022-11-21 21:41:50 -05:00
####### Tests ########
COMMON_CPP = control_loop_math_implementation.cpp
COMMON= ${COMMON_CPP} control_loop_math_implementation.h
control_loop_math_verilog = control_loop_math.v boothmul.v intsat.v sign_extend.v
CONSTS_FRAC=43
E_WID=21
2022-11-21 21:41:50 -05:00
test: obj_dir/Vcontrol_loop_sim_top obj_dir/Vcontrol_loop_math
obj_dir/Vcontrol_loop_math
obj_dir/Vcontrol_loop_sim_top
obj_dir/Vcontrol_loop_math.mk: control_loop_math_sim.cpp ${COMMON} \
${control_loop_math_verilog}
verilator --cc --exe -Wall --trace --trace-fst \
--top-module control_loop_math \
-GCONSTS_FRAC=${CONSTS_FRAC} -DDEBUG_CONTROL_LOOP_MATH \
-CFLAGS -DCONSTS_FRAC=${CONSTS_FRAC} \
-CFLAGS -DE_WID=${E_WID} \
control_loop_math.v control_loop_math_sim.cpp ${COMMON_CPP}
obj_dir/Vcontrol_loop_math: obj_dir/Vcontrol_loop_math.mk
cd obj_dir && make -f Vcontrol_loop_math.mk
2022-11-21 21:41:50 -05:00
obj_dir/Vcontrol_loop_sim_top.mk: control_loop_sim.cpp ${COMMON} \
adc_sim.v dac_sim.v \
../spi/spi_master_ss.v \
../spi/spi_slave_no_write.v \
control_loop_sim_top.v control_loop_sim_top.v \
2023-06-28 17:38:41 -04:00
control_loop.v \
${control_loop_math_verilog}
2022-11-21 21:41:50 -05:00
verilator --cc --exe -Wall --trace --trace-fst \
--top-module control_loop_sim_top \
-GCONSTS_FRAC=${CONSTS_FRAC} \
-CFLAGS -DCONSTS_FRAC=${CONSTS_FRAC} \
-CFLAGS -DE_WID=${E_WID} -I../spi \
control_loop_sim_top.v control_loop.v control_loop_sim.cpp \
${COMMON_CPP} adc_sim.v dac_sim.v ../spi/spi_master_ss.v \
../spi/spi_slave_no_read.v ../spi/spi_slave.v
2023-06-28 17:38:41 -04:00
obj_dir/Vcontrol_loop_sim_top: obj_dir/Vcontrol_loop_sim_top.mk
2022-11-21 21:41:50 -05:00
cd obj_dir && make -f Vcontrol_loop_sim_top.mk
####### Codegen ########
include ../common.makefile
2023-06-28 17:38:41 -04:00
CODEGEN_FILES=boothmul_preprocessed.v control_loop_math.v control_loop.v
2023-03-15 17:08:55 -04:00
codegen: ${CODEGEN_FILES}
clean:
rm -rf obj_dir *.fst ${CODEGEN_FILES}