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.

28 lines
682 B

  1. DESIGN := risc_v
  2. DESIGN_SRC := risc_v_pkg.vhd risc_v.vhd
  3. TESTBENCH := tb_${DESIGN}
  4. DEFAULT: sim
  5. ${TESTBENCH} : ${DESIGN_SRC} ${TESTBENCH}.vhd
  6. ghdl -a --std=08 ${DESIGN_SRC} ${TESTBENCH}.vhd
  7. ghdl -e --std=08 ${TESTBENCH}
  8. .PHONY: sim
  9. sim: ${TESTBENCH}.ghw
  10. ${TESTBENCH}.ghw: ${TESTBENCH}
  11. ghdl -r --std=08 ${TESTBENCH} --ieee-asserts=disable-at-0 --vcd=${TESTBENCH}.vcd --wave=$@
  12. .PHONY: syn
  13. syn: $(DESIGN).json
  14. $(DESIGN).o: $(DESIGN_SRC)
  15. ghdl -a --std=08 $(DESIGN_SRC)
  16. $(DESIGN).json: $(DESIGN).o
  17. yosys -m ghdl -p 'ghdl --std=08 --no-formal ${DESIGN}; synth_ice40 -json $@'
  18. .PHONY: clean
  19. clean:
  20. rm -f ${TESTBENCH} ${TESTBENCH}.ghw ${TESTBENCH}.vcd work* *.o *.json