Initial release of the ReRAM PDK.

This release contains only documentation.

Signed-off-by: Ethan Mahintorabi <ethanmoon@google.com>
Signed-off-by: Tim 'mithro' Ansell <tansell@google.com>
Signed-off-by: Steve Kosier <Steve.Kosier@skywatertechnology.com>
diff --git a/.gitignore b/.gitignore
index 95817a8..92e8f20 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 timing/*.lib
 docs/_build
+env
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..ad3f0c8
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,3 @@
+[submodule "third_party/make-env"]
+	path = third_party/make-env
+	url = https://github.com/SymbiFlow/make-env.git
diff --git a/.readthedocs.yml b/.readthedocs.yml
new file mode 100644
index 0000000..27e8df1
--- /dev/null
+++ b/.readthedocs.yml
@@ -0,0 +1,29 @@
+# Copyright 2020 SkyWater PDK Authors
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+# SPDX-License-Identifier: Apache-2.0
+
+# .readthedocs.yml
+# Read the Docs configuration file
+# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
+
+# Required
+version: 2
+
+# Build documentation in the docs/ directory with Sphinx
+sphinx:
+  configuration: docs/conf.py
+
+conda:
+  environment: docs/environment.yml
diff --git a/docs/Makefile b/docs/Makefile
index 5f18090..9bc3b5c 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -13,34 +13,42 @@
 # limitations under the License.
 #
 # SPDX-License-Identifier: Apache-2.0
+
 # The top directory where environment will be created.
 DOCS_DIR := $(dir $(lastword $(MAKEFILE_LIST)))
 TOP_DIR := $(realpath $(DOCS_DIR)/..)
+
 # A pip `requirements.txt` file.
 # https://pip.pypa.io/en/stable/reference/pip_install/#requirements-file-format
-REQUIREMENTS_FILE := $(DOCS_DIR)/requirements.txt
+REQUIREMENTS_FILE := requirements.txt
+
 # A conda `environment.yml` file.
 # https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html
-ENVIRONMENT_FILE := $(DOCS_DIR)/environment.yml
+ENVIRONMENT_FILE := environment.yml
+
 $(TOP_DIR)/third_party/make-env/conda.mk: $(TOP_DIR)/.gitmodules
 	cd $(TOP_DIR); git submodule update --init third_party/make-env
-	touch $(TOP_DIR)/third_party/make-env/conda.mk
+
 -include $(TOP_DIR)/third_party/make-env/conda.mk
+
 SHELL = /bin/bash
+
 EXP_OPEN := $$((
 EXP_CLOSE := ))
 CPU_CORES := $(shell nproc)
 CPU_CORES_2 := $(shell echo $(EXP_OPEN) $(CPU_CORES) * 2 $(EXP_CLOSE))
+
 SPHINXOPTS      = -j $(CPU_CORES_2)
 SPHINXBUILD     = $(IN_CONDA_ENV) sphinx-build
 SPHINXAUTOBUILD = $(IN_CONDA_ENV) sphinx-autobuild
 SPHINXPROJ      = SkyWaterPDK
 SOURCEDIR       = $(DOCS_DIR)
 BUILDDIR        = $(DOCS_DIR)/_build
-HOSTNAME        = $(shell hostname)
+
 # Put it first so that "make" without argument is like "make help".
 help: | $(CONDA_ENV_PYTHON)
 	@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
 # Vim makes a '4913' file for file system checking. Seriously.
 livehtml: | $(CONDA_ENV_PYTHON)
 	@$(SPHINXAUTOBUILD) \
@@ -53,13 +61,23 @@
 		--ignore _build \
         	--ignore .git \
         	--ignore */4913 \
-		--host $(HOSTNAME)\
-		--port 8080 \
 		\
 		$(SPHINXOPTS) \
 		"$(SOURCEDIR)" \
 		"$(BUILDDIR)/html"
+
 .PHONY: help livehtml Makefile
+
+# Generate the rules/periphery-rules.rst from CSV files in rules/periphery/
+$(wildcard rules/periphery/*): | $(CONDA_ENV_PYTHON)
+	true
+
+rules/periphery-rules.rst: $(wildcard rules/periphery/*) | $(CONDA_ENV_PYTHON)
+	$(IN_CONDA_ENV) cd rules/periphery; ./periphery-split-csv.py > /dev/null
+
+rules/device-details.rst: rules/device-details.py $(wildcard rules/device-details/*/index.rst) | $(CONDA_ENV_PYTHON)
+	$(IN_CONDA_ENV) cd rules; ./device-details.py > $(abspath $@)
+
 # Various automated fixups that can be run
 fixup:
 	# Make sure it is SkyWater
@@ -68,14 +86,21 @@
 	find ../ -type f -name \*.rst -exec sed -i 's/ \+$$//' \{\} \+
 	# Make sure all library names have the :lib: role.
 	find ../ -type f -name \*.rst -exec sed -i -e'/:name:.*/!s/\(:lib:\)\?`\?\(sky130_[a-z0-9]\+_[a-z0-9]\+\(_[a-z0-9]\+\)\?\)`\?\(\s\|$$\)/:lib:`\2`\4/g' \{\} \+
+
 .PHONY: fixup
+
 echo: | $(CONDA_ENV_PYTHON)
 	@echo '$(SPHINXBUILD) -M XXXX "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)'
+
 # Catch-all target: route all unknown targets to Sphinx using the new
 # "make mode" option.  $(O) is meant as a shortcut for $(SPHINXOPTS).
 .DEFAULT: | $(CONDA_ENV_PYTHON)
 	@make env
 	@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
+
+
 clean:: clean-docs
+
+
 clean-docs:
 	rm -rf _build
diff --git a/docs/environment.yml b/docs/environment.yml
index 34cde14..3be7564 100644
--- a/docs/environment.yml
+++ b/docs/environment.yml
@@ -25,5 +25,5 @@
 - netlistsvg
 # Packages installed from PyPI
 - pip:
-  - -r file:requirements.txt
+  - -r requirements.txt
 
diff --git a/docs/requirements.txt b/docs/requirements.txt
index f55c598..6ffa95d 100644
--- a/docs/requirements.txt
+++ b/docs/requirements.txt
@@ -8,6 +8,7 @@
 sphinxcontrib-hdl-diagrams
 # Module diagrams
 git+https://github.com/SymbiFlow/symbolator.git#egg=symbolator
+git+https://github.com/hdl/pyHDLparser.git#egg=hdlparse
 # pycairo
 # vext.gi
 restructuredtext-lint
diff --git a/third_party/make-env b/third_party/make-env
new file mode 160000
index 0000000..59adb0f
--- /dev/null
+++ b/third_party/make-env
@@ -0,0 +1 @@
+Subproject commit 59adb0f248cc4a5d764b6b06224bf6adea7fa36e