-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
67 lines (51 loc) · 1.45 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
# Ubuntu 20 (or similar)
# apt-get install verilator gtkwave
# Yosys is too old on Ubuntu 20
# build yourself
# Wavedrom: Use pre-built package
# sudo apt-get install libreadline-dev tcl-dev
# sudo apt-get install nodejs npm
# sudo npm install -g netlistsvg
# Run all commands of one make target in the same shell, by default
.ONESHELL:
.PHONY: spinal clean simulate repl sim_repl build blackwire rtl
build: rtl
# CI/CD runs "make test"
test: build sim_receive code_analysis
code_analysis:
grep -rne '.m2sPipe().s2mPipe()' src/main/scala && \
echo "Check reverse use of .s2mPipe().m2sPipe()." || true
# generate Verilog, VHDL and SystemVerilog RTL
# this requires external VHDL modules
blackwire:
blackwire: src/main/scala/blackwire/BlackwireReceive.scala
blackwire: src/main/scala/blackwire/BlackwireReceiveFmax.scala
set -e
sbt " \
runMain blackwire.BlackwireReceive; \
runMain blackwire.BlackwireReceiveFmax; \
"
# generate Verilog, VHDL and SystemVerilog RTL
rtl: src/main/scala/blackwire/BlackwireWireguardType4.scala
set -e
sbt " \
runMain blackwire.BlackwireWireguardType4; \
"
sim_receive:
set -e
sbt " \
runMain blackwire.BlackwireReceiveSim; \
"
clean:
rm -rf simWorkspace *.svg formalWorkdir
%.json: %.ys %.v
set -e
yosys $< -o $@
%.svg: %.json
set -e
netlistsvg $< -o $@
# The paths in .gtkw files are absolute, not very handy
# make them relative
fix_gtkw:
sed -i -e "s@$(PWD)@.@" *.gtkw
sed -i -e "s@./SpinalCorundum@.@" *.gtkw