Update makefile and default to gzip

- now "make uncompress" can deal with split archives
diff --git a/Makefile b/Makefile
index ed4e01d..a060310 100644
--- a/Makefile
+++ b/Makefile
@@ -16,25 +16,39 @@
 
 # cannot commit files larger than 100 MB to GitHub
 FILE_SIZE_LIMIT_MB = 100
-LARGE_FILES := $(shell find ./gds -type f -name "*.gds")
-LARGE_FILES += $(shell find . -type f -size +$(FILE_SIZE_LIMIT_MB)M -not -path "./.git/*" -not -path "./gds/*" -not -path "./openlane/*")
 
-COMPRESS ?= xz
-UNCOMPRESS ?= xz -d
-ARCHIVE_EXT ?= xz
+# Commands to be used to compress/uncompress files
+# they must operate **in place** (otherwise, modify the target to delete the
+# intermediate file/archive)
+COMPRESS ?= gzip -n --best
+UNCOMPRESS ?= gzip -d
+ARCHIVE_EXT ?= gz
 
-LARGE_FILES_GZ := $(addsuffix .$(ARCHIVE_EXT), $(LARGE_FILES))
+# The following variables are to build static pattern rules
 
+# Needed to rebuild archives that were previously split
+SPLIT_FILES := $(shell find . -type f -name "*.$(ARCHIVE_EXT).00.split")
+SPLIT_FILES_SOURCES := $(basename $(basename $(basename $(SPLIT_FILES))))
+
+# Needed to uncompress the existing archives
 ARCHIVES := $(shell find . -type f -name "*.$(ARCHIVE_EXT)")
 ARCHIVE_SOURCES := $(basename $(ARCHIVES))
 
+# Needed to compress and split files/archives that are too large
+LARGE_FILES := $(shell find ./gds -type f -name "*.gds")
+LARGE_FILES += $(shell find . -type f -size +$(FILE_SIZE_LIMIT_MB)M -not -path "./.git/*" -not -path "./gds/*" -not -path "./openlane/*")
+LARGE_FILES_GZ := $(addsuffix .$(ARCHIVE_EXT), $(LARGE_FILES))
+LARGE_FILES_GZ_SPLIT := $(addsuffix .$(ARCHIVE_EXT).00.split, $(LARGE_FILES))
+# consider splitting existing archives
+LARGE_FILES_GZ_SPLIT += $(addsuffix .00.split, $(ARCHIVES))
+
 # PDK setup configs
 THREADS ?= $(shell nproc)
 STD_CELL_LIBRARY ?= sky130_fd_sc_hd
 SPECIAL_VOLTAGE_LIBRARY ?= sky130_fd_sc_hvl
 IO_LIBRARY ?= sky130_fd_io
 SKYWATER_COMMIT ?= 3d7617a1acb92ea883539bcf22a632d6361a5de4
-OPEN_PDKS_COMMIT ?= 32cdb2097fd9a629c91e8ea33e1f6de08ab25946
+OPEN_PDKS_COMMIT ?= debc0a49b00d93416e0efd82f26f7604ae1e7a3a
 
 .DEFAULT_GOAL := ship
 # We need portable GDS_FILE pointers...
@@ -50,35 +64,58 @@
 
 .PHONY: clean
 clean:
-	echo "clean"
-
+	cd ./verilog/dv/caravel/mgmt_soc/ && \
+		$(MAKE) -j$(THREADS) clean
+	cd ./verilog/dv/caravel/user_proj_example/ && \
+		$(MAKE) -j$(THREADS) clean
 
 
 .PHONY: verify
 verify:
-	echo "verify"
+	cd ./verilog/dv/caravel/mgmt_soc/ && \
+		$(MAKE) -j$(THREADS) all
+	cd ./verilog/dv/caravel/user_proj_example/ && \
+		$(MAKE) -j$(THREADS) all
 
 
 
+#####
 $(LARGE_FILES_GZ): %.$(ARCHIVE_EXT): %
 	@if ! [ $(suffix $<) == ".$(ARCHIVE_EXT)" ]; then\
 		$(COMPRESS) $< > /dev/null &&\
 		echo "$< -> $@";\
 	fi
 
