-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathMakefile
More file actions
73 lines (51 loc) · 1.99 KB
/
Makefile
File metadata and controls
73 lines (51 loc) · 1.99 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
# Copyright and related rights are licensed under the Solderpad Hardware
# License, Version 0.51 (the "License"); you may not use this file except in
# compliance with the License. You may obtain a copy of the License at
# http://solderpad.org/licenses/SHL-0.51. Unless required by applicable law
# or agreed to in writing, software, hardware and materials distributed under
# this License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.
#
# Authors:
# - Thomas Benz <tbenz@iis.ee.ethz.ch>
# select IIS-internal tool commands if we run on IIS machines
ifneq (,$(wildcard /etc/iis.version))
VSIM ?= questa-2022.3 vsim
SYNOPSYS_DC ?= synopsys-2022.03 dcnxt_shell
else
VSIM ?= vsim
SYNOPSYS_DC ?= dc_shell
endif
TBS ?= ace_ccu_top \
ace_ccu_top_sanity
SIM_TARGETS := $(addsuffix .log,$(addprefix sim-,$(TBS)))
.SHELL: bash
.PHONY: help all sim_all clean
help:
@echo ""
@echo "elab.log: elaborates all files using Synopsys DC"
@echo "compile.log: compile files using Questasim"
@echo "sim-#TB#.log: simulates a given testbench, available TBs are:"
@echo "$(addprefix ###############-#,$(TBS))" | sed -e 's/ /\n/g' | sed -e 's/#/ /g'
@echo "sim_all: simulates all available testbenches"
@echo ""
@echo "clean: cleans generated files"
@echo ""
all: compile.log elab.log sim_all
sim_all: $(SIM_TARGETS)
build:
mkdir -p $@
elab.log: Bender.yml | build
export SYNOPSYS_DC="$(SYNOPSYS_DC)"; cd build && ../scripts/synth.sh | tee ../$@
(! grep -n "Error:" $@)
compile.log: Bender.yml | build
export VSIM="$(VSIM)"; cd build && ../scripts/compile_vsim.sh | tee ../$@
(! grep -n "Error:" $@)
sim-%.log: compile.log
export VSIM="$(VSIM)"; cd build && ../scripts/run_vsim.sh --random-seed $* | tee ../$@
(! grep -n "Error:" $@)
(! grep -n "Fatal:" $@)
clean:
rm -rf build
rm -f *.log