You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
935 B

  1. DESIGN_NAME := uart_trng
  2. LIB_SRC := ../../lib/rtl_components.vhd ../../lib/sim_components.vhd
  3. RTL_SRC := ../rtl/uart_tx.vhd ../rtl/firo.vhd ../rtl/firo_ctrl.vhd ../rtl/${DESIGN_NAME}.vhd
  4. SIM_SRC := tb_${DESIGN_NAME}.vhd
  5. SIM_FLAGS := --std=08 -fpsl --workdir=work
  6. .PHONY: all compile sim clean
  7. all: sim
  8. compile: tb_${DESIGN_NAME}
  9. tb_${DESIGN_NAME}: ${LIB_SRC} ${RTL_SRC} ${SIM_SRC}
  10. mkdir -p work
  11. @echo "Analyze gatemate library ..."
  12. ghdl -a ${SIM_FLAGS} --work=gatemate ${LIB_SRC}
  13. @echo "Analyze testbench & design ..."
  14. ghdl -a ${SIM_FLAGS} -Pwork ${RTL_SRC} ${SIM_SRC}
  15. @echo "Elaborate testbench & design ..."
  16. ghdl -e ${SIM_FLAGS} -Pwork $@
  17. sim: tb_${DESIGN_NAME}
  18. @echo "Run testbench ..."
  19. ghdl -r ${SIM_FLAGS} -Pwork tb_${DESIGN_NAME} --assert-level=error --wave=tb_${DESIGN_NAME}.ghw
  20. work:
  21. mkdir $@
  22. clean:
  23. @echo "Cleaning simulation files ..."
  24. rm -rf tb_${DESIGN_NAME} tb_${DESIGN_NAME}.ghw *.o work/