manta/Makefile

124 lines
3.1 KiB
Makefile
Raw Normal View History

2023-07-31 04:50:50 +02:00
# Tool Paths
VIVADO=/tools/Xilinx/Vivado/2023.1/bin/vivado
YOSYS=/tools/oss-cad-suite/bin/yosys
NEXTPNR_ICE40=/tools/oss-cad-suite/bin/nextpnr-ice40
ICEPACK=/tools/oss-cad-suite/bin/icepack
2023-07-17 16:10:20 +02:00
test: auto_gen sim formal
2023-07-17 16:10:20 +02:00
examples: icestick nexys_a7
2023-07-17 16:10:20 +02:00
clean:
2023-08-23 16:45:23 +02:00
@echo "Deleting everything matched by .gitignore"
git clean -Xdf
serve_docs:
mkdocs serve
2023-07-17 16:10:20 +02:00
# Python Operations
python_build:
python3 -m build
2023-07-17 16:10:20 +02:00
pypi_upload: build
python3 -m twine upload --repository testpypi dist/*
2023-07-17 15:53:01 +02:00
2023-07-17 16:10:20 +02:00
python_lint:
python3 -m black src/manta/__init__.py
python3 -m black src/manta/__main__.py
# API Generation Tests
auto_gen:
2023-04-03 02:33:50 +02:00
python3 test/auto_gen/run_tests.py
2023-08-23 16:45:23 +02:00
# Build Examples
2023-08-30 02:03:34 +02:00
NEXYS_A7_EXAMPLES := io_core_ether io_core_uart ps2_logic_analyzer video_sprite_ether video_sprite_uart block_mem_uart logic_analyzer_uart large_io_core_uart
2023-08-02 16:39:07 +02:00
.PHONY: nexys_a7 $(NEXYS_A7_EXAMPLES)
nexys_a7: $(NEXYS_A7_EXAMPLES)
$(NEXYS_A7_EXAMPLES):
cd examples/nexys_a7/$@; \
python3 -m manta gen manta.yaml src/manta.v; \
rm -rf obj; \
mkdir -p obj; \
2023-08-23 17:29:59 +02:00
$(VIVADO) -mode batch \
-source ../build.tcl \
-log obj/build.log \
2023-08-23 17:52:59 +02:00
-jou obj/build.jou; \
rm -rf .Xil;
2023-08-02 16:39:07 +02:00
ICESTICK_EXAMPLES := io_core
.PHONY: icestick $(ICESTICK_EXAMPLES)
icestick: $(ICESTICK_EXAMPLES)
$(ICESTICK_EXAMPLES):
cd examples/icestick/$@; \
python3 -m manta gen manta.yaml manta.v; \
$(YOSYS) -p 'synth_ice40 -top top_level -json top_level.json' top_level.sv; \
$(NEXTPNR_ICE40) --hx1k --json top_level.json --pcf top_level.pcf --asc top_level.asc; \
$(ICEPACK) top_level.asc top_level.bin; \
rm -f *.json; \
rm -f *.asc;
# Formal Verification
formal:
sby -f test/formal_verification/bridge_rx.sby
# Functional Simulation
2023-07-20 04:12:01 +02:00
sim: ethernet_tx_tb ethernet_rx_tb mac_tb block_memory_tb io_core_tb logic_analyzer_tb bridge_rx_tb bridge_tx_tb block_memory_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:
2023-07-17 16:10:20 +02:00
iverilog -g2012 -o sim.out -y src/manta/ether_iface test/functional_sim/mac_tb.sv
vvp sim.out
rm sim.out
block_memory_tb:
2023-07-17 16:10:20 +02:00
iverilog -g2012 -o sim.out -y src/manta/block_mem_core 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 \
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; \
2023-07-31 04:27:12 +02:00
python3 -m 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
2023-07-24 18:03:46 +02:00
uart_rx_tb:
iverilog -g2012 -o sim.out -y src/manta/uart_iface test/functional_sim/uart_rx_tb.sv
vvp sim.out
rm sim.out
uart_tx_tb:
iverilog -g2012 -o sim.out -y src/manta/uart_iface test/functional_sim/uart_tx_tb.sv
vvp sim.out
rm sim.out