forked from adam-maj/tiny-gpu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
74 lines (57 loc) · 2.35 KB
/
Copy pathMakefile
File metadata and controls
74 lines (57 loc) · 2.35 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
.PHONY: compile test_matadd test_matmul test_priority test_sidebyside test_parallel test_sequential
export LIBPYTHON_LOC=$(shell cocotb-config --libpython)
PYGPI_PYTHON_BIN?=$(shell which python)
test_matadd: compile
PYGPI_PYTHON_BIN=$(shell which python) \
PYTHONPATH=. \
COCOTB_TEST_MODULES=test.test_matadd \
vvp -M $(shell cocotb-config --lib-dir) -m $(shell cocotb-config --lib-name vpi icarus) build/sim.vvp
test_matmul: compile
PYGPI_PYTHON_BIN=$(shell which python) \
PYTHONPATH=. \
COCOTB_TEST_MODULES=test.test_matmul \
vvp -M $(shell cocotb-config --lib-dir) -m $(shell cocotb-config --lib-name vpi icarus) build/sim.vvp
test_priority: compile
PYGPI_PYTHON_BIN=$(shell which python) \
PYTHONPATH=. \
COCOTB_TEST_MODULES=test.test_priority \
vvp -M $(shell cocotb-config --lib-dir) -m $(shell cocotb-config --lib-name vpi icarus) build/sim.vvp
test_sidebyside: compile
PYGPI_PYTHON_BIN=$(shell which python) \
PYTHONPATH=. \
COCOTB_TEST_MODULES=test.test_sidebyside \
vvp -M $(shell cocotb-config --lib-dir) -m $(shell cocotb-config --lib-name vpi icarus) build/sim.vvp
test_parallel: compile
PYGPI_PYTHON_BIN=$(shell which python) \
PYTHONPATH=. \
COCOTB_TEST_MODULES=test.test_parallel \
vvp -M $(shell cocotb-config --lib-dir) -m $(shell cocotb-config --lib-name vpi icarus) build/sim.vvp
test_sequential: compile
PYGPI_PYTHON_BIN=$(shell which python) \
PYTHONPATH=. \
COCOTB_TEST_MODULES=test.test_sequential \
vvp -M $(shell cocotb-config --lib-dir) -m $(shell cocotb-config --lib-name vpi icarus) build/sim.vvp
test_blockorder: compile
PYGPI_PYTHON_BIN=$(shell which python) \
PYTHONPATH=. \
COCOTB_TEST_MODULES=test.test_blockorder \
vvp -M $(shell cocotb-config --lib-dir) -m $(shell cocotb-config --lib-name vpi icarus) build/sim.vvp
test_contextswitch: compile
PYGPI_PYTHON_BIN=$(shell which python) \
PYTHONPATH=. \
COCOTB_TEST_MODULES=test.test_contextswitch \
vvp -M $(shell cocotb-config --lib-dir) -m $(shell cocotb-config --lib-name vpi icarus) build/sim.vvp
compile:
sv2v -I src -w build/gpu.v src/*.sv
echo '`timescale 1ns/1ns' > build/temp.v
cat build/gpu.v >> build/temp.v
mv build/temp.v build/gpu.v
iverilog -g2012 -DCOCOTB_SIM -o build/sim.vvp build/gpu.v
show_waves:
@mkdir -p build
gtkwave build/waveform.vcd
compile_%:
sv2v -w build/$*.v src/$*.sv
# TODO: Get gtkwave visualizaiton
show_%: %.vcd %.gtkw
gtkwave $^