-
Notifications
You must be signed in to change notification settings - Fork 86
/
Makefile
83 lines (56 loc) · 2.53 KB
/
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
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
# SPDX-FileCopyrightText: 2024 IObundle
#
# SPDX-License-Identifier: MIT
CORE := iob_soc
SIMULATOR ?= icarus
SYNTHESIZER ?= yosys
BOARD ?= cyclonev_gt_dk
BUILD_DIR ?= $(shell nix-shell --run "py2hwsw $(CORE) print_build_dir")
INIT_MEM ?= 1
USE_EXTMEM ?= 0
ifneq ($(DEBUG),)
EXTRA_ARGS +=--debug_level $(DEBUG)
endif
setup:
nix-shell --run "py2hwsw $(CORE) setup --no_verilog_lint --py_params 'init_mem=$(INIT_MEM):use_extmem=$(USE_EXTMEM)' $(EXTRA_ARGS)"
pc-emul-run:
nix-shell --run "make clean setup && make -C ../$(CORE)_V*/ pc-emul-run"
pc-emul-test:
nix-shell --run "make clean setup && make -C ../$(CORE)_V*/ pc-emul-run"
sim-run:
nix-shell --run "make clean setup INIT_MEM=$(INIT_MEM) USE_EXTMEM=$(USE_EXTMEM) && make -C ../$(CORE)_V*/ sim-run SIMULATOR=$(SIMULATOR)"
sim-test:
nix-shell --run "make clean setup INIT_MEM=1 USE_EXTMEM=0 && make -C ../$(CORE)_V*/ sim-run SIMULATOR=icarus"
nix-shell --run "make clean setup INIT_MEM=0 USE_EXTMEM=0 && make -C ../$(CORE)_V*/ sim-run SIMULATOR=verilator"
nix-shell --run "make clean setup INIT_MEM=0 USE_EXTMEM=1 && make -C ../$(CORE)_V*/ sim-run SIMULATOR=verilator"
fpga-run:
nix-shell --run "make clean setup INIT_MEM=$(INIT_MEM) USE_EXTMEM=$(USE_EXTMEM) && make -C ../$(CORE)_V*/ fpga-fw-build BOARD=$(BOARD)"
make -C ../$(CORE)_V*/ fpga-run BOARD=$(BOARD)
fpga-test:
make clean setup fpga-run BOARD=cyclonev_gt_dk INIT_MEM=1 USE_EXTMEM=0
make clean setup fpga-run BOARD=cyclonev_gt_dk INIT_MEM=0 USE_EXTMEM=1
make clean setup fpga-run BOARD=aes_ku040_db_g INIT_MEM=1 USE_EXTMEM=0
make clean setup fpga-run BOARD=aes_ku040_db_g INIT_MEM=0 USE_EXTMEM=1
syn-build: clean
nix-shell --run "make setup && make -C ../$(CORE)_V*/ syn-build SYNTHESIZER=$(SYNTHESIZER)"
doc-build:
nix-shell --run "make clean setup && make -C ../$(CORE)_V*/ doc-build"
doc-test:
nix-shell --run "make clean setup && make -C ../$(CORE)_V*/ doc-test"
test-all: pc-emul-test sim-test fpga-test doc-test
# Install board server and client
board_server_install:
make -C lib board_server_install
board_server_uninstall:
make -C lib board_server_uninstall
board_server_status:
systemctl status board_server
.PHONY: setup sim-test fpga-test doc-test test-all board_server_install board_server_uninstall board_server_status
clean:
nix-shell --run "py2hwsw $(CORE) clean --build_dir '$(BUILD_DIR)'"
@rm -rf ../*.summary ../*.rpt
@find . -name \*~ -delete
# Remove all __pycache__ folders with python bytecode
python-cache-clean:
find . -name "*__pycache__" -exec rm -rf {} \; -prune
.PHONY: clean python-cache-clean