summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorvin <git@vineetk.net>2025-12-10 16:35:42 -0500
committervin <git@vineetk.net>2025-12-10 16:39:36 -0500
commit06b6b116934cc8341676f52f5f6040a038020c32 (patch)
treef2db3531293b6de1a67a1e26a2aa1663f4d55082 /Makefile
parent36f4ec74c5d1247362bed901dbaf0a36970b4cd0 (diff)
migrate from electric vlsi to librelane/sky130 flowHEADmaster
this is quite a major shift. moves the project from a manual, full-custom layout workflow to a more modern automated flow and a more modern process (130nm vs 350nm). also improved the testbench. migration also resolves previous manual routing-caused errors (like the CONS logic bug and difficulty in implementing TG logic). this nearly halved the transistor count from 15k to 8k and reduced area size by 300x.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile65
1 files changed, 65 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..8b7bf3a
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,65 @@
1# ==============================================================================
2# CONFIGURATION
3# ==============================================================================
4PROJECT_NAME = lisp_coproc
5CONFIG_FILE = config.json
6
7# Tool Paths
8LIBRELANE = librelane
9VERILATOR = verilator
10
11# PDK Paths (Standard Volare location)
12PDK_ROOT ?= $(HOME)/.ciel/ciel/sky130/versions/0fe599b2afb6708d281543108caf8310912f54af/
13PDK = sky130A
14LIB_VERILOG = $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hd/verilog/sky130_fd_sc_hd.v
15PRIM_VERILOG = $(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hd/verilog/primitives.v
16
17# Simulation Flags
18VERILATOR_FLAGS = --binary -j 0 --timing --trace --top-module tb_$(PROJECT_NAME) \
19 -Wno-fatal -Wno-style -Wno-lint
20
21# ==============================================================================
22# TARGETS
23# ==============================================================================
24.PHONY: all rtl harden gls clean
25
26# 1. Default: Run the full pipeline (RTL -> GDS -> Check)
27all: rtl harden gls
28
29# 2. RTL Verification: Runs your Golden SystemVerilog Testbench
30rtl:
31 @echo "\n=== [1/3] Running RTL Verification ==="
32 $(VERILATOR) $(VERILATOR_FLAGS) \
33 -DGL_SIM=0 \
34 rtl/tb_$(PROJECT_NAME).sv rtl/$(PROJECT_NAME).sv
35 ./obj_dir/Vtb_$(PROJECT_NAME)
36 @echo ">>> RTL Verification Passed <<<"
37
38# 3. Hardening: Runs LibreLane (Synthesis, Place & Route)
39# Note: Uses --run-tag to create a predictable folder name for the GLS step
40harden:
41 @echo "\n=== [2/3] Running LibreLane Hardening ==="
42 $(LIBRELANE) --flow Classic \
43 --run-tag automated_run \
44 --overwrite \
45 $(CONFIG_FILE)
46 @echo ">>> Hardening Complete <<<"
47
48# 4. Gate-Level Simulation (GLS): Verifies the final GDSII netlist
49# Finds the netlist generated by the 'harden' step
50GL_NETLIST = runs/automated_run/final/nl/$(PROJECT_NAME).nl.v
51
52gls:
53 @echo "\n=== [3/3] Running Gate-Level Simulation (GLS) ==="
54 $(VERILATOR) $(VERILATOR_FLAGS) \
55 -DGL_SIM=1 -DFUNCTIONAL -DUNIT_DELAY=\#1 \
56 -I$(PDK_ROOT)/$(PDK)/libs.ref/sky130_fd_sc_hd/verilog \
57 rtl/tb_$(PROJECT_NAME).sv \
58 $(GL_NETLIST) \
59 $(LIB_VERILOG) $(PRIM_VERILOG)
60 ./obj_dir/Vtb_$(PROJECT_NAME)
61 @echo ">>> GLS Verification Passed <<<"
62
63# Clean up build artifacts
64clean:
65 rm -rf obj_dir runs/automated_run $(PROJECT_NAME).vcd