manta/Makefile

139 lines
3.5 KiB
Makefile
Raw Normal View History

build:
python3 -m build
pypi_upload: build
python3 -m twine upload --repository testpypi dist/*
lint:
python3 -m black src/manta/__init__.py
python3 -m black src/manta/__main__.py
serve_docs:
mkdocs serve
2023-04-28 05:13:51 +02:00
src_loc:
find src -type f \( -iname \*.sv -o -iname \*.v -o -iname \*.py -o -iname \*.yaml -o -iname \*.md \) | sed 's/.*/"&"/' | xargs wc -l
total_loc:
find . -type f \( -iname \*.sv -o -iname \*.v -o -iname \*.py -o -iname \*.yaml -o -iname \*.yml -o -iname \*.md \) | sed 's/.*/"&"/' | xargs wc -l
real_loc:
2023-04-03 02:33:50 +02:00
find src test -type f \( -iname \*.sv -o -iname \*.v -o -iname \*.py -o -iname \*.yaml -o -iname \*.md \) | sed 's/.*/"&"/' | xargs wc -l
2023-04-03 02:33:50 +02:00
test: auto_gen functional_sim
clean:
rm -f *.out *.vcd
rm -rf dist/
rm -rf src/mantaray.egg-info
# API Generation Tests
auto_gen:
2023-04-03 02:33:50 +02:00
python3 test/auto_gen/run_tests.py
# Functional Simulation
2023-04-28 20:54:20 +02:00
functional_sim: io_core_tb logic_analyzer_tb bridge_rx_tb bridge_tx_tb lut_mem_tb
2023-04-28 05:13:51 +02:00
ethernet_tx_tb:
iverilog -g2012 -o sim.out -y src/manta/ether_iface test/functional_sim/ethernet_tx_tb.sv
vvp sim.out
rm sim.out
2023-04-27 19:10:15 +02:00
ethernet_rx_tb:
iverilog -g2012 -o sim.out -y src/manta/ether_iface test/functional_sim/ethernet_rx_tb.sv
vvp sim.out
rm sim.out
mac_tb:
iverilog -g2012 -o sim.out -y src/manta test/functional_sim/mac_tb.sv
vvp sim.out
rm sim.out
block_memory_tb:
iverilog -g2012 -o sim.out -y src/manta test/functional_sim/block_memory_tb.sv
2023-04-10 20:38:29 +02:00
vvp sim.out
rm sim.out
io_core_tb:
iverilog -g2012 -o sim.out -y src/manta \
test/functional_sim/io_core_tb/io_core_tb.sv \
test/functional_sim/io_core_tb/io_core.v
vvp sim.out
rm sim.out
2023-03-15 20:57:42 +01:00
logic_analyzer_tb:
cd test/functional_sim/logic_analyzer_tb; \
manta gen manta.yaml manta.v; \
iverilog -g2012 -o sim.out logic_analyzer_tb.sv manta.v; \
vvp sim.out; \
2023-03-15 20:57:42 +01:00
rm sim.out
bridge_rx_tb:
2023-04-28 20:54:20 +02:00
iverilog -g2012 -o sim.out -y src/manta/uart_iface test/functional_sim/bridge_rx_tb.sv
vvp sim.out
rm sim.out
2023-03-15 20:57:42 +01:00
bridge_tx_tb:
2023-04-28 20:54:20 +02:00
iverilog -g2012 -o sim.out -y src/manta/uart_iface test/functional_sim/bridge_tx_tb.sv
vvp sim.out
rm sim.out
lut_mem_tb:
2023-04-28 06:20:27 +02:00
iverilog -g2012 -o sim.out -y src/manta/lut_mem_core test/functional_sim/lut_mem_tb.sv
vvp sim.out
rm sim.out
# Build Examples
examples: icestick nexys_a7
nexys_a7: nexys_a7_video_sprite nexys_a7_io_core nexys_a7_ps2_logic_analyzer nexys_a7_lut_mem
2023-04-14 00:00:22 +02:00
nexys_a7_video_sprite:
cd examples/nexys_a7/video_sprite; \
manta gen manta.yaml src/manta.v; \
2023-04-26 18:54:13 +02:00
build
nexys_a7_io_core:
cd examples/nexys_a7/io_core/; \
2023-04-26 18:54:13 +02:00
manta gen manta.yaml manta.v; \
build
2023-04-26 18:54:13 +02:00
nexys_a7_ps2_logic_analyzer:
cd examples/nexys_a7/ps2_logic_analyzer/; \
manta gen manta.yaml src/manta.v; \
2023-04-26 18:54:13 +02:00
manta playback manta.yaml my_logic_analyzer sim/playback.v; \
build
nexys_a7_lut_mem:
cd examples/nexys_a7/lut_mem/; \
2023-04-26 18:54:13 +02:00
manta gen manta.yaml manta.v; \
build
icestick: icestick_io_core icestick_lut_mem
icestick_io_core:
cd examples/icestick/io_core/; \
manta gen manta.yaml manta.v; \
./build.sh
icestick_lut_mem:
cd examples/icestick/lut_mem/; \
manta gen manta.yaml manta.v; \
./build.sh
clean_examples:
rm -f examples/nexys_a7/io_core/obj/*
rm -f examples/nexys_a7/io_core/src/manta.v
rm -f examples/nexys_a7/logic_analyzer/obj/*
rm -f examples/nexys_a7/logic_analyzer/src/manta.v
rm -f examples/nexys_a7/lut_mem/obj/*
rm -f examples/nexys_a7/lut_mem/src/manta.v
rm -f examples/icestick/io_core/*.bin
rm -f examples/icestick/io_core/manta.v
rm -f examples/icestick/lut_mem/*.bin
rm -f examples/icestick/lut_mem/manta.v