-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmakefile
More file actions
90 lines (62 loc) · 2.51 KB
/
makefile
File metadata and controls
90 lines (62 loc) · 2.51 KB
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
CLASH = clash
topLevel = Main
part = XC6SLX9-TQG144-2
ucfFiles = ..\\vhdl\\extra\\constraints.ucf
srcDir = Z:\\git\\Clash\\examples\\Alu
working = working
# coregen_work_dir ?= ./coregen-tmp
map_opts = -timing -ol high -detail -pr b -register_duplication -w
par_opts = -ol high
isedir = C:\\Xilinx\\14.7\\ISE_DS
xil_env = $(isedir)\\settings64.bat
# flashsize ?= 8192
sshPreCmd = cmd /c Z: & cd $(srcDir)\\$(working) & $(xil_env)
SHELL = /bin/zsh
# test:
# echo '$(addprefix -uc , $(ucfFiles))'
all : $(working)/$(topLevel).bit
junk += $(working)
# Create a project file
$(working)/$(topLevel).prj: vhdl/$(topLevel)/$(topLevel).vhdl Makefile
test -d $(working) || mkdir $(working)
for src in vhdl/$(topLevel)/*.vhdl; do echo "vhdl work ../$$src" >> $(working)/$(topLevel).tmpprj; done
echo "vhdl work ../vhdl/extra/ipcores/clkwiz50.vhd" >> $(working)/$(topLevel).tmpprj
sort -u $(working)/$(topLevel).tmpprj > $(working)/$(topLevel).prj
rm -f $(working)/$(topLevel).tmpprj
# and the xst script file
$(working)/$(topLevel).scr: Makefile
test -d $(working) || mkdir $(working)
echo "run" > $@
echo "-p $(part)" >> $@
echo "-opt_mode area" >> $@
echo "-opt_level 2" >> $@
echo "-top $(topLevel)" >> $@
echo "-ifn $(topLevel).prj" >> $@
echo "-ofn $(topLevel).ngc" >> $@
# echo "-BRAM_UTILIZATION_RATIO -1" >> $@
# create the net list file
$(working)/$(topLevel).ngc: vhdl/$(topLevel)/$(topLevel).vhdl $(working)/$(topLevel).scr $(working)/$(topLevel).prj
echo $(isedir)
ssh administrator@10.211.55.3 '$(sshPreCmd) & xst -ifn $(topLevel).scr'
# Xilinx version of the netlist
$(working)/$(topLevel).ngd: $(working)/$(topLevel).ngc
ssh administrator@10.211.55.3 '$(sshPreCmd) & ngdbuild $(addprefix -uc , $(ucfFiles)) $(topLevel).ngc'
# Map
$(working)/$(topLevel).ncd: $(working)/$(topLevel).ngd
ssh administrator@10.211.55.3 '$(sshPreCmd) & map $(map_opts) $(topLevel).ngd'
#Par
$(working)/$(topLevel)_par.ncd: $(working)/$(topLevel).ncd
ssh administrator@10.211.55.3 '$(sshPreCmd) & par $(par_opts) -w $(topLevel).ncd $(topLevel)_par.ncd'
#Bitgen
$(working)/$(topLevel).bit: $(working)/$(topLevel)_par.ncd
ssh administrator@10.211.55.3 '$(sshPreCmd) & bitgen -g DriveDone:yes -g StartupClk:Cclk -w $(topLevel)_par.ncd $(topLevel).bit'
# Create the VHDL files
vhdl/$(topLevel)/$(topLevel).vhdl : $(topLevel).hs Makefile
rm -rf vhdl/$(topLevel)
clash -odir obj -hidir obj --vhdl $(topLevel)
junk += vhdl/$(topLevel)
junk += obj
interactive :
clash -odir obj -hidir obj --interactive $(topLevel)
clean :
rm -rf $(junk)