-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathMakefile
More file actions
47 lines (36 loc) · 1.45 KB
/
Copy pathMakefile
File metadata and controls
47 lines (36 loc) · 1.45 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
REPO := fossi-foundation/skywater-pdk-libs-sky130_fd_sc_hd
SCHEMATICS := $(shell find schematics -name "*.sch")
ALL_SVG_FILES := $(patsubst schematics/%.sch,svg/%.svg,$(SCHEMATICS))
ALL_LVS_FILES := $(patsubst schematics/%.sch,lvs/%.report,$(SCHEMATICS))
SPICE2SCH := PYTHONPATH=third_party/spice2sch/src python3 -m spice2sch
all_svg: ${ALL_SVG_FILES}
all_lvs: ${ALL_LVS_FILES}
.SECONDARY:
netlists/%.spice: schematics/%.sch
mkdir -p $(dir $@)
mkdir -p $(dir logs/$*)
SCHEMATIC=$* xschem --no_x --log logs/$*.spice.log --script scripts/xschem_generate_netlist.tcl
svg/%.svg: schematics/%.sch
mkdir -p $(dir $@)
mkdir -p $(dir logs/$*)
SCHEMATIC=$* xschem --no_x --log logs/$*.svg.log --script scripts/xschem_generate_svg.tcl
flock /tmp/inkscape.lock \
inkscape $@ --export-overwrite --export-filename=$@ \
--actions="select-by-id:rect1;delete;page-fit-to-selection"
lvs/%.report: references/%.spice netlists/%.spice
mkdir -p $(dir $@)
rm -f $(@:.report=.failed)
REFERENCE_SPICE_FILE=references/$*.spice \
REFERENCE_CELL_NAME=$(notdir $*) \
XSCHEM_SPICE_FILE=netlists/$*.spice \
XSCHEM_CELL_NAME=$(notdir $*) \
REPORT_FILE=$@ \
netgen -batch source scripts/netgen_lvs.tcl
references/%.spice:
mkdir -p $(dir $@)
wget -O $@ https://raw.githubusercontent.com/${REPO}/main/cells/$*.spice || (rm -f $@ && false)
spice2sch/%.sch: references/%.spice
mkdir -p $(dir $@)
${SPICE2SCH} -i $< -o $@
clean:
rm -rf logs lvs netlists references svg spice2sch