2022-11-11 22:42:06 -05:00
|
|
|
# Makefile for tests and hardware verification.
|
|
|
|
|
2022-11-13 18:03:55 -05:00
|
|
|
.PHONY: test clean
|
2022-11-11 22:42:06 -05:00
|
|
|
COMMON_CPP = control_loop_math_implementation.cpp
|
|
|
|
COMMON= ${COMMON_CPP} control_loop_math_implementation.h
|
|
|
|
|
2022-11-13 18:03:55 -05:00
|
|
|
CONSTS_FRAC=43
|
2022-11-18 19:27:29 -05:00
|
|
|
E_WID=21
|
2022-11-11 22:42:06 -05:00
|
|
|
|
2022-11-13 18:03:55 -05:00
|
|
|
test: obj_dir/Vcontrol_loop_math
|
|
|
|
obj_dir/Vcontrol_loop_math
|
|
|
|
clean:
|
2022-11-18 19:27:29 -05:00
|
|
|
rm -rf obj_dir *.fst
|
2022-11-11 22:42:06 -05:00
|
|
|
|
2022-11-13 18:03:55 -05:00
|
|
|
obj_dir/Vcontrol_loop_math.mk: control_loop_math_sim.cpp ${COMMON} \
|
|
|
|
control_loop_math.v
|
2022-11-11 22:42:06 -05:00
|
|
|
verilator --cc --exe -Wall --trace --trace-fst \
|
2022-11-13 18:03:55 -05:00
|
|
|
--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-11 22:42:06 -05:00
|
|
|
|