From edf3a701e414d7fd706c5eddd10891588869550b Mon Sep 17 00:00:00 2001 From: mrg Date: Tue, 16 Nov 2021 14:33:35 -0800 Subject: [PATCH] Update options for arguments and readme. --- PORTING.md | 24 +++++++++++++ README.md | 51 +++++++++++---------------- compiler/tests/Makefile | 76 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 120 insertions(+), 31 deletions(-) create mode 100644 PORTING.md create mode 100644 compiler/tests/Makefile diff --git a/PORTING.md b/PORTING.md new file mode 100644 index 00000000..e98871e9 --- /dev/null +++ b/PORTING.md @@ -0,0 +1,24 @@ +# Porting to a New Technology + +If you want to support a new technology, you will need to create: ++ a setup script for each technology you want to use ++ a technology directory for each technology with the base cells + +We provide two technology examples for [SCMOS] and [FreePDK45]. Each +specific technology (e.g., [FreePDK45]) should be a subdirectory +(e.g., $OPENRAM_TECH/freepdk45) and include certain folders and files: +* gds_lib folder with all the .gds (premade) library cells: + * dff.gds + * sense_amp.gds + * write_driver.gds + * cell_1rw.gds + * replica\_cell\_1rw.gds + * dummy\_cell\_1rw.gds +* sp_lib folder with all the .sp (premade) library netlists for the above cells. +* layers.map +* A valid tech Python module (tech directory with \_\_init\_\_.py and tech.py) with: + * References in tech.py to spice models + * DRC/LVS rules needed for dynamic cells and routing + * Layer information + * Spice and supply information + * etc. diff --git a/README.md b/README.md index 7dafe0d1..28c62a58 100644 --- a/README.md +++ b/README.md @@ -67,6 +67,11 @@ We include the tech files necessary for [SCMOS] SCN4M_SUBM, generic and should be replaced with foundry models. You may get the entire [FreePDK45 PDK here][FreePDK45]. +To install [Sky130], simply run: +``` +make install +``` + # Basic Usage Once you have defined the environment, you can run OpenRAM from the command line @@ -111,6 +116,12 @@ python3 $OPENRAM_HOME/openram.py myconfig You can see all of the options for the configuration file in $OPENRAM\_HOME/options.py +To run designs in Docker, it is suggested to use, for example: +``` +cd openram/macros +make example_config_scn4m_subm +``` + # Unit Tests Regression testing performs a number of tests for all modules in OpenRAM. @@ -118,50 +129,28 @@ From the unit test directory ($OPENRAM\_HOME/tests), use the following command to run all regression tests: ``` - python3 regress.py +cd openram/compiler/tests +make regress ``` + To run a specific test: ``` - python3 {unit test}.py +ce openram/compiler/tests +make 05_bitcell_array_test ``` -The unit tests take the same arguments as openram.py itself. -To increase the verbosity of the test, add one (or more) -v options: +To increase the verbosity of the test, add one (or more) -v options and +pass it as an argument to OpenRAM: ``` - python3 tests/00_code_format_check_test.py -v -t freepdk45 +make 05_bitcell_array_test ARGS="-v -t scn4m_subm" ``` To specify a particular technology use "-t " such as "-t freepdk45". The default for a unit test is scn4m_subm. The default for openram.py is specified in the configuration file. - -# Porting to a New Technology - -If you want to support a new technology, you will need to create: -+ a setup script for each technology you want to use -+ a technology directory for each technology with the base cells - -We provide two technology examples for [SCMOS] and [FreePDK45]. Each -specific technology (e.g., [FreePDK45]) should be a subdirectory -(e.g., $OPENRAM_TECH/freepdk45) and include certain folders and files: -* gds_lib folder with all the .gds (premade) library cells: - * dff.gds - * sense_amp.gds - * write_driver.gds - * cell_1rw.gds - * replica\_cell\_1rw.gds - * dummy\_cell\_1rw.gds -* sp_lib folder with all the .sp (premade) library netlists for the above cells. -* layers.map -* A valid tech Python module (tech directory with \_\_init\_\_.py and tech.py) with: - * References in tech.py to spice models - * DRC/LVS rules needed for dynamic cells and routing - * Layer information - * Spice and supply information - * etc. - # Get Involved ++ [Port it](./PORTING.md) to a new technology. + Report bugs by submitting [Github issues]. + Develop new features (see [how to contribute](./CONTRIBUTING.md)) + Submit code/fixes using a [Github pull request] diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile new file mode 100644 index 00000000..460b7fcc --- /dev/null +++ b/compiler/tests/Makefile @@ -0,0 +1,76 @@ +TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))../..) +include $(TOP_DIR)/openram.mk + +.DEFAULT_GOAL := regress + +ARGS ?= "" + +TEST_DIR = $(TOP_DIR)/compiler/tests +TEST_SRCS=$(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py))) +TEST_DIRS=$(basename $(TEST_SRCS)) +TEST_STAMPS=$(addsuffix .ok,$(TEST_DIRS)) + +TEST_BROKEN := \ + 50_riscv_1k_1rw1r_func_test.py \ + 50_riscv_1k_1rw_func_test.py \ + 50_riscv_1rw1r_func_test.py \ + 50_riscv_1rw1r_phys_test.py \ + 50_riscv_1rw_func_test.py \ + 50_riscv_1rw_phys_test.py \ + 50_riscv_2k_1rw1r_func_test.py \ + 50_riscv_2k_1rw_func_test.py \ + 50_riscv_4k_1rw1r_func_test.py \ + 50_riscv_4k_1rw_func_test.py \ + 50_riscv_512b_1rw1r_func_test.py \ + 50_riscv_512b_1rw_func_test.py \ + 50_riscv_8k_1rw1r_func_test.py \ + 50_riscv_8k_1rw_func_test.py + + +WORKING_TEST_STAMPS=$(filter-out $(addsuffix .ok, (TEST_BROKEN)), $(TEST_STAMPS)) + +$(TEST_DIRS): + @$(MAKE) --no-print-directory $@.ok + +tests: + @echo "Running the following tests" + @for S in $(WORKING_TEST_STAMPS); do echo " - $$S"; done + @sleep 5 + @$(MAKE) $(WORKING_TEST_STAMPS) +.PHONY: + +%.ok: %.py + @echo "Running $*" + @mkdir -p $(TOP_DIR)/compiler/tests/results/$* + @docker run -v $(TOP_DIR):/openram \ + -v $(SKY130_PDK):$(SKY130_PDK) \ + -e PDK_ROOT=$(PDK_ROOT) \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + -e OPENRAM_TMP=/openram/compiler/tests/results/$* \ + --user $(UID):$(GID) \ + vlsida/openram-ubuntu:latest \ + python3 -u /openram/compiler/tests/$*.py $(ARGS) && touch $@ + +.DELETE_ON_ERROR: $(TEST_STAMPS) + +TECHS := scn4m_subm freepdk45 +#sky130 + +$(TECHS): + @docker run -v $(TOP_DIR):/openram \ + -e OPENRAM_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + --user $(UID):$(GID) \ + -e OPENRAM_TMP=/openram/compiler/tests/tmp_$@/$* \ + vlsida/openram-ubuntu:latest \ + sh -c "python3 -u /openram/compiler/tests/regress.py $(ARGS) -t $@" +.PHONY: $(TECHS) + +regress: $(TECHS) +.PHONY: regress + +clean: + @rm -rf $(TEST_STAMPS) + @rm -rf $(TEST_DIRS) +.PHONE: clean