forked from antmicro/rowhammer-tester
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
62 lines (46 loc) · 1.69 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
PATH := $(PWD)/venv/bin:$(PATH)
PATH := $(PWD)/bin::$(PATH)
PATH := $(PWD)/third_party/verilator/image/bin:$(PATH)
export PATH
IP_ADDRESS ?= 192.168.100.50
MAC_ADDRESS ?= 0x10e2d5000001
UDP_PORT ?= 1234
ARGS := --ip-address $(IP_ADDRESS) --mac-address $(MAC_ADDRESS) --udp-port $(UDP_PORT)
all:
python gateware/arty.py $(ARGS)
FORCE:
build: FORCE
python gateware/arty.py --build $(ARGS)
sim: FORCE
python gateware/arty.py --build --sim $(ARGS)
sim-analyze: FORCE
python scripts/sim_runner.py python gateware/arty.py --build --sim $(ARGS)
upload up: FORCE
./third_party/xc3sprog/xc3sprog -c nexys4 build/arty/gateware/arty.bit
srv: FORCE
litex_server --udp --udp-ip=192.168.100.50
doc: FORCE
python gateware/arty.py --docs $(ARGS)
python -m sphinx -b html build/documentation build/documentation/html
clean::
rm -rf build scripts/csr.csv analyzer.csv scripts/sdram_init.py
# Deps
deps:: # Intentionally skipping --recursive as not needed (but doesn't break anything either)
git submodule update --init
(make --no-print-directory -C . \
third_party/verilator/image/bin/verilator \
third_party/xc3sprog/xc3sprog \
python-deps)
python-deps: venv/bin/activate
pip install -r requirements.txt
venv/bin/activate:
python3 -m venv venv
third_party/verilator/image/bin/verilator: third_party/verilator/configure.ac
(cd third_party/verilator && autoconf && \
./configure --prefix=$(PWD)/third_party/verilator/image && \
make -j`nproc` && make install) && touch $@
third_party/xc3sprog/xc3sprog: third_party/xc3sprog/CMakeLists.txt
(cd third_party/xc3sprog && patch -Np1 < ../xc3sprog.patch && \
cmake . && make -j`nproc`)
env: venv/bin/activate
@env bash --init-file "$(PWD)/venv/bin/activate"