Repository navigation
Expand file tree
/
Copy pathMakefile
More file actions
49 lines (40 loc) · 2.07 KB
/
Copy pathMakefile
File metadata and controls
49 lines (40 loc) · 2.07 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
SIM_OUT := simv
.PHONY: sim clean formal sky130-synth sky130-synth-local sky130-synth-yosys-only
# Frozen tile configuration
DATA_W ?= 8
ACC_W ?= 16
LEN_W ?= 6
PDK_ROOT ?= $(HOME)/.volare
SKY130_LIB ?= $(PDK_ROOT)/sky130A/libs.ref/sky130_fd_sc_hd/lib/sky130_fd_sc_hd__tt_025C_1v80.lib
SYNTH_DIR := build/synth
YOSYS_READ := read_verilog -sv rtl/dpu_tile.sv; chparam -set DATA_W $(DATA_W) -set ACC_W $(ACC_W) -set LEN_W $(LEN_W) dpu_tile; hierarchy -top dpu_tile
sim:
iverilog -g2012 -Wall -o $(SIM_OUT) rtl/dpu_tile.sv tb/dpu_tile_tb.sv
vvp $(SIM_OUT)
formal:
@if ! command -v sby >/dev/null 2>&1; then \
echo "SymbiYosys (sby) is not installed. Install yosys + sby to run formal proofs."; \
exit 1; \
fi
sby -f formal/dpu_tile.sby
# Requires Docker + OpenLane (see openlane/README.md); runs the full flow.
sky130-synth:
@if ! command -v docker >/dev/null 2>&1 && [ -z "$$OPENLANE_ROOT" ]; then \
echo "Requires Docker and an upstream OpenLane checkout (OPENLANE_ROOT). See openlane/README.md."; \
exit 1; \
fi
cd $${OPENLANE_ROOT:-.} && make mount MOUNT_CMD='./flow.tcl -design $(CURDIR)/openlane'
# Lightweight, PDK-agnostic synthesis check (used in CI); no Docker, no liberty.
sky130-synth-yosys-only:
@command -v yosys >/dev/null 2>&1 || { echo "yosys is not installed"; exit 1; }
@mkdir -p $(SYNTH_DIR)
yosys -p "$(YOSYS_READ); synth -top dpu_tile -flatten; check -assert; stat; write_verilog -noattr $(SYNTH_DIR)/dpu_tile_generic.v"
# Maps to sky130_fd_sc_hd cells; needs the sky130 liberty (set SKY130_LIB or PDK_ROOT).
sky130-synth-local:
@command -v yosys >/dev/null 2>&1 || { echo "yosys is not installed"; exit 1; }
@test -f "$(SKY130_LIB)" || { echo "Liberty not found: $(SKY130_LIB). Set SKY130_LIB or PDK_ROOT."; exit 1; }
@mkdir -p $(SYNTH_DIR)
yosys -q -p "$(YOSYS_READ); synth -top dpu_tile -flatten; dfflibmap -liberty $(SKY130_LIB); abc -liberty $(SKY130_LIB); opt_clean -purge; check -assert; tee -o $(SYNTH_DIR)/stat.txt stat -liberty $(SKY130_LIB); write_verilog -noattr $(SYNTH_DIR)/dpu_tile_sky130.v"
clean:
rm -f $(SIM_OUT) *.vcd
rm -rf formal/output build