diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ed86160b..ec4f2934 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,44 +1,56 @@ name: ci on: [push] jobs: - scn4me_subm: + regress: runs-on: self-hosted steps: - name: Checkout code uses: actions/checkout@v1 - - name: SCMOS test + - name: Docker pull + run: docker pull vlsida/openram-ubuntu:latest + - name: PDK Install run: | - . /home/github-runner/setup-paths.sh export OPENRAM_HOME="${{ github.workspace }}/compiler" - export OPENRAM_TECH="${{ github.workspace }}/technology:/software/PDKs/skywater-tech" - export OPENRAM_TMP="${{ github.workspace }}/scn4me_subm_temp" + export OPENRAM_TECH="${{ github.workspace }}/technology" + #cd $OPENRAM_HOME/tests + #export PDK_ROOT="${{ github.workspace }}/pdk" + #make pdk + #make install + - name: Regress + run: | + export OPENRAM_HOME="${{ github.workspace }}/compiler" + export OPENRAM_TECH="${{ github.workspace }}/technology" + #cd $OPENRAM_HOME/.. && make pdk && make install + #export OPENRAM_TMP="${{ github.workspace }}/scn4me_subm_temp" #python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 12 -t scn4m_subm - $OPENRAM_HOME/tests/regress.py -j 24 -t scn4m_subm + #$OPENRAM_HOME/tests/regress.py -j 24 -t scn4m_subm + cd $OPENRAM_HOME/tests + make -j 36 - name: Archive if: ${{ failure() }} uses: actions/upload-artifact@v2 with: - name: scn4me_subm Archives - path: ${{ github.workspace }}/*.zip - freepdk45: - runs-on: self-hosted - steps: - - name: Checkout code - uses: actions/checkout@v1 - - name: FreePDK45 test - run: | - . /home/github-runner/setup-paths.sh - export OPENRAM_HOME="${{ github.workspace }}/compiler" - export OPENRAM_TECH="${{ github.workspace }}/technology:/software/PDKs/skywater-tech" - export OPENRAM_TMP="${{ github.workspace }}/freepdk45_temp" - #python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 12 -t freepdk45 - $OPENRAM_HOME/tests/regress.py -j 24 -t freepdk45 - - name: Archive - if: ${{ failure() }} - uses: actions/upload-artifact@v2 - with: - name: FreePDK45 Archives - path: ${{ github.workspace }}/*.zip + name: Regress Archives + path: ${{ github.workspace }}/compiler/tests/results/*.zip +# freepdk45: +# runs-on: self-hosted +# steps: +# - name: Checkout code +# uses: actions/checkout@v1 +# - name: FreePDK45 test +# run: | +# . /home/github-runner/setup-paths.sh +# export OPENRAM_HOME="${{ github.workspace }}/compiler" +# export OPENRAM_TECH="${{ github.workspace }}/technology:/software/PDKs/skywater-tech" +# export OPENRAM_TMP="${{ github.workspace }}/freepdk45_temp" +# #python3-coverage run -p $OPENRAM_HOME/tests/regress.py -j 12 -t freepdk45 +# $OPENRAM_HOME/tests/regress.py -j 24 -t freepdk45 +# - name: Archive +# if: ${{ failure() }} +# uses: actions/upload-artifact@v2 +# with: +# name: FreePDK45 Archives +# path: ${{ github.workspace }}/*.zip # coverage_stats: # if: ${{ always() }} # needs: [scn4me_subm, freepdk45] diff --git a/Makefile b/Makefile index af52eb2f..1f603a41 100644 --- a/Makefile +++ b/Makefile @@ -186,10 +186,11 @@ mount: @docker run -it -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_HOME=/openram/compiler \ + -e OPENRAM_TECH=/openram/technology \ + -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro \ --user $(UID):$(GID) \ - vlsida/openram-ubuntu:latest + vlsida/openram-ubuntu:latest .PHONY: mount clean: diff --git a/compiler/tests/09_sense_amp_array_test_pbitcell.py b/compiler/tests/09_sense_amp_array_pbitcell_test.py similarity index 100% rename from compiler/tests/09_sense_amp_array_test_pbitcell.py rename to compiler/tests/09_sense_amp_array_pbitcell_test.py diff --git a/compiler/tests/19_single_bank_global_bitline.py b/compiler/tests/19_single_bank_global_bitline_test.py similarity index 100% rename from compiler/tests/19_single_bank_global_bitline.py rename to compiler/tests/19_single_bank_global_bitline_test.py diff --git a/compiler/tests/21_hspice_delay_test.py b/compiler/tests/21_hspice_delay_test.py index 584e705f..4f8ba8ec 100755 --- a/compiler/tests/21_hspice_delay_test.py +++ b/compiler/tests/21_hspice_delay_test.py @@ -15,6 +15,7 @@ from globals import OPTS from sram_factory import factory import debug +@unittest.skip("SKIPPING 21_hspice_delay_test") class timing_sram_test(openram_test): def runTest(self): diff --git a/compiler/tests/21_hspice_setuphold_test.py b/compiler/tests/21_hspice_setuphold_test.py index 9154502e..76f47d1a 100755 --- a/compiler/tests/21_hspice_setuphold_test.py +++ b/compiler/tests/21_hspice_setuphold_test.py @@ -14,6 +14,7 @@ import globals from globals import OPTS +@unittest.skip("SKIPPING 21_hspice_setuphold_test") class timing_setup_test(openram_test): def runTest(self): diff --git a/compiler/tests/Makefile b/compiler/tests/Makefile index 6933f165..eca04336 100644 --- a/compiler/tests/Makefile +++ b/compiler/tests/Makefile @@ -1,16 +1,22 @@ TOP_DIR := $(realpath $(dir $(lastword $(MAKEFILE_LIST)))../..) include $(TOP_DIR)/openram.mk -.DEFAULT_GOAL := regress +.DEFAULT_GOAL := all -ARGS ?= "-k" +ARGS ?= +TECH ?= scn4m_subm +TECHS = scn4m_subm freepdk45 +# sky130 -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_DIR = $(TOP_DIR)/compiler/tests +TEST_SRCS = $(sort $(notdir $(wildcard $(TEST_DIR)/*_test.py))) +TEST_BASES = $(basename $(TEST_SRCS)) +TEST_STAMPS= $(addsuffix .ok,$(TEST_BASES)) -TEST_BROKEN := \ +OPENRAM_DIR = /openram/compiler/tests +RESULTS_DIR = $(OPENRAM_DIR)/results + +TEST_BROKEN = \ 50_riscv_1k_1rw1r_func_test.py \ 50_riscv_1k_1rw_func_test.py \ 50_riscv_1rw1r_func_test.py \ @@ -29,66 +35,65 @@ TEST_BROKEN := \ 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: +gettech = $(word 1,$(subst /, ,$*)) +getfile = $(word 2,$(subst /, ,$*)) +WORKING_TECH_TEST_STAMPS=$(foreach T, $(TECHS),$(addprefix $T/,$(WORKING_TEST_STAMPS))) -%.ok: %.py - @echo "Running $*" - @mkdir -p $(TOP_DIR)/compiler/tests/results/$* +all: $(WORKING_TECH_TEST_STAMPS) +.PHONY: all + +# Targets for each individual test +# e.g. make 04_pinv_1x_test +$(TEST_BASES): +# @echo "Running $(TECH) $@ ... " + @$(MAKE) --no-print-directory $(TECH)/$@.ok +.PHONY: $(TEST_BASES) + +# To run a test in a given technology +%.ok: +# @echo "Running $(gettech) $(getfile) ... " + @mkdir -p results/$*/tmp @docker run \ -v $(TOP_DIR):/openram \ -v $(FREEPDK45):/pdk/freepdk45\ -v $(PDK_ROOT):/pdk \ + -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro \ --user $(UID):$(GID) \ + -e OPENRAM_TMP=$(OPENRAM_DIR)/results/$*/tmp \ vlsida/openram-ubuntu:latest \ - sh -c ". ~/.bashrc && python3 -u /openram/compiler/tests/$*.py $(ARGS) && touch $@" - + sh -c ". /home/cad-user/.bashrc && python3 -u $(OPENRAM_DIR)/$(getfile).py \ + -t $(gettech) -k $(ARGS) -p $(OPENRAM_DIR)/results/$* > $(OPENRAM_DIR)/results/$*.out 2>&1 && touch $(OPENRAM_DIR)/results/$*.ok" + @test -f $(TOP_DIR)/compiler/tests/results/$*.ok && echo "$* ... PASS!" || echo "$* ... FAIL!" .DELETE_ON_ERROR: $(TEST_STAMPS) -TECHS := scn4m_subm freepdk45 -#sky130 - -$(TECHS): - docker run \ - -v $(TOP_DIR):/openram \ - -v $(FREEPDK45):/pdk/freepdk45 \ - -v $(PDK_ROOT):/pdk \ - --user $(UID):$(GID) \ - -e OPENRAM_TMP=/openram/compiler/tests/tmp_$@/$* \ - vlsida/openram-ubuntu:latest \ - sh -c ". ~/.bashrc && python3 -u /openram/compiler/tests/regress.py $(ARGS) -t $@" -.PHONY: $(TECHS) - -regress: $(TECHS) -.PHONY: regress - -foo: - docker run \ - -v $(TOP_DIR):/openram \ - -v $(FREEPDK45):/pdk/freepdk45 \ - -v $(PDK_ROOT):/pdk \ - --user $(UID):$(GID) \ - vlsida/openram-ubuntu:latest \ - sh -c ". ~/.bashrc && env" -.PHONY: foo +# This would use the regress.py script to run in parallel instead of +# the Makefile. +#$(TECHS): +# @echo "Running $*" +# docker run \ +# -v $(TOP_DIR):/openram \ +# -v $(FREEPDK45):/pdk/freepdk45 \ +# -v $(PDK_ROOT):/pdk \ +# --user $(UID):$(GID) \ +# -e OPENRAM_TMP=$(OPENRAM_DIR)/results/$@ \ +# vlsida/openram-ubuntu:latest \ +# sh -c ". /home/cad-user/.bashrc && python3 -u $(OPENRAM_DIR)/regress.py -t $@ $(ARGS)" +#.PHONY: $(TECHS) +#regress: $(TECHS) +#.PHONY: regress +# Mount environment for debug mount: docker run -it \ -v $(TOP_DIR):/openram \ -v $(FREEPDK45):/pdk/freepdk45 \ -v $(PDK_ROOT):/pdk \ + -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro \ --user $(UID):$(GID) \ vlsida/openram-ubuntu:latest .PHONY: mount clean: - @rm -rf $(TEST_STAMPS) - @rm -rf $(TEST_DIRS) + @rm -rf $(TOP_DIR)/compiler/tests/results .PHONE: clean