-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathporoto.mak
76 lines (57 loc) · 1.46 KB
/
poroto.mak
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
POROTO_ROOT?=.
ROCCC_ROOT?=/opt/roccc-0.7.6-distribution
TARGET?=ghdl
PARAMS?=
HEADER?=
PROJECT?=project
TEST?=test_vectors.py
WITH_UNISIM?=1
include $(POROTO_ROOT)/platforms/$(TARGET)/$(TARGET).mk
SDK?=''
PLATFORM_VENDOR?=''
PLATFORM?=''
PLATFORM_TARGET?=''
DEVICE_VENDOR?=''
DEVICE?=''
DESIGNER?=''
DESIGNER_VERSION?=''
ifeq ($(WITH_UNISIM),1)
PARAMS+= --unisim
endif
CONFIG+=--sdk $(SDK) --platform-vendor $(PLATFORM_VENDOR) --platform $(PLATFORM) --target $(PLATFORM_TARGET) --device-vendor $(DEVICE_VENDOR) --device $(DEVICE) --design-tool $(DESIGNER) --design-version $(DESIGNER_VERSION)
ifneq ($(DEVICE_FAMILY),)
PARAMS+=--device-family $(DEVICE_FAMILY)
endif
ifneq ($(PACKAGE),)
PARAMS+=--package $(PACKAGE)
endif
ifneq ($(SPEEDGRADE),)
PARAMS+=--speed-grade $(SPEEDGRADE)
endif
ifneq ($(TEST),)
PARAMS+=--tb $(TEST)
endif
export ROCCC_ROOT
export POROTO_ROOT:=$(shell cd $(POROTO_ROOT) && pwd)
export VHDL_FILES
export TIMEOUT
gen:
if [ ! -e $(PROJECT) ]; then $(POROTO_ROOT)/mkproject.py $(CONFIG) $(PROJECT); fi
$(POROTO_ROOT)/poroto.py $(PARAMS) --header "$(HEADER)" --keep-temp --debug $(CONFIG) --project $(PROJECT) $(FILES)
reset:
$(POROTO_ROOT)/scripts/reset_roccc.sh
clean:
rm -rf gen/
if [ -e $(PROJECT) ]; then rm -rf $(PROJECT); fi
ifneq ($(PROJECT),)
compile:
$(MAKE) -C $(PROJECT) compile
run:
$(MAKE) -C $(PROJECT) run
view:
$(MAKE) -C $(PROJECT) view
else
compile run view:
$(error Project not defined)
endif
.PHONY: gen reset compile run view