+$(LARGE_FILES_GZ_SPLIT): %.$(ARCHIVE_EXT).00.split: %.$(ARCHIVE_EXT)
+	@if [ -n "$$(find "$<" -prune -size +$(FILE_SIZE_LIMIT_MB)M)" ]; then\
+		split $< -b $(FILE_SIZE_LIMIT_MB)M $<. -d --additional-suffix=.split &&\
+		rm $< &&\
+		echo -n "$< -> $$(ls $<.*.split)" | tr '\n' ' ' && echo "";\
+	fi
+
 # This target compresses all files larger than $(FILE_SIZE_LIMIT_MB) MB
 .PHONY: compress
-compress: $(LARGE_FILES_GZ)
+compress: $(LARGE_FILES_GZ) $(LARGE_FILES_GZ_SPLIT)
 	@echo "Files larger than $(FILE_SIZE_LIMIT_MB) MBytes are compressed!"
 
 
 
+#####
 $(ARCHIVE_SOURCES): %: %.$(ARCHIVE_EXT)
-	@$(UNCOMPRESS) $< &&\
-	echo "$< -> $@";\
+	@$(UNCOMPRESS) $<
+	@echo "$< -> $@"
+
+.SECONDEXPANSION:
+$(SPLIT_FILES_SOURCES): %: $$(sort $$(wildcard %.$(ARCHIVE_EXT).*.split))
+	@cat $? > $@.$(ARCHIVE_EXT)
+	@rm $?
+	@echo "$? -> $@.$(ARCHIVE_EXT)"
+	@$(UNCOMPRESS) $@.$(ARCHIVE_EXT)
+	@echo "$@.$(ARCHIVE_EXT) -> $@"
+
 
 .PHONY: uncompress
-uncompress: $(ARCHIVE_SOURCES)
+uncompress: $(SPLIT_FILES_SOURCES) $(ARCHIVE_SOURCES)
 	@echo "All files are uncompressed!"
 
 
@@ -112,7 +149,7 @@
 	mkdir -p ./spi/lvs/tmp
 	sh ./spi/lvs/run_lvs.sh ./spi/lvs/$*.spice ./verilog/gl/$*.v $*
 	@echo ""
