-
Notifications
You must be signed in to change notification settings - Fork 0
/
SlowFPGA.make
61 lines (46 loc) · 1.66 KB
/
SlowFPGA.make
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
# Top-level design name
SYSTEM = slow_top
LIST_FILE = $(SYSTEM).lst
SCR_FILE = $(TOP)/syn/xilinx/$(SYSTEM).scr
UCF_FILE = $(TOP)/syn/constr/$(SYSTEM).ucf
POSTSYN_NETLIST = $(SYSTEM).ngc
NGD_FILE = $(SYSTEM).ngd
MAPPED_NCD_FILE = $(SYSTEM)_map.ncd
ROUTED_NCD_FILE = $(SYSTEM).ncd
PCF_FILE = $(SYSTEM).pcf
TWX_FILE = $(SYSTEM).twx
BIT_FILE = $(SYSTEM).bit
BIN_FILE = $(SYSTEM).bin
VERSION_FILE = slow_version.vhd
# Print the names of unlocked (unconstrainted) IOs
export XIL_PAR_DESIGN_CHECK_VERBOSE=1
bin: $(BIN_FILE)
.PHONY: bin
# We have to take a bit of care when building the list file: it turns out that
# xst can't cope with long file names.
$(LIST_FILE): $(TOP)/syn/xilinx/slow_top.files
cp $< $@
src_dir :
ln -sfn $(TOP)/src/hdl $@
MAP_FLAGS = -detail -w -ol high -pr b
PAR_FLAGS = -w -ol high
TRCE_FLAGS = -e 3 -l 3
$(BIT_FILE): $(VERSION_FILE) $(LIST_FILE) src_dir
xst -ifn $(SCR_FILE)
ngdbuild -uc $(UCF_FILE) $(POSTSYN_NETLIST)
map $(MAP_FLAGS) $(NGD_FILE) -o $(MAPPED_NCD_FILE) $(PCF_FILE)
par $(PAR_FLAGS) $(MAPPED_NCD_FILE) $(ROUTED_NCD_FILE) $(PCF_FILE)
trce $(TRCE_FLAGS) $(ROUTED_NCD_FILE) $(PCF_FILE) -xml $(TWX_FILE)
bitgen -w $(ROUTED_NCD_FILE)
$(BIN_FILE): $(BIT_FILE)
promgen -w -p bin -u 0 $<
#####################################################################
# Create VERSION_FILE
$(VERSION_FILE) : $(VER)
rm -f $(VERSION_FILE)
echo 'library ieee;' >> $(VERSION_FILE)
echo 'use ieee.std_logic_1164.all;' >> $(VERSION_FILE)
echo 'package slow_version is' >> $(VERSION_FILE)
echo -n 'constant SLOW_FPGA_VERSION: std_logic_vector(31 downto 0)' >> $(VERSION_FILE)
echo ' := X"$(SHA)";' >> $(VERSION_FILE)
echo 'end slow_version;' >> $(VERSION_FILE)