forked from merledu/picofoxy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
27 lines (17 loc) · 961 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
current_dir = $(shell pwd)
picofoxy: clean rtl cleanup initmem
rtl:
sbt "runMain PicofoxyDriver"
relocate: Picofoxy.v PLL_8MHz.v clk_wiz_0_clk_wiz.v
mv -t fpga/ Picofoxy.v PLL_8MHz.v clk_wiz_0_clk_wiz.v
cleanup: relocate
rm -f firrtl_black_box_resource_files.f Picofoxy.fir Picofoxy.anno.json
initmem:
sed -i '270i\initial begin \n $$readmemh("$(current_dir)/fpga/program.mem", mem); \n end' fpga/Picofoxy.v
clean:
rm -rf $(current_dir)/fpga/build/
rm -rf $(current_dir)/fpga/Picofoxy.v $(current_dir)/fpga/PLL_8MHz.v $(current_dir)/fpga/clk_wiz_0_clk_wiz.v
bitstream: $(current_dir)/fpga/Picofoxy.v $(current_dir)/fpga/PLL_8MHz.v $(current_dir)/fpga/clk_wiz_0_clk_wiz.v
TARGET="arty_35" $(MAKE) -C fpga
upload: $(current_dir)/fpga/build/arty_35/Picofoxy.bit
openocd -f ${INSTALL_DIR}/${FPGA_FAM}/conda/envs/${FPGA_FAM}/share/openocd/scripts/board/digilent_arty.cfg -c "init; pld load 0 $(current_dir)/fpga/build/arty_35/Picofoxy.bit; exit"