-	python3 ./scripts/count_lvs.py -f ./verilog/gl/$*.v_comp.json
+	python3 ./scripts/count_lvs.py -f ./verilog/gl/$*.v_comp.json | tee ./spi/lvs/tmp/$*.lvs.summary.log
 	mv -f ./verilog/gl/*{.out,.json,.log} ./spi/lvs/tmp 2> /dev/null || true
 	@echo ""
 	@echo "LVS: ./spi/lvs/$*.spice vs. ./verilog/gl/$*.v"
@@ -146,7 +183,7 @@
 	mkdir -p ./spi/lvs/tmp
 	sh ./spi/lvs/run_lvs.sh ./spi/lvs/$*.spice ./verilog/gl/$*.v $*
 	@echo ""
-	python3 ./scripts/count_lvs.py -f ./verilog/gl/$*.v_comp.json
+	python3 ./scripts/count_lvs.py -f ./verilog/gl/$*.v_comp.json | tee ./spi/lvs/tmp/$*.maglef.lvs.summary.log
 	mv -f ./verilog/gl/*{.out,.json,.log} ./spi/lvs/tmp 2> /dev/null || true
 	@echo ""
 	@echo "LVS: ./spi/lvs/$*.spice vs. ./verilog/gl/$*.v"
@@ -188,10 +225,10 @@
 help:
 	@$(MAKE) -pRrq -f $(lastword $(MAKEFILE_LIST)) : 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | sort | egrep -v -e '^[^[:alnum:]]' -e '^$@$$'
 
-		
+
 ###########################################################################
 .PHONY: pdk
-pdk: skywater-pdk skywater-library open_pdks build-pdk
+pdk: skywater-pdk skywater-library skywater-timing open_pdks build-pdk
 
 $(PDK_ROOT)/skywater-pdk:
 	git clone https://github.com/google/skywater-pdk.git $(PDK_ROOT)/skywater-pdk
@@ -207,9 +244,11 @@
 	cd $(PDK_ROOT)/skywater-pdk && \
 		git submodule update --init libraries/$(STD_CELL_LIBRARY)/latest && \
 		git submodule update --init libraries/$(IO_LIBRARY)/latest && \
-		git submodule update --init libraries/$(SPECIAL_VOLTAGE_LIBRARY)/latest && \
-		$(MAKE) -j$(THREADS) timing
+		git submodule update --init libraries/$(SPECIAL_VOLTAGE_LIBRARY)/latest
 
+skywater-timing: check-env $(PDK_ROOT)/skywater-pdk
+	cd $(PDK_ROOT)/skywater-pdk && \
+		$(MAKE) -j$(THREADS) timing
 ### OPEN_PDKS
 $(PDK_ROOT)/open_pdks:
 	git clone https://github.com/RTimothyEdwards/open_pdks.git $(PDK_ROOT)/open_pdks
@@ -228,7 +267,7 @@
 		rm -rf $(PDK_ROOT)/sky130A) || \
 		true
 	cd $(PDK_ROOT)/open_pdks && \
-		./configure --with-sky130-source=$(PDK_ROOT)/skywater-pdk/libraries --with-sky130-local-path=$(PDK_ROOT) && \
+		./configure --enable-sky130-pdk=$(PDK_ROOT)/skywater-pdk/libraries --with-sky130-local-path=$(PDK_ROOT) && \
 		cd sky130 && \
 		$(MAKE) veryclean && \
 		$(MAKE) && \
@@ -256,7 +295,7 @@
 		rst_include include README.src.rst - | \
 			sed \
 				-e's@\.\/\_static@\/docs\/source\/\_static@g' \
-				-e's@:ref:`tool-versioning`@`tool-versioning`_@g' \
+				-e's@:doc:`tool-versioning`@`tool-versioning.rst <./docs/source/tool-versioning.rst>`__@g' \
 				-e's@.. note::@**NOTE:**@g' \
 				-e's@.. warning::@**WARNING:**@g' \
 				> README.rst && \
diff --git a/gds/DFFRAM.gds.gz b/gds/DFFRAM.gds.gz
new file mode 100644
index 0000000..a0f9b37
--- /dev/null
+++ b/gds/DFFRAM.gds.gz
Binary files differ
diff --git a/gds/DFFRAM.gds.xz b/gds/DFFRAM.gds.xz
deleted file mode 100644
index a384650..0000000
--- a/gds/DFFRAM.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/RAM_6Kx32.gds.gz.00.split b/gds/RAM_6Kx32.gds.gz.00.split
new file mode 100644
index 0000000..19c3f24
--- /dev/null
+++ b/gds/RAM_6Kx32.gds.gz.00.split
Binary files differ
diff --git a/gds/RAM_6Kx32.gds.gz.01.split b/gds/RAM_6Kx32.gds.gz.01.split
new file mode 100644
index 0000000..6cfa86b
--- /dev/null
+++ b/gds/RAM_6Kx32.gds.gz.01.split
Binary files differ
diff --git a/gds/RAM_6Kx32.gds.gz.02.split b/gds/RAM_6Kx32.gds.gz.02.split
new file mode 100644
index 0000000..0bcaa2b
--- /dev/null
+++ b/gds/RAM_6Kx32.gds.gz.02.split
Binary files differ
diff --git a/gds/RAM_6Kx32.gds.xz b/gds/RAM_6Kx32.gds.xz
deleted file mode 100644
index 15d88ee..0000000
--- a/gds/RAM_6Kx32.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/advSeal_6um_gen.gds.gz b/gds/advSeal_6um_gen.gds.gz
new file mode 100644
index 0000000..ca2634d
--- /dev/null
+++ b/gds/advSeal_6um_gen.gds.gz
Binary files differ
diff --git a/gds/advSeal_6um_gen.gds.xz b/gds/advSeal_6um_gen.gds.xz
deleted file mode 100644
index ac5e5c7..0000000
--- a/gds/advSeal_6um_gen.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/caravel.gds.gz.00.split b/gds/caravel.gds.gz.00.split
new file mode 100644
index 0000000..dceed75
--- /dev/null
+++ b/gds/caravel.gds.gz.00.split
Binary files differ
diff --git a/gds/caravel.gds.gz.01.split b/gds/caravel.gds.gz.01.split
new file mode 100644
index 0000000..307aca9
--- /dev/null
+++ b/gds/caravel.gds.gz.01.split
Binary files differ
diff --git a/gds/caravel.gds.gz.02.split b/gds/caravel.gds.gz.02.split
new file mode 100644
index 0000000..6fe58bb
--- /dev/null
+++ b/gds/caravel.gds.gz.02.split
Binary files differ
diff --git a/gds/caravel.gds.xz.00 b/gds/caravel.gds.xz.00
deleted file mode 100644
index 473c3d8..0000000
--- a/gds/caravel.gds.xz.00
+++ /dev/null
Binary files differ
diff --git a/gds/caravel.gds.xz.01 b/gds/caravel.gds.xz.01
deleted file mode 100644
index d303047..0000000
--- a/gds/caravel.gds.xz.01
+++ /dev/null
Binary files differ
diff --git a/gds/chip_io.gds.gz b/gds/chip_io.gds.gz
new file mode 100644
index 0000000..d678ea5
--- /dev/null
+++ b/gds/chip_io.gds.gz
Binary files differ
diff --git a/gds/chip_io.gds.xz b/gds/chip_io.gds.xz
deleted file mode 100644
index 54fd571..0000000
--- a/gds/chip_io.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/digital_pll.gds.gz b/gds/digital_pll.gds.gz
new file mode 100644
index 0000000..2487b6b
--- /dev/null
+++ b/gds/digital_pll.gds.gz
Binary files differ
diff --git a/gds/digital_pll.gds.xz b/gds/digital_pll.gds.xz
deleted file mode 100644
index 993e01a..0000000
--- a/gds/digital_pll.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/gpio_control_block.gds.gz b/gds/gpio_control_block.gds.gz
new file mode 100644
index 0000000..8cc0297
--- /dev/null
+++ b/gds/gpio_control_block.gds.gz
Binary files differ
diff --git a/gds/gpio_control_block.gds.xz b/gds/gpio_control_block.gds.xz
deleted file mode 100644
index 21127a3..0000000
--- a/gds/gpio_control_block.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/mgmt_core.gds.gz b/gds/mgmt_core.gds.gz
new file mode 100644
index 0000000..185a334
--- /dev/null
+++ b/gds/mgmt_core.gds.gz
Binary files differ
diff --git a/gds/mgmt_core.gds.xz b/gds/mgmt_core.gds.xz
deleted file mode 100644
index c0164c7..0000000
--- a/gds/mgmt_core.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/mgmt_protect.gds.gz b/gds/mgmt_protect.gds.gz
new file mode 100644
index 0000000..1c19291
--- /dev/null
+++ b/gds/mgmt_protect.gds.gz
Binary files differ
diff --git a/gds/mgmt_protect.gds.xz b/gds/mgmt_protect.gds.xz
deleted file mode 100644
index a443544..0000000
--- a/gds/mgmt_protect.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/mgmt_protect_hv.gds.gz b/gds/mgmt_protect_hv.gds.gz
new file mode 100644
index 0000000..3db3e35
--- /dev/null
+++ b/gds/mgmt_protect_hv.gds.gz
Binary files differ
diff --git a/gds/mgmt_protect_hv.gds.xz b/gds/mgmt_protect_hv.gds.xz
deleted file mode 100644
index 08a977f..0000000
--- a/gds/mgmt_protect_hv.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/mprj2_logic_high.gds.gz b/gds/mprj2_logic_high.gds.gz
new file mode 100644
index 0000000..7cd8405
--- /dev/null
+++ b/gds/mprj2_logic_high.gds.gz
Binary files differ
diff --git a/gds/mprj2_logic_high.gds.xz b/gds/mprj2_logic_high.gds.xz
deleted file mode 100644
index b8f5bef..0000000
--- a/gds/mprj2_logic_high.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/mprj_logic_high.gds.gz b/gds/mprj_logic_high.gds.gz
new file mode 100644
index 0000000..35213d8
--- /dev/null
+++ b/gds/mprj_logic_high.gds.gz
Binary files differ
diff --git a/gds/mprj_logic_high.gds.xz b/gds/mprj_logic_high.gds.xz
deleted file mode 100644
index 9ad9ba1..0000000
--- a/gds/mprj_logic_high.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/simple_por.gds.gz b/gds/simple_por.gds.gz
new file mode 100644
index 0000000..34c0ce2
--- /dev/null
+++ b/gds/simple_por.gds.gz
Binary files differ
diff --git a/gds/simple_por.gds.xz b/gds/simple_por.gds.xz
deleted file mode 100644
index eff42d7..0000000
--- a/gds/simple_por.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/sky130_fd_sc_hvl__lsbufhv2lv_1_wrapped.gds.gz b/gds/sky130_fd_sc_hvl__lsbufhv2lv_1_wrapped.gds.gz
new file mode 100644
index 0000000..a583d42
--- /dev/null
+++ b/gds/sky130_fd_sc_hvl__lsbufhv2lv_1_wrapped.gds.gz
Binary files differ
diff --git a/gds/sky130_fd_sc_hvl__lsbufhv2lv_1_wrapped.gds.xz b/gds/sky130_fd_sc_hvl__lsbufhv2lv_1_wrapped.gds.xz
deleted file mode 100644
index 5fb5c1f..0000000
--- a/gds/sky130_fd_sc_hvl__lsbufhv2lv_1_wrapped.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/sram_1rw1r_32_256_8_sky130.gds.gz b/gds/sram_1rw1r_32_256_8_sky130.gds.gz
new file mode 100644
index 0000000..ed01511
--- /dev/null
+++ b/gds/sram_1rw1r_32_256_8_sky130.gds.gz
Binary files differ
diff --git a/gds/sram_1rw1r_32_256_8_sky130.gds.xz b/gds/sram_1rw1r_32_256_8_sky130.gds.xz
deleted file mode 100644
index efbd957..0000000
--- a/gds/sram_1rw1r_32_256_8_sky130.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/storage.gds.gz b/gds/storage.gds.gz
new file mode 100644
index 0000000..f093f63
--- /dev/null
+++ b/gds/storage.gds.gz
Binary files differ
diff --git a/gds/storage.gds.xz b/gds/storage.gds.xz
deleted file mode 100644
index 24d295f..0000000
--- a/gds/storage.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/user_id_programming.gds.gz b/gds/user_id_programming.gds.gz
new file mode 100644
index 0000000..0ad9383
--- /dev/null
+++ b/gds/user_id_programming.gds.gz
Binary files differ
diff --git a/gds/user_id_programming.gds.xz b/gds/user_id_programming.gds.xz
deleted file mode 100644
index f8bac55..0000000
--- a/gds/user_id_programming.gds.xz
+++ /dev/null
Binary files differ
diff --git a/gds/user_project_wrapper.gds.gz.00.split b/gds/user_project_wrapper.gds.gz.00.split
new file mode 100644
index 0000000..4d430fd
--- /dev/null
+++ b/gds/user_project_wrapper.gds.gz.00.split
Binary files differ
diff --git a/gds/user_project_wrapper.gds.gz.01.split b/gds/user_project_wrapper.gds.gz.01.split
new file mode 100644
index 0000000..0f99f5d
--- /dev/null
+++ b/gds/user_project_wrapper.gds.gz.01.split
Binary files differ
diff --git a/gds/user_project_wrapper.gds.gz.02.split b/gds/user_project_wrapper.gds.gz.02.split
new file mode 100644
index 0000000..f873794
--- /dev/null
+++ b/gds/user_project_wrapper.gds.gz.02.split
Binary files differ
diff --git a/gds/user_project_wrapper.gds.xz.00 b/gds/user_project_wrapper.gds.xz.00
deleted file mode 100644
index a10c490..0000000
--- a/gds/user_project_wrapper.gds.xz.00
+++ /dev/null
Binary files differ
diff --git a/gds/user_project_wrapper.gds.xz.01 b/gds/user_project_wrapper.gds.xz.01
deleted file mode 100644
index 708e011..0000000
--- a/gds/user_project_wrapper.gds.xz.01
+++ /dev/null
Binary files differ
diff --git a/gds/user_project_wrapper_empty.gds.gz b/gds/user_project_wrapper_empty.gds.gz
new file mode 100644
index 0000000..c8fdfe7
--- /dev/null
+++ b/gds/user_project_wrapper_empty.gds.gz
Binary files differ
diff --git a/gds/user_project_wrapper_empty.gds.xz b/gds/user_project_wrapper_empty.gds.xz
deleted file mode 100644
index ecda0d1..0000000
--- a/gds/user_project_wrapper_empty.gds.xz
+++ /dev/null
Binary files differ
diff --git a/mag/mgmt_core.mag.gz b/mag/mgmt_core.mag.gz
new file mode 100644
index 0000000..92f56a4
--- /dev/null
+++ b/mag/mgmt_core.mag.gz
Binary files differ
diff --git a/mag/mgmt_core.mag.xz b/mag/mgmt_core.mag.xz
deleted file mode 100644
index c10c74b..0000000
--- a/mag/mgmt_core.mag.xz
+++ /dev/null
Binary files differ